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