| | |
| | | |
| | | using System;
|
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | using TableConfig; |
| | |
| | | if (IsHeroControl) |
| | | { |
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish; |
| | | DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent += AfterPlayerDataInitializeEvent; |
| | | } |
| | | |
| | | IsPlayerDie = false; |
| | |
| | | pickUpBehaviour = Root.GetComponent<GuardPickupItem>(); |
| | | if (pickUpBehaviour != null) |
| | | { |
| | | Object.DestroyImmediate(pickUpBehaviour); |
| | | UnityEngine.Object.DestroyImmediate(pickUpBehaviour); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | deadModel.AllPlayerDieEvent -= AllPlayerDieEvent; |
| | | deadModel.AllPlayerRebornEvent -= AllPlayerRebornEvent; |
| | | DTC0429_tagObjResetPos.ResetPlayerPosEvent -= ResetPlayerPosEvent; |
| | | DTC0429_tagObjResetPos.ResetPlayerPosEvent -= ResetPlayerPosEvent;
|
| | | DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent -= AfterPlayerDataInitializeEvent; |
| | | if (IsHeroControl) |
| | | { |
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish; |
| | |
| | | m_Animator.speed = animatorSpeed; |
| | | NextAction = GuardAction_Idle; |
| | | } |
| | | |
| | | guardState = GuardState.Idle; |
| | | IsStateActive = false; |
| | | pickUpBehaviour = null; |
| | | |
| | | base.OnUnit(); |
| | | } |
| | | |
| | | }
|
| | |
|
| | | private void AfterPlayerDataInitializeEvent()
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_RecheckPlayLifeState());
|
| | | }
|
| | |
|
| | | IEnumerator Co_RecheckPlayLifeState()
|
| | | {
|
| | | yield return null;
|
| | | if (guardState == GuardState.Inter)
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | if (hero.ActorInfo != null && !hero.ActorInfo.serverDie)
|
| | | {
|
| | | IsPlayerDie = false;
|
| | | IsStateActive = true;
|
| | | if (m_Animator)
|
| | | {
|
| | | m_Animator.enabled = true;
|
| | | }
|
| | | SetPosition(hero.Pos.x / 2, hero.Pos.y / 2);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ReleasePickUpBehaviour() |
| | | { |
| | | if (pickUpBehaviour != null) |