void Zoom() { testTree = currentIteration.ActiveLeaf.treeSpawn.GetScript <TreeSpawn> ().nextTree.GetScript <GivingTree> (); //Debug.Log (currentIteration.ActiveLeaf.treeSpawn.GetScript<TreeSpawn> ().nextTree.GetScript<GivingTree> ().Leaves.Length); //mainCamera.SetParent (currentIteration.ActiveLeaf.treeSpawn.GetScript<TreeSpawn> ().nextTree.GetScript<GivingTree> ().Leaves[4].treeSpawn); // lol mainCamera.SetParent(currentIteration.ActiveLeaf.treeSpawn.GetScript <TreeSpawn> ().nextTree); StartCoroutine(CoZoom()); }
public Iteration(Transform givingTreeTransform, Transform parent, bool first = false) { this.givingTreeTransform = givingTreeTransform; Transform t = Instantiate(givingTreeTransform) as Transform; t.SetParent(parent); t.localPosition = Vector3.zero; this.givingTree = t.GetScript <GivingTree> (); this.givingTree.Create(); if (!first) { t.localScale = new Vector3(0.1f, 0.1f, 0.1f); } leaves = this.givingTree.Leaves; }
public void Create(GivingTree givingTree) { treeSpawn.givingTree = givingTree; }
public void OnIterate(GivingTree nextTree) { treeSpawn.GetScript <TreeSpawn> ().OnIterate(nextTree.Leaves[4].treeSpawn); }