public void ActionWaiting(StateScene stateStatus) { isInitSuccess = false; _BOL_ShowHeroAndSkill.Hide(); switch (stateStatus) { case StateScene.showplayer: if (_BOL_ChoiceHero != null) { _BOL_ChoiceHero.Hide(); //_BOL_ShowPlayer.Show(); //imageVS.gameObject.SetActive(true); //if (tweenScale != null) { // LeanTween.cancel(imageVS.gameObject, tweenScale.uniqueId); // tweenScale = null; //} //tweenScale = LeanTween.scale(imageVS.gameObject, Vector3.one, 0.5f).setOnComplete(() => { tweenScale = null; }).setEase(LeanTweenType.easeOutBack); } break; case StateScene.choicehero: Debug.Log("choice hero " + ChairPosition); _BOL_ShowHeroAndSkill.Hide(); _BOL_ChoiceHero.Hide(); if (ChairPosition == Constant.CHAIR_LEFT || ChairPosition == Constant.CHAIR_RIGHT) { _BOL_ChoiceHero.Show(); } break; case StateScene.choiceherofinishgame: _BOL_ShowHeroAndSkill.Hide(); break; } }
public override void Initialize() { base.Initialize(); MainScene.ClearModel(); StateScene.ClearModel(); SetMainLight(fk_Material.TrueWhite, new fk_Vector(0, 0, -1)); SetStateLight(fk_Material.TrueWhite, new fk_Vector(0, 0, -1)); SetMainCamera(new fk_Vector(0, 0, 100)); SetStateCamera(new fk_Vector(0, 0, 100)); InitializeBackground(); GameInfo.Create(); GameInfo.Refresh(); var player = new Player(new fk_Vector(0, 0, 20)); var boss = new Boss(new fk_Vector(0, 0, -40)); _stateDrawer = new StateDrawer(); _stateDrawer.InitSprites(); _stateDrawer.Entry(); }
public void PauseGame() { Debug.Log("PauseGame"); _state = StateScene.Pause; needChange = true; Time.timeScale = 0.1f; }
void InitData(StateScene state, StateScene statusState = StateScene.unknow) { switch (state) { case StateScene.waiting: ActionWaiting(statusState); break; case StateScene.playing: break; case StateScene.finish: break; } }
public void ResetHero() { var resetTimes = PlayerPrefs.GetInt("ResetTimes"); if (resetTimes > 3) { GameOver(); } else { PlayerPrefs.SetInt("ResetTimes", resetTimes++); _state = StateScene.ResetHero; needChange = true; } }
void ActionFinish(StateScene state) { switch (state) { case StateScene.win: break; case StateScene.lose: break; case StateScene.tie: break; default: #if TEST Debug.Log(Debugs.ColorString("không show cái gì cả", Color.red)); #endif break; } }
void ActionWaiting(StateScene stateStatus) { switch (stateStatus) { case StateScene.showheroandskill: _BOL_ShowHeroAndSkill = listStateScene.BOL_ShowHeroAndSkill; _BOL_ShowHeroAndSkill.Hide(); break; case StateScene.showplayer: //_BOL_ShowPlayer = listStateScene.BOL_ShowPlayer; _BOL_ChoiceHero = listStateScene.BOL_ChoiceHero; _BOL_ShowPlayer.InitData(); _BOL_ChoiceHero.Hide(); break; case StateScene.choicehero: //_BOL_ShowPlayer = listStateScene.BOL_ShowPlayer; _BOL_ChoiceHero = listStateScene.BOL_ChoiceHero; _BOL_ShowPlayer.SelfDestruction(); _BOL_ChoiceHero.Show(); break; } }
public void ActionFinish(StateScene state, Action action = null) { isInitSuccess = false; _BOL_ShowHeroAndSkill.Hide(); panelUserInfo.RefreshGoldInfo(true); panelUserInfo.Show(); #if TEST Debug.Log("ChairPosition " + ChairPosition); #endif if (ChairPosition == Constant.CHAIR_LEFT || ChairPosition == Constant.CHAIR_RIGHT) { switch (state) { case StateScene.win: if (_BOL_ShowFinishWin == null) { #if TEST Debug.Log("show win"); #endif _BOL_ShowFinishWin = listStateScene.BOL_ShowFinishWin; Delay(5, () => { _BOL_ShowFinishWin.ResetData(); _BOL_ShowFinishWin.SelfDestruction(); _BOL_ShowFinishWin = null; if (ChairPosition != Constant.CHAIR_PLAYER && ChairPosition != Constant.CHAIR_VIEWER) { BOL_PlaySkill_Controller.instance.isStartGame = false; } }); StartInitData(InitDataWaiting, () => { ActionWaiting(StateScene.choiceherofinishgame); int mySessionid = DataManager.instance.userData.sessionId; if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[0].sessionId) { //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_LEFT, false, true); BOL_ChoiceHero.instance.btnChoiceChairLeft.isChoiceChair = true; BOL_ChoiceHero.instance.Show(); } else if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[1].sessionId) { BOL_ChoiceHero.instance.btnChoiceChairRight.isChoiceChair = true; //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_RIGHT, false, true); BOL_ChoiceHero.instance.Show(); } }); } break; case StateScene.lose: if (_BOL_ShowFinishLose == null) { _BOL_ShowFinishLose = listStateScene.BOL_ShowFinishLose; Delay(5, () => { _BOL_ShowFinishLose.ResetData(); _BOL_ShowFinishLose.SelfDestruction(); _BOL_ShowFinishLose = null; if (ChairPosition != Constant.CHAIR_PLAYER && ChairPosition != Constant.CHAIR_VIEWER) { BOL_PlaySkill_Controller.instance.isStartGame = false; } }); StartInitData(InitDataWaiting, () => { ActionWaiting(StateScene.choiceherofinishgame); int mySessionid = DataManager.instance.userData.sessionId; if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[0].sessionId) { //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_LEFT, false, true); BOL_ChoiceHero.instance.btnChoiceChairLeft.isChoiceChair = true; BOL_ChoiceHero.instance.Show(); } else if (mySessionid == BOL_ShowPlayer_Manager.instance.listUserPlayGame[1].sessionId) { //BOL_ChoiceHero.instance.SetActiveImageChoice(Constant.CHAIR_RIGHT, false, true); BOL_ChoiceHero.instance.btnChoiceChairRight.isChoiceChair = true; BOL_ChoiceHero.instance.Show(); } }); } break; case StateScene.tie: break; case StateScene.viewer: break; default: #if TEST Debug.Log(Debugs.ColorString("không show cái gì cả", Color.red)); #endif break; } } else { //if (tweenScale != null) { // LeanTween.cancel(imageVS.gameObject, tweenScale.uniqueId); // tweenScale = null; //} //tweenScale = LeanTween.scale(imageVS.gameObject, Vector3.one, 0.5f).setOnComplete(() => { // tweenScale = null; //}).setEase(LeanTweenType.easeOutBack); } }
public void HideUI() { _state = StateScene.Exit; needChange = true; }
public void ShowUI() { _state = StateScene.Start; needChange = true; }
public void ContinueGame() { _state = StateScene.Game; needChange = true; Time.timeScale = 0.1f; }