예제 #1
0
    // Use this for initialization
    void Start()
    {
        audioManager     = FindObjectOfType <AudioManager>();
        checkPointSystem = GameObject.FindGameObjectWithTag("CheckPointSystem").GetComponent <CheckPointSystem>();
        animator         = GetComponent <Animator>();
        akuAku           = GameObject.FindGameObjectWithTag("AkuAku").GetComponent <AkuAku>();
        lifeDisplayer    = lifeCanvas.GetComponent <Displayer>();
        wumpaDisplayer   = wumpaCanvas.GetComponent <Displayer>();
        spawnPoint       = transform.position;


        //get the position spawn
        if (checkPointSystem.checkpointsUnlocked.Count > 0)
        {
            lifeDisplayer.DisplayInfo(checkPointSystem.lifeAmount);
            Vector3 position = checkPointSystem.checkpointsUnlocked.Last();
            position.y        += 0.35F;
            transform.position = position;
        }
        else
        {
            transform.position = spawnPoint;
            TeleportStart();
        }
    }
예제 #2
0
 public void EatWumpaFruit()
 {
     checkPointSystem.wumpaFruitAmount++;
     wumpaDisplayer.DisplayInfo(checkPointSystem.wumpaFruitAmount);
     if (checkPointSystem.wumpaFruitAmount >= 100)
     {
         addLife();
         checkPointSystem.wumpaFruitAmount = 0;
     }
 }
예제 #3
0
 public void addLife()
 {
     checkPointSystem.lifeAmount++;
     audioManager.Play("life");
     lifeDisplayer.DisplayInfo(checkPointSystem.lifeAmount);
 }