コード例 #1
0
ファイル: MatrixEditors.cs プロジェクト: louis030195/niwrad
        public static void HeightOutputEditor(MatrixGenerators.HeightOutput200 heightOut)
        {
            using (Cell.Padded(1, 1, 0, 0))
            {
                using (Cell.LinePx(0))
                {
                    Cell.current.fieldWidth = 0.4f;

                    if (GraphWindow.current.mapMagic != null)
                    {
                        using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.height, "Height");
                    }

                    if (GraphWindow.current.mapMagic != null)
                    {
                        using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.heightInterpolation, "Interpolate");
                    }

                    using (Cell.LineStd) Draw.Field(ref heightOut.outputLevel, "Out Level");

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.RefreshMapMagic(heightOut);
                    }
                }
            }
        }
コード例 #2
0
ファイル: MegaSplatEditor.cs プロジェクト: AJ213/Awitu
        public static void DrawMegaSplat(MatrixGenerators.MegaSplatOutput200 gen)
        {
                        #if !__MEGASPLAT__
            using (Cell.LinePx(60))
                Draw.Helpbox("MicroSplat doesn't seem to be installed, or MicroSplat compatibility is not enabled in settings");
                        #endif
            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.terrainSettings.material, "Material");

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.current.mapMagic.ApplyTerrainSettings();
                    }
                }

                using (Cell.LineStd)
                {
                                        #if __MEGASPLAT__
                    MegaSplatTextureList texList = GraphWindow.current.mapMagic.globals.megaSplatTexList as MegaSplatTextureList;
                    GeneratorDraw.DrawGlobalVar(ref texList, "TexList");
                    GraphWindow.current.mapMagic.globals.megaSplatTexList = texList;
                                        #endif
                }
            }

            using (Cell.LinePx(0)) CheckShader(gen);
        }
コード例 #3
0
ファイル: VSProMapsEditor.cs プロジェクト: AJ213/Awitu
        public static void DrawVSProMapsOut(VSProMapsOut gen)
        {
                        #if VEGETATION_STUDIO_PRO
            VegetationPackagePro package = null;
            if (GraphWindow.current.mapMagic != null)
            {
                package = GraphWindow.current.mapMagic.globals.vegetationPackage as VegetationPackagePro;
                using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref package, "Package");
                GraphWindow.current.mapMagic.globals.vegetationPackage = package;
            }

            //populating masks list to choose from
            if (package != null)
            {
                int masksCount = package.TextureMaskGroupList.Count;
                if (maskNames == null || maskNames.Length != masksCount)
                {
                    maskNames = new string[masksCount];
                }

                for (int i = 0; i < masksCount; i++)
                {
                    maskNames[i] = (i + 1).ToString() + ". " +
                                   package.TextureMaskGroupList[i].TextureMaskName + " - " +
                                   package.TextureMaskGroupList[i].TextureMaskType;
                }
            }

            using (Cell.LineStd)
            {
                if (package != null)
                {
                    Draw.PopupSelector(ref gen.maskGroup, maskNames, "Group");
                }
                else
                {
                    Draw.Field(ref gen.maskGroup, "Group");
                }
            }
            using (Cell.LineStd)
                Draw.PopupSelector(ref gen.textureChannel, channelNames, "Channel");
                        #else
            using (Cell.LinePx(76))
                Draw.Helpbox("Vegetation Studio Pro doesn't seem to be installed, or Vegetation Studio Pro compatibility is not enabled in settings");

            using (Cell.LineStd)
                Draw.Field(ref gen.maskGroup, "Group");
            using (Cell.LineStd)
                Draw.PopupSelector(ref gen.textureChannel, channelNames, "Channel");
                        #endif
        }
