Exemplo n.º 1
0
        private void OnEnable()
        {
            spawner = (VegetationSpawner)target;

            if (spawner.terrains != null)
            {
                hasMissingTerrains = SpawnerBase.HasMissingTerrain(spawner.terrains);
            }

            seed     = serializedObject.FindProperty("seed");
            terrains = serializedObject.FindProperty("terrains");
            detailResolutionIndex = serializedObject.FindProperty("detailResolutionIndex");
            detailResolution      = serializedObject.FindProperty("detailResolution");
            grassPatchSize        = serializedObject.FindProperty("grassPatchSize");
            grassPatchSizeIndex   = serializedObject.FindProperty("grassPatchSizeIndex");
            terrainSettings       = serializedObject.FindProperty("terrainSettings");
            cellSize               = serializedObject.FindProperty("cellSize");
            cellDivisions          = serializedObject.FindProperty("cellDivisions");
            collisionLayerMask     = serializedObject.FindProperty("collisionLayerMask");
            highPrecisionCollision = serializedObject.FindProperty("highPrecisionCollision");
            tempColliders          = serializedObject.FindProperty("tempColliders");

            waterHeight      = serializedObject.FindProperty("waterHeight");
            autoRespawnTrees = serializedObject.FindProperty("autoRespawnTrees");

            VegetationSpawner.VisualizeCells = VisualizeCellsPersistent;

            Undo.undoRedoPerformed += OnUndoRedo;
        }
Exemplo n.º 2
0
 private void OnDisable()
 {
     Current = null;
 }
Exemplo n.º 3
0
 private void OnEnable()
 {
     Current = this;
 }