예제 #1
0
    private IEnumerator showThu()
    {
        List <GameObject> listHiddenThu;

        while (!gameover)
        {
            listHiddenThu = filterHiddenThu();
            if (listHiddenThu.Count > 0)
            {
                newTrangThai thuToShow = listHiddenThu[random(listHiddenThu.Count)].GetComponent <newTrangThai>();
                thuToShow.show(randomEvent());
            }
            yield return(new WaitForSeconds(interval));
        }
    }
예제 #2
0
 private void checkHit()
 {
     if (!gameover)
     {
         GameObject thu = input.hitDetect();
         if (thu != null)
         {
             //		SoundControl.sound.playHitSound();
             if (thu.GetComponent <newTrangThai>() != null)
             {
                 newTrangThai trangThaiThu = thu.GetComponent <newTrangThai>();
                 if (trangThaiThu.isHitable() && !pause)
                 {
                     if (trangThaiThu.getHit())
                     {
                         SoundControlCS.sound.playDieSound();
                         scoring(trangThaiThu.getThuPoint());
                     }
                 }
             }
         }
     }
 }