public GrassSeedState(GameObject model, float spawnOddsPerDay, int maxSurvivalDays, GrassLeaf leaf, bool firstSeed) { _model = model; _spawnOddsPerDay = spawnOddsPerDay * Mathf.Clamp((1 - leaf.ShadowAtLocation), 0.25f, 1f); _survivalDaysLeft = maxSurvivalDays; _leaf = leaf; _firstSeed = firstSeed; }
public void DeregisterLeaf(GrassLeaf leaf, bool removeOccupation) { _removeBuffer.Add(leaf); Plant plant = GetComponent <Plant>(); if (removeOccupation) { plant.VegetationSys.RemoveOccupationAt(leaf.Position); } if (_grassSystem.Count == _removeBuffer.Count) { plant.VegetationSys.RemoveOccupationsBy(plant); Destroy(transform.parent.gameObject); } }
public GrassDormantState(GrassLeaf leaf) { _leaf = leaf; }
public GrassFullyGrownState(GrassLeaf leaf) { _leaf = leaf; }
public GrassGrowingState(GrassLeaf leaf) { _leaf = leaf; _chanceToSpawn *= (1f - leaf.ShadowAtLocation) * 0.5f + 0.5f; }
public GrassConnection(GrassLeaf initiator, GrassLeaf receiver) { initiator.AddConnection(this); receiver.AddConnection(this); }