コード例 #1
0
 public void DestroyFightScene()
 {
     EFightStatus = E_FightStatus.None;
     //_dicHpLabelFlying.Clear();
     _queueHpLabel.Clear();
     _dicBoss.Clear();
 }
コード例 #2
0
        private IEnumerator ShowUI(bool isWin, int jiangBei, int money)
        {
            yield return(new WaitForSeconds(1.2f));

            UIMgr.Instance.ShowUI(E_UIType.UIWinOrLosePanel,
                                  typeof(UIWinOrLose),
                                  (ui) =>
            {
                UIWinOrLose uiWinOrLoose = ui as UIWinOrLose;
                if (uiWinOrLoose)
                {
                    uiWinOrLoose.ShowWinOrLoose(isWin, jiangBei, money);
                    SessionControl.Instance.isPlaying = false;
                    EFightStatus = E_FightStatus.None;
                    Level.AllLevels.Clear();

                    //清除所有卡牌
                    CardManager.Instance.DestroyAllCard();
                    SlotManager.Instance.Clear();
                    ParticleControl.Instance.Clear();
                    Weed.Clear();

                    DestroyFightScene();
                }
            });
        }
コード例 #3
0
        public IEnumerator ChangeNextScene()
        {
            if (FightControl.Instance.EFightStatus == E_FightStatus.ChangeBattle)
            {
                yield break;
            }

            E_FightStatus nextScene = E_FightStatus.None;

            if (FightControl.Instance.EFightStatus == E_FightStatus.FightBoss1)
            {
                nextScene = E_FightStatus.FightBoss2;
            }
            else if (FightControl.Instance.EFightStatus == E_FightStatus.FightBoss2)
            {
                nextScene = E_FightStatus.FightBoss3;
            }
            else if (FightControl.Instance.EFightStatus == E_FightStatus.FightBoss3)
            {
                nextScene = E_FightStatus.Finish;
            }
            else
            {
                yield break;
            }

            //放boss死亡动画
            if (nextScene == E_FightStatus.FightBoss2)
            {
                EventDispatcher.TriggerEvent <int>(UIFight.BossKillEvent, 0);
                yield return(new WaitForSeconds(1.2f));
            }
            else if (nextScene == E_FightStatus.FightBoss3)
            {
                EventDispatcher.TriggerEvent <int>(UIFight.BossKillEvent, 1);
                yield return(new WaitForSeconds(1.2f));
            }

            yield return(StartCoroutine(Utils.WaitFor(SessionControl.Instance.CanIWait, 0.5f)));

            //清标志位
            FightControl.Instance.TransHpFlyPos = null;
            ModuleMgr.Instance.Get <ModuleFight>().ClearBossSkill();

//			if(nextScene == E_FightStatus.Finish)
//			{
//				yield break;
//			}

            if (nextScene != E_FightStatus.FightBoss2 &&
                nextScene != E_FightStatus.FightBoss3)
            {
                yield break;
            }

            FightControl.Instance.EFightStatus = E_FightStatus.ChangeBattle;

            GameObject goSlotAll = GameObject.Find("SlotAll");

            if (nextScene == E_FightStatus.FightBoss2)
            {
//				EventDispatcher.TriggerEvent<int>(UIFight.BossKillEvent,0);
//				yield return new WaitForSeconds(1.2f);

                _goSlotCreateBoss2.SetActive(true);
                yield return(StartCoroutine(MoveSlot(goSlotAll, _vecSlot2 * -1f)));

                goSlotAll.transform.localPosition = _vecSlot2 * -1f;

                _goSlotCreateBoss1.SetActive(false);
                FightControl.Instance.EFightStatus = nextScene;
                SessionControl.Instance.eventCount++;
            }
            else if (nextScene == E_FightStatus.FightBoss3)
            {
//				EventDispatcher.TriggerEvent<int>(UIFight.BossKillEvent,1);
//				yield return new WaitForSeconds(1.2f);

                _goSlotCreateBoss3.SetActive(true);
                yield return(StartCoroutine(MoveSlot(goSlotAll, Vector3.zero)));

                goSlotAll.transform.localPosition = Vector3.zero;

                _goSlotCreateBoss2.SetActive(false);
                FightControl.Instance.EFightStatus = nextScene;
                SessionControl.Instance.eventCount++;
            }
            else            // if(nextScene == E_FightStatus.Finish)
            {
                yield break;
            }
        }