示例#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;
        }
示例#2
0
 private void OnDisable()
 {
     Current = null;
 }
示例#3
0
 private void OnEnable()
 {
     Current = this;
 }