Пример #1
0
 public BlueGrassSeedState(GameObject model, float spawnOddsPerDay, int maxSurvivalDays, BlueGrassLeaf leaf, bool firstSeed)
 {
     _model            = model;
     _spawnOddsPerDay  = spawnOddsPerDay * Mathf.Clamp(leaf.ShadowAtLocation * 0.9f, 0.25f, 1f);
     _survivalDaysLeft = maxSurvivalDays;
     _leaf             = leaf;
     _firstSeed        = firstSeed;
 }
Пример #2
0
        public void DeregisterLeaf(BlueGrassLeaf leaf, bool removeOccupation)
        {
            _removeBuffer.Add(leaf);

            Plant plant = GetComponent <Plant>();

            if (removeOccupation)
            {
                plant.VegetationSys.RemoveOccupationAt(leaf.Position);
            }

            if (_blueGrassSystem.Count == _removeBuffer.Count)
            {
                plant.VegetationSys.RemoveOccupationsBy(plant);
                Destroy(transform.parent.gameObject);
            }
        }
Пример #3
0
 public BlueGrassDormantState(BlueGrassLeaf leaf)
 {
     _leaf = leaf;
 }
Пример #4
0
 public BlueGrassFullyGrownState(BlueGrassLeaf leaf)
 {
     _leaf = leaf;
 }
Пример #5
0
 public BlueGrassGrowingState(BlueGrassLeaf leaf)
 {
     _leaf           = leaf;
     _chanceToSpawn *= leaf.ShadowAtLocation * 0.9f * 0.5f + 0.5f;
 }
Пример #6
0
 public BlueGrassConnection(BlueGrassLeaf initiator, BlueGrassLeaf receiver)
 {
     initiator.AddConnection(this);
     receiver.AddConnection(this);
 }