예제 #1
0
 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());
 }
예제 #2
0
        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;
        }
예제 #3
0
 public void Create(GivingTree givingTree)
 {
     treeSpawn.givingTree = givingTree;
 }
예제 #4
0
 public void OnIterate(GivingTree nextTree)
 {
     treeSpawn.GetScript <TreeSpawn> ().OnIterate(nextTree.Leaves[4].treeSpawn);
 }