private void AddLeavesToBranches(GameObject branch)
{
int leafType = Random.Range(0, leaves.Length);
GameObject newLeaves = Instantiate(leaves[leafType], new Vector3(branch.transform.Find("placeHere").position.x,branch.transform.Find("placeHere").position.y,0), Quaternion.identity); //branch.transform
Branch bRef = branch.GetComponent();
bRef.connectedLeaves = newLeaves;
bRef.leavesComp = bRef.connectedLeaves.GetComponent();
bRef.canLandingCheck = true;
}

Leave a Reply