Пример #1
0
    //Update is called once per frame
    void Update()
    {
        if (Time.deltaTime > timeCounter)
        {
            InitiateLevel.IntroLevel(RandomLevelScript.NextLevel());
            score.AddScore(10);
        }

        if (Input.anyKeyDown)
        {
            Application.LoadLevel(1);
        }
    }
Пример #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "ground")
        {
            inAir = false;
        }


        if (inAir && other.tag == "Finish")
        {
            score.AddScore(10);
            InitiateLevel.IntroLevel(RandomLevelScript.NextLevel());
            Debug.Log("win");
        }
        else if (other.tag == "Finish")
        {
            Application.LoadLevel(1);
            Debug.Log("lose");
        }
    }