Esempio n. 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;
 }
Esempio n. 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);
            }
        }
Esempio n. 3
0
 public BlueGrassDormantState(BlueGrassLeaf leaf)
 {
     _leaf = leaf;
 }
Esempio n. 4
0
 public BlueGrassFullyGrownState(BlueGrassLeaf leaf)
 {
     _leaf = leaf;
 }
Esempio n. 5
0
 public BlueGrassGrowingState(BlueGrassLeaf leaf)
 {
     _leaf           = leaf;
     _chanceToSpawn *= leaf.ShadowAtLocation * 0.9f * 0.5f + 0.5f;
 }
Esempio n. 6
0
 public BlueGrassConnection(BlueGrassLeaf initiator, BlueGrassLeaf receiver)
 {
     initiator.AddConnection(this);
     receiver.AddConnection(this);
 }