コード例 #4
0
        public static void DrawMicroSplat(MicroSplatOutput200 gen)
        {
                        #if !__MICROSPLAT__
            using (Cell.LinePx(60))
                Draw.Helpbox("MicroSplat doesn't seem to be installed, or MicroSplat compatibility is not enabled in settings");
                        #endif
            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    //Cell.current.fieldWidth = 0.5f;
                    using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.terrainSettings.material, "Material");

                    using (Cell.LineStd)
                    {
                        Cell.current.fieldWidth = 0.15f;
                        GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.assignComponent, "Set Component");
                    }

                                        #if __MICROSPLAT__
                    if (GraphWindow.current.mapMagic.globals.assignComponent)
                    {
                        using (Cell.LineStd)
                            GraphWindow.current.mapMagic.globals.microSplatPropData = GeneratorDraw.DrawGlobalVar <MicroSplatPropData>(
                                GraphWindow.current.mapMagic.globals.microSplatPropData == null ? null : (MicroSplatPropData)GraphWindow.current.mapMagic.globals.microSplatPropData,
                                "PropData");
                    }
                                        #endif

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.current.mapMagic.ApplyTerrainSettings();
                    }
                }
            }

            using (Cell.LinePx(0)) CheckShader(gen);
            using (Cell.LinePx(0)) CheckCustomSplatmaps(gen);

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawMicroSplatLayer);
        }
コード例 #5
0
ファイル: MegaSplatEditor.cs プロジェクト: fanfer/CSharp
        public static void DrawMegaSplat(MegaSplatOutput200 gen)
        {
                        #if !__MEGASPLAT__
            using (Cell.LinePx(60))
                Draw.Helpbox("MicroSplat doesn't seem to be installed, or MicroSplat compatibility is not enabled in settings");
                        #endif
            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.terrainSettings.material, "Material");

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.current.mapMagic.ApplyTerrainSettings();
                    }
                }

                using (Cell.LineStd)
                {
                                        #if __MEGASPLAT__
                    MegaSplatTextureList texList = GraphWindow.current.mapMagic.globals.megaSplatTexList as MegaSplatTextureList;
                    GeneratorDraw.DrawGlobalVar(ref texList, "TexList");
                    GraphWindow.current.mapMagic.globals.megaSplatTexList = texList;
                                        #endif
                }
            }
            else
            {
                using (Cell.LinePx(18 + 18)) Draw.Label("Not assigned to current \nMapMagic object");
            }

            using (Cell.LinePx(0)) CheckShader(gen);

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true, unlinkBackground: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawCTSLayer);
        }
