private void ShowShaderCodeArea(Shader s) { ShaderInspector.ShowSurfaceShaderButton(s); ShaderInspector.ShowFixedFunctionShaderButton(s); this.ShowCompiledCodeButton(s); this.ShowShaderErrors(s); }
private void ShowShaderErrors(ComputeShader s) { if (ShaderUtil.GetComputeShaderErrorCount(s) >= 1) { ShaderInspector.ShaderErrorListUI(s, ShaderUtil.GetComputeShaderErrors(s), ref this.m_ScrollPosition); } }
private void ShowShaderErrors(ComputeShader s) { if (ShaderUtil.GetComputeShaderErrorCount(s) < 1) { return; } ShaderInspector.ShaderErrorListUI((Object)s, ShaderUtil.GetComputeShaderErrors(s), ref this.m_ScrollPosition); }
private void ShowShaderErrors(Shader s) { int shaderErrorCount = ShaderUtil.GetShaderErrorCount(s); if (shaderErrorCount >= 1) { ShaderInspector.ShaderErrorListUI(s, ShaderUtil.GetShaderErrors(s), ref this.m_ScrollPosition); } }
private void ShowShaderErrors(ComputeShader s) { int n = ShaderUtil.GetComputeShaderErrorCount(s); if (n < 1) { return; } ShaderInspector.ShaderErrorListUI(s, ShaderUtil.GetComputeShaderErrors(s), ref m_ScrollPosition); }
private void ShowShaderErrors(RayTracingShader s) { int n = ShaderUtil.GetRayTracingShaderMessageCount(s); if (n < 1) { return; } ShaderInspector.ShaderErrorListUI(s, ShaderUtil.GetRayTracingShaderMessages(s), ref m_ScrollPosition); }
private static void ShowShaderProperties(Shader s) { GUILayout.Space(5f); GUILayout.Label("Properties:", EditorStyles.boldLabel, new GUILayoutOption[0]); int propertyCount = ShaderUtil.GetPropertyCount(s); for (int index = 0; index < propertyCount; ++index) { EditorGUILayout.LabelField(ShaderUtil.GetPropertyName(s, index), ShaderInspector.GetPropertyType(s, index) + ShaderUtil.GetPropertyDescription(s, index), new GUILayoutOption[0]); } }
private static void ShowShaderProperties(Shader s) { GUILayout.Space(5f); GUILayout.Label("Properties:", EditorStyles.boldLabel, new GUILayoutOption[0]); int propertyCount = ShaderUtil.GetPropertyCount(s); for (int i = 0; i < propertyCount; i++) { string propertyName = ShaderUtil.GetPropertyName(s, i); string label = ShaderInspector.GetPropertyType(s, i) + ShaderUtil.GetPropertyDescription(s, i); EditorGUILayout.LabelField(propertyName, label, new GUILayoutOption[0]); } }
private void ShowShaderErrors(ComputeShader s) { if (Event.current.type == EventType.Layout) { int n = ShaderUtil.GetComputeShaderMessageCount(s); m_ShaderMessages = null; if (n >= 1) { m_ShaderMessages = ShaderUtil.GetComputeShaderMessages(s); } } if (m_ShaderMessages == null) { return; } ShaderInspector.ShaderErrorListUI(s, m_ShaderMessages, ref m_ScrollPosition); }
public override void OnInspectorGUI() { Shader target = this.target as Shader; if ((UnityEngine.Object)target == (UnityEngine.Object)null) { return; } GUI.enabled = true; EditorGUI.indentLevel = 0; this.ShowShaderCodeArea(target); if (!target.isSupported) { return; } EditorGUILayout.LabelField("Cast shadows", !ShaderUtil.HasShadowCasterPass(target) ? "no" : "yes", new GUILayoutOption[0]); EditorGUILayout.LabelField("Render queue", ShaderUtil.GetRenderQueue(target).ToString((IFormatProvider)CultureInfo.InvariantCulture), new GUILayoutOption[0]); EditorGUILayout.LabelField("LOD", ShaderUtil.GetLOD(target).ToString((IFormatProvider)CultureInfo.InvariantCulture), new GUILayoutOption[0]); EditorGUILayout.LabelField("Ignore projector", !ShaderUtil.DoesIgnoreProjector(target) ? "no" : "yes", new GUILayoutOption[0]); string label2; switch (target.disableBatching) { case DisableBatchingType.False: label2 = "no"; break; case DisableBatchingType.True: label2 = "yes"; break; case DisableBatchingType.WhenLODFading: label2 = "when LOD fading is on"; break; default: label2 = "unknown"; break; } EditorGUILayout.LabelField("Disable batching", label2, new GUILayoutOption[0]); ShaderInspector.ShowShaderProperties(target); }
public override void OnInspectorGUI() { Shader shader = base.target as Shader; if (!(shader == null)) { GUI.enabled = true; EditorGUI.indentLevel = 0; this.ShowShaderCodeArea(shader); if (shader.isSupported) { EditorGUILayout.LabelField("Cast shadows", (!ShaderUtil.HasShadowCasterPass(shader)) ? "no" : "yes", new GUILayoutOption[0]); EditorGUILayout.LabelField("Render queue", ShaderUtil.GetRenderQueue(shader).ToString(CultureInfo.InvariantCulture), new GUILayoutOption[0]); EditorGUILayout.LabelField("LOD", ShaderUtil.GetLOD(shader).ToString(CultureInfo.InvariantCulture), new GUILayoutOption[0]); EditorGUILayout.LabelField("Ignore projector", (!ShaderUtil.DoesIgnoreProjector(shader)) ? "no" : "yes", new GUILayoutOption[0]); string label; switch (shader.disableBatching) { case DisableBatchingType.False: label = "no"; break; case DisableBatchingType.True: label = "yes"; break; case DisableBatchingType.WhenLODFading: label = "when LOD fading is on"; break; default: label = "unknown"; break; } EditorGUILayout.LabelField("Disable batching", label, new GUILayoutOption[0]); ShaderInspector.ShowShaderProperties(shader); } } }