| | |
| | | #endregion
|
| | |
|
| | | TaiChiModel _taiChiModel;
|
| | | TaiChiModel taiChiModel
|
| | | {
|
| | | TaiChiModel taiChiModel {
|
| | | get { return _taiChiModel ?? (_taiChiModel = ModelCenter.Instance.GetModel<TaiChiModel>()); }
|
| | | }
|
| | |
|
| | | PackModelInterface _modelInterface;
|
| | | PackModelInterface modelInterface
|
| | | {
|
| | | PackModelInterface modelInterface {
|
| | | get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
| | | }
|
| | |
|
| | |
| | | private const string Rock_Key = "Rock_1";
|
| | | private const string Stand_1_Key = "Stand_1";
|
| | | private const string Stand_2_Key = "Stand_2";
|
| | | |
| | |
|
| | | private bool isfreeTo = false;
|
| | | private bool isJumpAni = true;
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | protected override void AddListeners()
|
| | | {
|
| | |
| | | ClickJumpAniBtn();
|
| | | taiChiModel.RefreshTaiChiModel += RefreshUI;
|
| | | taiChiModel.GetResultEvent += GetReciveReward;
|
| | | |
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | private void Init()
|
| | |
| | | totalTimes = taiChiModel.dailyQuestModel.GetDailyQuestTotalTimes(12);
|
| | |
|
| | | BottomUICtrl();
|
| | | if(completedTimes >= totalTimes)
|
| | | if (completedTimes >= totalTimes)
|
| | | {
|
| | | startBtn.interactable = false;
|
| | | }
|
| | |
| | |
|
| | | private void BottomUICtrl()
|
| | | {
|
| | | |
| | |
|
| | | completedTimes = taiChiModel.dailyQuestModel.GetDailyQuestCompletedTimes(12);
|
| | | playNumText.text = StringUtility.Contact(completedTimes, "/", totalTimes);
|
| | | remainFreeCnt = taiChiModel.sumFreeNum - taiChiModel.useFreeCnt;
|
| | |
| | | reward1Text.text = modelInterface.OnChangeCoinsUnit((ulong)taiChiModel.GetDiceRewardExp(diceReward.exp));
|
| | | reward2Text.text = modelInterface.OnChangeCoinsUnit((ulong)diceReward.gold);
|
| | | reward3Text.text = modelInterface.OnChangeCoinsUnit((ulong)diceReward.itemCount);
|
| | | |
| | |
|
| | | for (int i = 0; i < awardbtnlist.Count; i++)
|
| | | {
|
| | | ItemConfig itemConfig = null;
|
| | |
| | | resultObj.SetActive(true);
|
| | | bottomPart.SetActive(true);
|
| | | startBtn.gameObject.SetActive(false);
|
| | | for(int i = 0; i < resultImglist.Count; i++)
|
| | | for (int i = 0; i < resultImglist.Count; i++)
|
| | | {
|
| | | framEffectlist[i].enabled = false;
|
| | | int dicePoint = taiChiModel.resultNumlist[i];
|
| | | resultImglist[i].SetSprite(StringUtility.Contact("XT_TJ_", dicePoint));
|
| | | }
|
| | |
|
| | | switch(taiChiModel.taiChiNum)
|
| | | switch (taiChiModel.taiChiNum)
|
| | | {
|
| | | case 0:
|
| | | npcDesText.text = Language.Get("Wytj0");
|
| | |
| | |
|
| | | getRewardBtn.interactable = true;
|
| | |
|
| | | if(taiChiModel.taiChiNum >= 6)
|
| | | if (taiChiModel.taiChiNum >= 6)
|
| | | {
|
| | | freeBtn.interactable = false;
|
| | | }
|
| | |
| | | startBtn.interactable = false;
|
| | | isfreeTo = true;
|
| | | pictureSG.Skeleton.SetToSetupPose();
|
| | | pictureSG.AnimationState.SetAnimation(0,Star1_Key,false);
|
| | | pictureSG.AnimationState.AddAnimation(0,Rock_Key, false, 0);
|
| | | pictureSG.AnimationState.AddAnimation(0,Star_Key, false,0);
|
| | | pictureSG.AnimationState.AddAnimation(0, Stand_1_Key,true, 0);
|
| | | pictureSG.AnimationState.SetAnimation(0, Star1_Key, false);
|
| | | pictureSG.AnimationState.AddAnimation(0, Rock_Key, false, 0);
|
| | | pictureSG.AnimationState.AddAnimation(0, Star_Key, false, 0);
|
| | | pictureSG.AnimationState.AddAnimation(0, Stand_1_Key, true, 0);
|
| | | }
|
| | | taiChiModel.SendQuest(0);
|
| | | }
|
| | |
| | | private void OnCompleteAniSG(TrackEntry trackEntry)
|
| | | {
|
| | | string aniName = trackEntry.animation.name;
|
| | | switch(aniName)
|
| | | switch (aniName)
|
| | | {
|
| | | case Stand_1_Key:
|
| | | break;
|
| | | case Star1_Key:
|
| | | SoundPlayer.Instance.PlayUIAudio(57);
|
| | | break;
|
| | | case Star3_Key: |
| | | case Star3_Key:
|
| | | StartPlayDiceAni();
|
| | | taiChiModel.SendQuest(1);
|
| | | SoundPlayer.Instance.PlayUIAudio(57);
|
| | |
| | |
|
| | | private void StartPlayDiceAni()
|
| | | {
|
| | | for (int i = 0; i < resultImglist.Count; i++)
|
| | | if (taiChiModel.resultNumlist != null && taiChiModel.resultNumlist.Count == 6)
|
| | | {
|
| | | framEffectlist[i].enabled = false;
|
| | | if (!isJumpAni)
|
| | | for (int i = 0; i < resultImglist.Count; i++)
|
| | | {
|
| | | if (taiChiModel.resultNumlist[i] != 6)
|
| | | framEffectlist[i].enabled = false;
|
| | | if (!isJumpAni)
|
| | | {
|
| | | framEffectlist[i].CompleteAct -= RefreshDiceResultUI;
|
| | | framEffectlist[i].CompleteAct += RefreshDiceResultUI;
|
| | | framEffectlist[i].loop = false;
|
| | | framEffectlist[i].enabled = true;
|
| | | if (taiChiModel.resultNumlist[i] != 6)
|
| | | {
|
| | | framEffectlist[i].CompleteAct -= RefreshDiceResultUI;
|
| | | framEffectlist[i].CompleteAct += RefreshDiceResultUI;
|
| | | framEffectlist[i].loop = false;
|
| | | framEffectlist[i].enabled = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | framEffectlist[i].CompleteAct -= RefreshDiceResultUI;
|
| | | framEffectlist[i].enabled = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | framEffectlist[i].CompleteAct -= RefreshDiceResultUI;
|
| | | framEffectlist[i].enabled = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | framEffectlist[i].CompleteAct -= RefreshDiceResultUI;
|
| | | framEffectlist[i].enabled = false;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void ClickFreeBtn()
|
| | | {
|
| | | if(remainFreeCnt > 0)
|
| | | { |
| | | if (remainFreeCnt > 0)
|
| | | {
|
| | | if (isJumpAni)
|
| | | {
|
| | | freeBtn.interactable = true;
|
| | |
| | | getRewardBtn.interactable = false;
|
| | | isfreeTo = true;
|
| | | pictureSG.Skeleton.SetToSetupPose();
|
| | | pictureSG.AnimationState.AddAnimation(0,Star3_Key, false, 0);
|
| | | pictureSG.AnimationState.AddAnimation(0, Star3_Key, false, 0);
|
| | | pictureSG.AnimationState.AddAnimation(0, Rock_Key, false, 0);
|
| | | pictureSG.AnimationState.AddAnimation(0, Star_Key, false, 0);
|
| | | pictureSG.AnimationState.AddAnimation(0, Stand_1_Key,true, 0);
|
| | | |
| | | pictureSG.AnimationState.AddAnimation(0, Stand_1_Key, true, 0);
|
| | |
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | freeBtn.interactable = false;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | private void RefreshDiceResultUI(int index)
|
| | |
| | |
|
| | | private void ClickJumpAniBtn()
|
| | | {
|
| | | if(!isJumpAni)
|
| | | if (!isJumpAni)
|
| | | {
|
| | | jumAniImg.gameObject.SetActive(true);
|
| | | isJumpAni = true;
|
| | |
| | |
|
| | | private void CloseWin()
|
| | | {
|
| | | if(taiChiModel.taiChiResultNum != "0")
|
| | | if (taiChiModel.taiChiResultNum != "0")
|
| | | {
|
| | | taiChiModel.SendQuest(2);
|
| | | }
|
| | |
|
| | | CloseImmediately();
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | }
|