Ejemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        if (coll.name == "goal")
        {
            StopMotion();
            Endlevel.ActionAfterWin();
        }

        if (coll.tag == "obstacle")
        {
            StopMotion();
            Endlevel.ActionAfterLose();
        }
    }
Ejemplo n.º 2
0
 IEnumerator BackTime()
 {
     for (;;)
     {
         txt.text = timeLeft.ToString();
         timeLeft--;
         if (timeLeft == -1)
         {
             motion.StopMotion();
             Endlevel.ActionAfterLose();
         }
         yield return(new WaitForSeconds(1f));
     }
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     singleton = this;
 }