Пример #1
0
 public void AddChild(ShaderGUITreeElement child)
 {
     this.children.Add(child);
     child.parent = this;
 }
Пример #2
0
        protected override ShaderGUITreeElement OnBuildRoot()
        {
            var root = new ShaderGUITreeElement();


            // Lit Area
            var lit = new HorizontalSplitter {
                labelContent = new GUIContent("Lit")
            };

            root.AddChild(lit);
            {
                // Rendering Mode
                lit.AddChild(new ShaderProperty {
                    property = "_Mode"
                });
                lit.AddChild(new SpaceLayout());

                // Base Map Label
                lit.AddChild(new Label {
                    labelContent = new GUIContent("Main Maps"), style = EditorStyles.boldLabel
                });

                // Albedo
                lit.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Albedo"),
                    textureProperty = "_MainTex",
                    extraProperty1  = "_Color"
                });

                // Metallic & Smoothness
                lit.AddChild(new TextureTwoLines
                {
                    labelContent    = new GUIContent("Metallic"),
                    textureProperty = "_GlossMap",
                    extraProperty1  = "_Metallic",
                    labelContant2   = new GUIContent("Smoothness"),
                    extraProperty2  = "_Glossiness"
                });

                // Occlusion
                lit.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Occlusion"),
                    textureProperty = "_OcclusionMap",
                    extraProperty1  = "_OcclusionStrength"
                });


                // Emission
                var emissionArea = new EmissionEnabledProperty();
                lit.AddChild(emissionArea);
                {
                    emissionArea.AddChild(new TextureWithHDRColor
                    {
                        labelContent    = new GUIContent("Color"),
                        colorProperty   = "_EmissionColor",
                        textureProperty = "_EmissionMap"
                    });

                    emissionArea.AddChild(new LightmapEmissionFlagsProperty
                    {
                        labelIndent = MaterialEditor.kMiniTextureFieldLabelIndentLevel
                    });
                }

                // Misc
                lit.AddChild(new TextureScaleOffset {
                    textureProperty = "_MainTex"
                });
                lit.AddChild(new SpaceLayout());

                // Forward Rendering options
            }


            // Displacement Area
            var displacement = new HorizontalSplitter {
                labelContent = new GUIContent("Displacement")
            };

            root.AddChild(displacement);
            {
                displacement.AddChild(new ShaderProperty {
                    property = "_DisplacementMode"
                });
                displacement.AddChild(new SpaceLayout());

                // Basis
                displacement.AddChild(new Label {
                    labelContent = new GUIContent("Basis"), style = EditorStyles.boldLabel
                });
                displacement.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Normal Map"),
                    textureProperty = "_BumpMap",
                    extraProperty1  = "_BumpScale"
                });
                displacement.AddChild(new TextureSingleLine
                {
                    labelContent    = new GUIContent("Height Map"),
                    textureProperty = "_ParallaxMap",
                    extraProperty1  = "_Parallax"
                });
                displacement.AddChild(new SpaceLayout());

                // Tessellation
                displacement.AddChild(new Label
                {
                    labelContent = new GUIContent("Tessellation"),
                    style        = EditorStyles.boldLabel
                });
                displacement.AddChild(new ShaderProperty {
                    property = "_Tessellation"
                });
                displacement.AddChild(new ShaderProperty {
                    property = "_TessellationEdge"
                });
                displacement.AddChild(new ShaderProperty {
                    property = "_TessellationPhong"
                });

                displacement.AddChild(new SpaceLayout());
            }


            root.AddChild(new DefaultOtherPropertyTab());
            root.AddChild(new DefaultShaderOptions());
            root.AddChild(new TreeDebugTab());

            return(root);
        }
Пример #3
0
 public void Reload()
 {
     this.rootItem = OnBuildRoot();
 }
Пример #4
0
 void DisplayChildRes(ShaderGUITreeElement elem)
 {
 }