public static bool ButtonPressed(PrettyButton bt, ref float vfade, Color target, Color init)
        {
            bool res = false;

            if (vfade == 0f)
            {
                GUI.color = init;
            }
            else
            {
                GUI.color = target;
            }

            if (vfade == 0f)
            {
                bt.ShowFade(init, target, System.DateTime.Now.Millisecond * 0.00001f);
            }

            if (GUILayout.Button(bt.name))
            {
                vfade = (vfade == 0f ? System.DateTime.Now.Millisecond * 0.0001f : 0f);
            }

            if (vfade > 0f)
            {
                res = true;
            }

            GUI.color = init;
            return(res);
        }
Example #2
0
        void OnEnable()
        {
            worldManagerInspector = this;

            ResourceLoader.LoadResources();
            BiomeManager.FillBiomeList();
            FadeMenusManager.Clear();

            worldManager = (WorldManager)target;

            AbstractManagerEditor.manager = worldManager;

            _mySkin      = ResourceLoader.Skin1;
            defaultColor = GUI.color;


            FadeMenusManager.Add(FadeMenus.CreateInstance <NoiseFadeMenu>(), eFadeMenus.NOISE);
            FadeMenusManager.Add(FadeMenus.CreateInstance <WaterFadeMenu>(), eFadeMenus.WATER);
            FadeMenusManager.Add(FadeMenus.CreateInstance <SmoothTerrain>(), eFadeMenus.SMOOTH);
            FadeMenusManager.Add(FadeMenus.CreateInstance <SaveLoadFadeMenu>(), eFadeMenus.SAVELOAD);

            FadeMenusManager.SetMenusSkin(_mySkin);

            btBuild         = new PrettyButton("Build", -1);
            btBiomes        = new PrettyButton("GenerateBiomes", -1);
            btNoise         = new PrettyButton("ConfigureNoise", 1);
            btWater         = new PrettyButton("WaterSettings", 1);
            btSmooth        = new PrettyButton("SmoothTerrain", 1);
            btTransitions   = new PrettyButton("DrawTransitions", 1);
            btStitching     = new PrettyButton("StitchingChunks", 1);
            btBiomeSettings = new PrettyButton("BiomeSettings", 1);
            btGrassSettings = new PrettyButton("GrassSettings", 1);
            btReset         = new PrettyButton("ResetWorld", 1);
            btSaveLoad      = new PrettyButton("Save&Load", 1);


            TerrainResolutionInspector.SetManager(worldManager);
        }
Example #3
0
 public void Init(PrettyButton btBiomeSettings)
 {
     Init();
     this.btBiomeSettings = btBiomeSettings;
     this.btBiomeSettings.executeTicks = false;
 }