示例#1
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        if (coll.name == "goal")
        {
            StopMotion();
            Endlevel.ActionAfterWin();
        }

        if (coll.tag == "obstacle")
        {
            StopMotion();
            Endlevel.ActionAfterLose();
        }
    }
示例#2
0
文件: timer.cs 项目: Greeall/sailboat
 IEnumerator BackTime()
 {
     for (;;)
     {
         txt.text = timeLeft.ToString();
         timeLeft--;
         if (timeLeft == -1)
         {
             motion.StopMotion();
             Endlevel.ActionAfterLose();
         }
         yield return(new WaitForSeconds(1f));
     }
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     singleton = this;
 }