Example #1
0
    public void CreateTree(LevelInfo lvlInfo, int treesize)
    {
        //Clean last tree first
        CleanTree();

        //Create and add
        for (int i = 0;
             (partsInScreen > treesize) ? i < treesize : i < partsInScreen;
             i++)
        {
            //Replace by pool... or not
            GameObject p = Instantiate(samplePart,
                                       basePoint.transform.position + new Vector3(0, partSizeY * i + partSizeY / 2, 0),
                                       Quaternion.identity, basePoint);

            //Set Up Log Prefab
            p.GetComponent <LogBehaviour>().SetUpLog(lvlInfo.lvlTypeInfo.treeType);
            //Fill the list from bottom to top
            treeParts.Add(p);

            p.GetComponent <LogBehaviour>().myTree = this;
        }
        totalTreeSizeInParts = treesize;
        partLeft             = treesize;

        treeCreated = true;

        if (syncroAction != null)
        {
            syncroAction.CompleteAction();
        }
    }
Example #2
0
 public void Activate()
 {
     if (syncroAction != null)
     {
         syncroAction.CompleteAction();
     }
     isReadyToShow = true;
     OnActivate.Invoke();
 }
 public void OnCompleteCurrentTutorial()
 {
     waitForMe.actionCompleted = true;
     waitForMe.CompleteAction();
 }