| | |
| | |
|
| | | int cacheRealmPoint = 0;
|
| | | Coroutine cacheCoroutine = null;
|
| | | RuntimeAnimatorController cacheController = null;
|
| | | const string State_EnterHash = "Show";
|
| | | const string State_IdleHash = "Idle";
|
| | |
|
| | |
| | | StopCoroutine(cacheCoroutine);
|
| | | cacheCoroutine = null;
|
| | | }
|
| | | if (cacheController != null)
|
| | | {
|
| | | cacheController = null;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | IEnumerator Co_DisplayBossShow()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS800;
|
| | | ResetRunTimeController();
|
| | | var config = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | |
| | | {
|
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | ResetRunTimeController();
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | StartBoss(config);
|
| | | }
|
| | |
| | |
|
| | | private void StopBoss()
|
| | | {
|
| | | ResetRunTimeController();
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | }
|
| | |
|
| | | private void ResetRunTimeController()
|
| | | {
|
| | | var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
|
| | | if (npcModel != null)
|
| | | {
|
| | | var animator = npcModel.GetComponentInChildren<Animator>();
|
| | | if (animator != null && cacheController != null)
|
| | | {
|
| | | animator.runtimeAnimatorController = cacheController;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void StartBoss(RealmConfig config, bool act = false)
|
| | |
| | | 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);
|