コード例 #6
0
ファイル: MatrixEditors.cs プロジェクト: louis030195/niwrad
        public static void DrawGrassOutput(MatrixGenerators.GrassOutput200 grassOut)
        {
            using (Cell.Padded(1, 1, 0, 0))
            {
                //Cell.current.margins = new Padding(4,4,4,4);

                using (Cell.LinePx(0))
                {
                    Cell.current.fieldWidth = 0.6f;

                    using (Cell.LineStd) Draw.Field(ref grassOut.renderMode, "Mode");

                    if (grassOut.renderMode == MatrixGenerators.GrassOutput200.GrassRenderMode.MeshUnlit || grassOut.renderMode == MatrixGenerators.GrassOutput200.GrassRenderMode.MeshVertexLit)
                    {
                        using (Cell.LineStd) grassOut.prototype.prototype = Draw.Field(grassOut.prototype.prototype, "Object");
                        grassOut.prototype.prototypeTexture = null;                         //otherwise this texture will be included to build even if not displayed
                        grassOut.prototype.usePrototypeMesh = true;
                    }
                    else
                    {
                        using (Cell.LineStd) grassOut.prototype.prototypeTexture = Draw.Field(grassOut.prototype.prototypeTexture, "Texture");
                        grassOut.prototype.prototype        = null;                  //otherwise this object will be included to build even if not displayed
                        grassOut.prototype.usePrototypeMesh = false;
                    }
                    switch (grassOut.renderMode)
                    {
                    case MatrixGenerators.GrassOutput200.GrassRenderMode.Grass: grassOut.prototype.renderMode = DetailRenderMode.Grass; break;

                    case MatrixGenerators.GrassOutput200.GrassRenderMode.Billboard: grassOut.prototype.renderMode = DetailRenderMode.GrassBillboard; break;

                    case MatrixGenerators.GrassOutput200.GrassRenderMode.MeshVertexLit: grassOut.prototype.renderMode = DetailRenderMode.VertexLit; break;

                    case MatrixGenerators.GrassOutput200.GrassRenderMode.MeshUnlit: grassOut.prototype.renderMode = DetailRenderMode.Grass; break;
                    }
                }

                using (Cell.LinePx(0))
                {
                    Cell.current.fieldWidth = 0.4f;

                    using (Cell.LineStd) Draw.Field(ref grassOut.density, "Density");
                    using (Cell.LineStd) grassOut.prototype.dryColor = Draw.Field(grassOut.prototype.dryColor, "Dry");
                    using (Cell.LineStd) grassOut.prototype.healthyColor = Draw.Field(grassOut.prototype.healthyColor, "Healthy");

                    Vector2 temp = new Vector2(grassOut.prototype.minWidth, grassOut.prototype.maxWidth);
                    using (Cell.LineStd) Draw.Field(ref temp, "Width", xName: "Min", yName: "Max", xyWidth: 25);
                    grassOut.prototype.minWidth = temp.x; grassOut.prototype.maxWidth = temp.y;

                    temp = new UnityEngine.Vector2(grassOut.prototype.minHeight, grassOut.prototype.maxHeight);
                    using (Cell.LineStd) Draw.Field(ref temp, "Height", xName: "Min", yName: "Max", xyWidth: 25);
                    grassOut.prototype.minHeight = temp.x; grassOut.prototype.maxHeight = temp.y;

                    using (Cell.LineStd) grassOut.prototype.noiseSpread = (float)Draw.Field(grassOut.prototype.noiseSpread, "Noise");

                    if (GraphWindow.current.mapMagic != null)
                    {
                        using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.grassResPerPatch, "Res/Patch");
                    }
                }
            }
        }
コード例 #7
0
ファイル: MicroSplatEditor.cs プロジェクト: fanfer/CSharp
        public static void DrawMicroSplat(MicroSplatOutput200 gen)
        {
                        #if !__MICROSPLAT__
            using (Cell.LinePx(60))
                Draw.Helpbox("MicroSplat doesn't seem to be installed, or MicroSplat compatibility is not enabled in settings");
                        #endif
            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    //Cell.current.fieldWidth = 0.5f;
                    using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.terrainSettings.material, "Material");

                    using (Cell.LinePx(0))
                        using (new Draw.FoldoutGroup(ref gen.guiAdvanced, "Advanced"))
                            if (gen.guiAdvanced)
                            {
                                using (Cell.LineStd)
                                {
                                    Cell.current.fieldWidth = 0.15f;
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.assignComponent, "Set Component");
                                }

                                                        #if __MICROSPLAT__
                                if (GraphWindow.current.mapMagic.globals.assignComponent)
                                {
                                    using (Cell.LineStd)
                                        GraphWindow.current.mapMagic.globals.microSplatPropData = GeneratorDraw.DrawGlobalVar <MicroSplatPropData>(
                                            GraphWindow.current.mapMagic.globals.microSplatPropData == null ? null : (MicroSplatPropData)GraphWindow.current.mapMagic.globals.microSplatPropData,
                                            "PropData");
                                }
                                                        #endif

                                //using (Cell.LineStd)
                                //	Draw.Label("Apply Type");

                                using (Cell.LineStd)
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.microSplatApplyType, "Apply Type");

                                using (Cell.LineStd)
                                {
                                    Cell.current.fieldWidth = 0.15f;
                                    Cell.current.disabled   = GraphWindow.current.mapMagic.globals.microSplatApplyType == Globals.MicroSplatApplyType.Splats;                         //no tex names when applying
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.useCustomControlTextures, "Custom Splatmaps");
                                }

                                using (Cell.LineStd)
                                {
                                    Cell.current.fieldWidth = 0.15f;
                                    Cell.current.disabled   = GraphWindow.current.mapMagic.globals.microSplatApplyType == Globals.MicroSplatApplyType.Splats;                         //no normals texture when applying only splats
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.microSplatNormals, "Add Normals Tex");
                                }

                                //using (Cell.LineStd)
                                //	{ Cell.current.fieldWidth = 0.15f; GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.microSplatTerrainDescriptor, "Add Descriptor"); }
                            }

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.current.mapMagic.ApplyTerrainSettings();
                    }
                }
            }
            else
            {
                using (Cell.LinePx(18 + 18)) Draw.Label("Not assigned to current \nMapMagic object");
            }

            using (Cell.LinePx(0)) CheckShader(gen);
            //using (Cell.LinePx(0)) CheckCustomSplatmaps(gen);

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true, unlinkBackground: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawMicroSplatLayer);
        }
