/// <summary> /// 开始游戏 /// </summary> public void BtnStartGame() { againRect.gameObject.SetActive(true); Destroy(startRect.gameObject); againBtn.gameObject.SetActive(false); FunctionTeris.getInstance().BeginGame(); }
/// <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)); } }
// 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"; } }
// Use this for initialization void Start() { FunctionTeris.getInstance().InitGame(againRect, goPrefab); }