示例#1
0
        private void DrawShader()
        {
            var pipe = P3dShaderBundle.DetectProjectPipeline();

            EditorGUILayout.PropertyField(serializedObject.FindProperty("target"));

            EditorGUI.BeginDisabledGroup(true);
            EditorGUILayout.TextField("Project Pipeline", pipe.ToString());

            foreach (var variant in tgt.Variants)
            {
                var active = variant.Pipe == tgt.CurrentPipe;

                EditorGUILayout.Toggle(variant.Pipe.ToString(), active);
            }
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();

            if (GUILayout.Button("Switch Shader To " + pipe.ToString()) == true)
            {
                tgt.TrySwitchTo(pipe);

                serializedObject.Update();
            }

            if (GUILayout.Button("Switch All Shaders To " + pipe.ToString()) == true)
            {
                P3dShaderBundle.TrySwitchAllTo(pipe);

                serializedObject.Update();
            }
        }
示例#2
0
        protected virtual void Update()
        {
            var pipe = P3dShaderBundle.DetectProjectPipeline();

            if (P3dShaderBundle.IsStandard(pipe) == true)
            {
                ApplyIntensity(intensityInStandard);
            }
            else if (P3dShaderBundle.IsURP(pipe) == true)
            {
                ApplyIntensity(intensityInURP);
            }
            else if (P3dShaderBundle.IsHDRP(pipe) == true)
            {
                ApplyIntensity(intensityInHDRP);
            }
        }
示例#3
0
        public override void OnInspectorGUI()
        {
            tgt = (P3dShaderBundle)target;

            DrawShader();

        #if __BETTERSHADERS__
            EditorGUILayout.Separator();

            DrawCompile();
        #endif

            EditorGUILayout.Separator();

            DrawShaderBundles();

            serializedObject.ApplyModifiedProperties();
        }