コード例 #8
0
ファイル: VSProMapsEditor.cs プロジェクト: louis030195/niwrad
        public static void DrawVSProMapsOut(VSProMapsOut gen)
        {
                        #if VEGETATION_STUDIO_PRO
            Cell.current.fieldWidth = 0.49f;

            using (Cell.LinePx(0))
                using (Cell.Padded(1, 1, 0, 0))
                {
                    if (GraphWindow.current.mapMagic != null)
                    {
                        VegetationSystemPro system = GraphWindow.current.mapMagic.globals.vegetationSystem as VegetationSystemPro;
                        using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref system, "System");
                        GraphWindow.current.mapMagic.globals.vegetationSystem = system;
                    }

                    VegetationPackagePro package = null;
                    if (GraphWindow.current.mapMagic != null)
                    {
                        package = GraphWindow.current.mapMagic.globals.vegetationPackage as VegetationPackagePro;
                        using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref package, "Package");
                        GraphWindow.current.mapMagic.globals.vegetationPackage = package;
                    }

                    //populating masks list to choose from
                    if (package != null)
                    {
                        int masksCount = package.TextureMaskGroupList.Count;
                        if (maskNames == null || maskNames.Length != masksCount)
                        {
                            maskNames = new string[masksCount];
                        }

                        for (int i = 0; i < masksCount; i++)
                        {
                            maskNames[i] = (i + 1).ToString() + ". " +
                                           package.TextureMaskGroupList[i].TextureMaskName + " - " +
                                           package.TextureMaskGroupList[i].TextureMaskType;
                        }
                    }

                    Cell.EmptyLinePx(4);

                    using (Cell.LineStd)
                    {
                        if (package != null)
                        {
                            Draw.PopupSelector(ref gen.maskGroup, maskNames, "Group");
                        }
                        else
                        {
                            Draw.Field(ref gen.maskGroup, "Group");
                        }
                    }
                    using (Cell.LineStd)
                        Draw.PopupSelector(ref gen.textureChannel, channelNames, "Channel");
                }


            Cell.EmptyLinePx(3);
            using (Cell.LineStd)
                using (new Draw.FoldoutGroup(ref gen.guiAdvanced, "Advanced", isLeft: false, padding: 1))
                    if (gen.guiAdvanced)
                    {
                        if (GraphWindow.current.mapMagic != null)
                        {
                            using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(
                                    ref GraphWindow.current.mapMagic.globals.vegetationSystemCopy,
                                    "Copy VS");
                        }

                        using (Cell.LineStd) Draw.Field(ref gen.outputLevel, "Out Level");
                    }
                        #else
            using (Cell.LinePx(76))
                Draw.Helpbox("Vegetation Studio Pro doesn't seem to be installed, or Vegetation Studio Pro compatibility is not enabled in settings");

            using (Cell.LineStd)
                Draw.Field(ref gen.maskGroup, "Group");
            using (Cell.LineStd)
                Draw.PopupSelector(ref gen.textureChannel, channelNames, "Channel");
                        #endif
        }