AddLeavesToBranches()

Found in:

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;
  }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *