コード例 #1
0
ファイル: MatrixEditors.cs プロジェクト: louis030195/niwrad
        public static void DrawMegaSplatAssignedTextureArraysWarning()
        {
            Terrains.TerrainSettings settings = GraphWindow.current.mapMagic.terrainSettings;
            {
                using (Cell.LinePx(70))
                {
                    //Cell.current.margins = new Padding(4);

                    GUIStyle backStyle = UI.current.textures.GetElementStyle("DPUI/Backgrounds/Foldout");
                    Draw.Element(backStyle);
                    Draw.Element(backStyle);

                    using (Cell.Row) Draw.Label("Material has \nno Albedo/Height \nTexture Array \nassigned");

                    using (Cell.RowPx(30))
                        if (Draw.Button("Fix"))
                        {
                            Shader shader = ReflectionExtensions.CallStaticMethodFrom("Assembly-CSharp-Editor", "SplatArrayShaderGUI", "NewShader", null) as Shader;
                            settings.material = new Material(shader);
                            settings.material.EnableKeyword("_TERRAIN");

                            GraphWindow.current.mapMagic.ApplyTerrainSettings();

                            GraphWindow.RefreshMapMagic();
                        }
                }
                Cell.EmptyLinePx(5);
            }
        }