Example #1
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.tag == "FinalCollectible")
        {
            // Summons object animation and destroys it
            collider.gameObject.GetComponent <SummonAnimation>().Summon();
            Destroy(collider.gameObject);

            // Loads next scene
            //if (SceneManager.GetActiveScene().buildIndex == 5) //Level 03
            //    loader.FadeToScene(5);
            //else
            loader.FadeToNextScene();
        }
    }
Example #2
0
    public void OnClick()
    {
        currentPannel++;
        if (currentPannel >= pannels.Length - 1)
        {
            textFrame.sprite = finalText;
        }

        if (currentPannel < pannels.Length)
        {
            imageFrame.sprite = pannels[currentPannel];
        }
        else
        {
            levelChanger.FadeToNextScene();
        }
    }
Example #3
0
 private void OnTriggerEnter(Collider other)
 {
     lvlChanger.FadeToNextScene();
 }