GetRenderQueue() приватный Метод

private GetRenderQueue ( Shader s ) : int
s UnityEngine.Shader
Результат int
Пример #1
0
        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);
                }
            }
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            var s = target as Shader;

            if (s == null)
            {
                return;
            }

            GUI.enabled = true;

            EditorGUI.indentLevel = 0;

            ShowShaderCodeArea(s);

            if (s.isSupported)
            {
                EditorGUILayout.LabelField("Cast shadows", (ShaderUtil.HasShadowCasterPass(s)) ? "yes" : "no");
                EditorGUILayout.LabelField("Render queue", ShaderUtil.GetRenderQueue(s).ToString(CultureInfo.InvariantCulture));
                EditorGUILayout.LabelField("LOD", ShaderUtil.GetLOD(s).ToString(CultureInfo.InvariantCulture));
                EditorGUILayout.LabelField("Ignore projector", ShaderUtil.DoesIgnoreProjector(s) ? "yes" : "no");
                string disableBatchingString;
                switch (s.disableBatching)
                {
                case DisableBatchingType.False:
                    disableBatchingString = "no";
                    break;

                case DisableBatchingType.True:
                    disableBatchingString = "yes";
                    break;

                case DisableBatchingType.WhenLODFading:
                    disableBatchingString = "when LOD fading is on";
                    break;

                default:
                    disableBatchingString = "unknown";
                    break;
                }
                EditorGUILayout.LabelField("Disable batching", disableBatchingString);
                ShowKeywords(s);

                // If any SRP is active, then display the SRP Batcher compatibility status
                if (RenderPipelineManager.currentPipeline != null)
                {
                    // NOTE: Force the shader compilation to ensure GetSRPBatcherCompatibilityCode will be up to date
                    srpCompatibilityCheckMaterial.SetPass(0);
                    int    subShader  = ShaderUtil.GetShaderActiveSubshaderIndex(s);
                    int    SRPErrCode = ShaderUtil.GetSRPBatcherCompatibilityCode(s, subShader);
                    string result     = (0 == SRPErrCode) ? "compatible" : "not compatible";
                    EditorGUILayout.LabelField("SRP Batcher", result);
                    if (SRPErrCode != 0)
                    {
                        EditorGUILayout.HelpBox(ShaderUtil.GetSRPBatcherCompatibilityIssueReason(s, subShader, SRPErrCode), MessageType.Info);
                    }
                }

                ShowShaderProperties(s);
            }
        }