Beispiel #1
0
 /// <summary>
 /// 开始游戏
 /// </summary>
 public void BtnStartGame()
 {
     againRect.gameObject.SetActive(true);
     Destroy(startRect.gameObject);
     againBtn.gameObject.SetActive(false);
     FunctionTeris.getInstance().BeginGame();
 }
Beispiel #2
0
 /// <summary>
 /// 再次游戏
 /// </summary>
 public void BtnAgainGame()
 {
     fTime   = 0.0f;
     iMinute = 0;
     iSecond = 0;
     againBtn.gameObject.SetActive(false);
     FunctionTeris.getInstance().BeginGame();
 }
 static int getInstance(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         FunctionTeris o = FunctionTeris.getInstance();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #4
0
 // Update is called once per frame
 void Update()
 {
     FunctionTeris.getInstance().DealGameFunction();
     if (FunctionTeris.getInstance().isGameStop)
     {
         if (!againBtn.gameObject.activeSelf)
         {
             againBtn.gameObject.SetActive(true);
         }
     }
     else
     {
         fTime  += Time.fixedDeltaTime;
         iSecond = (int)fTime;
         if (iSecond == 60)
         {
             iMinute++;
             iSecond = 0;
             fTime  -= 60;
         }
         socre.text = "Score: " + FunctionTeris.getInstance().iScore;
         time.text  = "Time: " + iMinute + "m " + iSecond + "s";
     }
 }
Beispiel #5
0
 // Use this for initialization
 void Start()
 {
     FunctionTeris.getInstance().InitGame(againRect, goPrefab);
 }