public bool SameGenes(GenePool genes) { bool same = false; if (this.genes.GetAllGenes().Count == genes.GetAllGenes().Count) { same = true; for (int i = 0; i < this.genes.GetAllGenes().Count; i++) { if (this.genes.GetAllGenes()[i] != genes.GetAllGenes()[i]) { same = false; } } } return(same); }
private void Update() { if (genes.GetAllGenes().Count > 0) { if (delta > genes.GrowthTime()) { delta = 0; if (watered) { GrowingUp(); } } AddTime(Time.deltaTime); } }
private void Update() { if (genes.GetAllGenes().Count > 0) { if (delta > genes.GrowthTime()) { delta = 0; if (watered && weeded) { GrowingUp(); } } delta += Time.deltaTime; } }
public bool PlantPlant(GenePool seedling, int box) { bool canPlant = false; if (plants[box] == null && (box == 1 || box == 0)) { canPlant = true; plants[box] = Instantiate(plantPrefab, planterBoxes[box].transform).GetComponent <Plant>(); foreach (Gene entity in seedling.GetAllGenes()) { plants[box].GetGenes().ModifyGenes(entity, plants[box].GetMainRender(), plants[box].GetSubRender()); } plants[box].PlantGrewUp(RandomGrowthSpread); } return(canPlant); }