void Start() { SSDirector director = SSDirector.getInstance(); director.currentSceneController = this; diskFactory = Singleton <DiskFactory> .Instance; actionManager = gameObject.AddComponent <FlyActionManager>() as FlyActionManager; actionManager.setRound(round); userGUI = gameObject.AddComponent <UserGUI>() as UserGUI; }
//检查当前游戏状态 //检查当前trail是否足以进入下一 round //检查当前round是否足够结束游戏 public void checkStatus() { //此时的分数大于设置的阈值,游戏进入下一阶段,分数清零重新计算 if (score >= scoreOfRound[round]) { currentTrial++; score = 0; //当游戏的trail大于3时进入下一 round if (currentTrial >= 3) { round++; life = 10;//当游戏进入到新的round生命值回复 if (round >= 3) { winGame(); } currentTrial = 0; actionManager.setRound(round); } } }