Esempio n. 1
0
        public static void DrawRTP(RTPOutput200 gen)
        {
                        #if RTP
            GeneratorEditors.UpdateMaterial();
            gen.rtp = GraphWindow.current.mapMagic?.GetComponent <ReliefTerrain>();

            if (gen.rtp != null)
            {
                if (textureNames == null || textureNames.Length != gen.rtp.globalSettingsHolder.numLayers)
                {
                    textureNames = new string[gen.rtp.globalSettingsHolder.numLayers];
                }
                textureNames.Process(i => gen.rtp.globalSettingsHolder.splats[i] != null ? gen.rtp.globalSettingsHolder.splats[i].name : null);             //nb linq?
            }

            using (Cell.Line)
            {
                //Cell.current.margins = new Padding(4);
                //DrawCustomMaterialWarning(MapMagic.instance.terrainSettings);
                DrawRTPComponentWarning();
            }
                        #else
            using (Cell.LinePx(36)) Draw.Label("RTP is not installed or RTP \ncompatibility is disabled");
                        #endif

            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: DrawRTPLayer);
        }
Esempio n. 2
0
        private static void DrawRTPLayer(Generator tgen, int num)
        {
            RTPOutput200 gen = (RTPOutput200)tgen;

            RTPOutput200.RTPLayer layer = gen.layers[num];
            if (layer == null)
            {
                return;
            }

            using (Cell.LinePx(32))
            {
                //Cell.current.margins = new Padding(0,0,0,1); //1-pixel more padding from the bottom since layers are 1 pixel overlayed

                if (num != 0)
                {
                    using (Cell.RowPx(0)) GeneratorDraw.DrawInlet(layer, gen);
                }
                else
                //disconnecting last layer inlet
                if (GraphWindow.current.graph.IsLinked(layer))
                {
                    GraphWindow.current.graph.UnlinkInlet(layer);
                }

                Cell.EmptyRowPx(10);

                //icon
                                #if RTP
                Texture2D icon = null;
                if (gen.rtp != null)
                {
                    if (layer.channelNum < gen.rtp.globalSettingsHolder.splats.Length)
                    {
                        icon = gen.rtp.globalSettingsHolder.splats[layer.channelNum];
                    }

                    using (Cell.RowPx(28))
                    {
                        Cell.EmptyLinePx(2);
                        using (Cell.Line) Draw.TextureIcon(icon);
                        Cell.EmptyLinePx(2);
                    }

                    //channel selector
                    Cell.EmptyRowPx(3);
                    using (Cell.Row)
                    {
                        Cell.EmptyLine();
                        using (Cell.LineStd) Draw.PopupSelector(ref layer.channelNum, textureNames);
                        Cell.EmptyLine();
                    }
                }
                else
                                #endif
                using (Cell.Row)
                {
                    Cell.EmptyLine();
                    using (Cell.LineStd) Draw.Field(ref layer.channelNum, "Channel");
                    Cell.EmptyLine();
                }

                Cell.EmptyRowPx(10);
                using (Cell.RowPx(0)) GeneratorDraw.DrawOutlet(layer);
            }
        }