您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
48 行
1.9 KiB
48 行
1.9 KiB
#if UNITY_EDITOR
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.Experimental.Rendering.LightweightPipeline
|
|
{
|
|
internal static class SceneViewDrawMode
|
|
{
|
|
static bool RejectDrawMode(SceneView.CameraMode cameraMode)
|
|
{
|
|
if (cameraMode.drawMode == DrawCameraMode.TexturedWire ||
|
|
cameraMode.drawMode == DrawCameraMode.ShadowCascades ||
|
|
cameraMode.drawMode == DrawCameraMode.RenderPaths ||
|
|
cameraMode.drawMode == DrawCameraMode.AlphaChannel ||
|
|
cameraMode.drawMode == DrawCameraMode.Overdraw ||
|
|
cameraMode.drawMode == DrawCameraMode.Mipmaps ||
|
|
cameraMode.drawMode == DrawCameraMode.SpriteMask ||
|
|
cameraMode.drawMode == DrawCameraMode.DeferredDiffuse ||
|
|
cameraMode.drawMode == DrawCameraMode.DeferredSpecular ||
|
|
cameraMode.drawMode == DrawCameraMode.DeferredSmoothness ||
|
|
cameraMode.drawMode == DrawCameraMode.DeferredNormal ||
|
|
cameraMode.drawMode == DrawCameraMode.ValidateAlbedo ||
|
|
cameraMode.drawMode == DrawCameraMode.ValidateMetalSpecular ||
|
|
cameraMode.drawMode == DrawCameraMode.ShadowMasks ||
|
|
cameraMode.drawMode == DrawCameraMode.LightOverlap
|
|
)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
public static void SetupDrawMode()
|
|
{
|
|
ArrayList sceneViewArray = SceneView.sceneViews;
|
|
foreach (SceneView sceneView in sceneViewArray)
|
|
sceneView.onValidateCameraMode += RejectDrawMode;
|
|
}
|
|
|
|
public static void ResetDrawMode()
|
|
{
|
|
ArrayList sceneViewArray = SceneView.sceneViews;
|
|
foreach (SceneView sceneView in sceneViewArray)
|
|
sceneView.onValidateCameraMode -= RejectDrawMode;
|
|
}
|
|
}
|
|
}
|
|
#endif
|