| | |
| | | [SerializeField] RealmProgressBehaviour m_RealmProgress;
|
| | |
|
| | | [SerializeField] UIEffect m_RealmDungeonSfx;
|
| | | [SerializeField] UIEffect m_GetRealmPointSfx;
|
| | |
|
| | | [SerializeField] Button m_FuncButton;
|
| | | [SerializeField] Text m_FuncButtonTxt;
|
| | |
| | | [SerializeField, Header("模型位置")] Vector3[] m_ModelPositions;
|
| | | [SerializeField, Header("当前境界位置")] Vector3[] m_RealmNowPositions;
|
| | | [SerializeField, Header("下一境界位置")] Vector3[] m_RealmNextwPositions;
|
| | | [SerializeField, Header("Boss位置")] Vector3[] m_BossPositions;
|
| | |
|
| | | int cacheRealmPoint = 0;
|
| | | Coroutine cacheCoroutine = null;
|
| | | RuntimeAnimatorController cacheController = null;
|
| | | const string State_EnterHash = "Show";
|
| | | const string State_IdleHash = "Idle";
|
| | |
|
| | | RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | |
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | if (realmModel.realmDungeonState)
|
| | | {
|
| | | m_RawPlayer.gameObject.SetActive(true);
|
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | HandleAchievement();
|
| | |
| | | if (realmModel.realmDungeonState)
|
| | | {
|
| | | m_RealmDungeonSfx.Play();
|
| | | StartCoroutine(Co_DisplayBossShow());
|
| | | }
|
| | | realmModel.realmDungeonState = false;
|
| | | }
|
| | |
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterCloseEvent;
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | StopBoss();
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | realmModel.realmDungeonState = false;
|
| | | if (cacheCoroutine != null)
|
| | | {
|
| | | StopCoroutine(cacheCoroutine);
|
| | | cacheCoroutine = null;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | IEnumerator Co_DisplayBossShow()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS800;
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | var config = ConfigManager.Instance.GetTemplate<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | StartBoss(config, true);
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
|
| | | {
|
| | | if (refreshType == PlayerDataRefresh.OfficialRank)
|
| | | {
|
| | | StopBoss();
|
| | | DisplayRealmNow();
|
| | | DisplayRealmNext();
|
| | | DisplayModel();
|
| | |
| | | DisplayModel();
|
| | | DisplayButton();
|
| | |
|
| | | if (PlayerDatas.Instance.extersion.realmPoint >= cacheRealmPoint)
|
| | | {
|
| | | DisplayGetRealmPointSfx();
|
| | | }
|
| | | cacheRealmPoint = PlayerDatas.Instance.extersion.realmPoint;
|
| | | }
|
| | | }
|
| | |
| | | if (realmModel.IsRealmHighest || _realmPoint < config.NeedPoint)
|
| | | {
|
| | | m_RawPlayer.gameObject.SetActive(true);
|
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | | else if (_realmPoint >= config.NeedGood)
|
| | |
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | StartBoss(config);
|
| | | }
|
| | | }
|
| | |
|
| | | private void StopBoss()
|
| | | {
|
| | | var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
|
| | | if (npcModel != null && m_RawBoss.gameObject.activeSelf)
|
| | | {
|
| | | var animator = npcModel.GetComponentInChildren<Animator>();
|
| | | if (animator != null && cacheController != null)
|
| | | {
|
| | | animator.runtimeAnimatorController = cacheController;
|
| | | }
|
| | | }
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | }
|
| | |
|
| | | private void StartBoss(RealmConfig config, bool act = false)
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(config.BossID, config.IsBigRealm == 1 ? Vector3.zero : direction, m_RawBoss, false);
|
| | | var npcConfig = ConfigManager.Instance.GetTemplate<NPCConfig>(config.BossID);
|
| | | var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
|
| | | m_RawBoss.transform.localPosition = config.IsBigRealm == 1 ? m_BossPositions[1] : m_BossPositions[0];
|
| | | if (npcModel != null)
|
| | | {
|
| | | var animator = npcModel.GetComponentInChildren<Animator>();
|
| | | if (animator != null)
|
| | | {
|
| | | cacheController = animator.runtimeAnimatorController;
|
| | | var runtimeController = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerRealmSuffix, npcConfig.MODE);
|
| | | animator.runtimeAnimatorController = runtimeController;
|
| | | animator.Play(act ? State_EnterHash : State_IdleHash, 0);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | else
|
| | | {
|
| | | m_FuncButtonTxt.text = Language.Get("RealmWin_Bewrite_1");
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayGetRealmPointSfx()
|
| | | {
|
| | | if (m_GetRealmPointSfx != null)
|
| | | {
|
| | | m_GetRealmPointSfx.Play();
|
| | | }
|
| | | }
|
| | |
|