void Awake()
        {
            if (Application.isPlaying)
            {
                return;
            }

            worldInstance = this;

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

            TerrainName = TerrainObjectName;

            terrainResolution = new TerrainResolution();

            nameScene = UnityEditor.EditorApplication.currentScene.Substring(UnityEditor.EditorApplication.currentScene.LastIndexOf("/") + 1);
            nameScene = nameScene.Substring(0, nameScene.IndexOf("."));
            Load(Paths.SavedWorlds + nameScene + ".data");
        }
Exemplo n.º 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);
        }