/// <summary> /// Destroys all child branches and resets the plant so it can be regenerated. /// </summary> public void ClearChildren() { PlantGeneratorBranch[] branches = this.GetComponentsInChildren <PlantGeneratorBranch>(); if (branches != null) { for (int i = 0; i < branches.Length; i++) { Pooler.DestroyImmediate(branches[i].gameObject); } } this.IsGenerated = false; }