protected virtual void EnterAwakeState(fsm.State _from, fsm.State _to, fsm.Event _event) { if (thisPlayer == null) { thisPlayer = this.gameObject.GetComponent <MainPlayer>(); } if (thisPlayer == null) { Debug.LogError("找不到主玩家组件!"); } else { commandMng = thisPlayer.commandMng; } }
protected virtual void EnterAwakeState(fsm.State _from, fsm.State _to, fsm.Event _event) { curEventType = EventType.AWAKE; if (GameCenter.mainPlayerMng.MainPlayerInfo.CurSceneRef != null) { autoFightDistance = (float)GameCenter.mainPlayerMng.MainPlayerInfo.CurSceneRef.autofight_distance; } if (thisPlayer == null) { thisPlayer = this.gameObject.GetComponent <MainPlayer>(); } if (thisPlayer == null) { Debug.LogError("找不到主玩家组件!"); } else { commandMng = thisPlayer.commandMng; thisTarget = thisPlayer.CurTarget as SmartActor; } mainTaskStateType = CheckMainTaskStateType(); startFightPos = thisPlayer.transform.position; }
protected virtual void EnterAwakeState(fsm.State _from, fsm.State _to, fsm.Event _event) { if (thisPlayer == null) { thisPlayer = this.gameObject.GetComponent <MainEntourage>(); } if (owner == null) { owner = GameCenter.curMainPlayer; } if (thisPlayer == null) { GameSys.LogError("找不到组件!"); } else { commandMng = thisPlayer.commandMng; } GameCenter.abilityMng.OnMainPlayerUseAbility += OnMainPlayerUseAbility; GameCenter.abilityMng.OnMainPlayerBeHit += OnMainPlayerBeHit; curEventType = EventType.AWAKE; startNoTargetTime = Time.time; startCheakNoTarget = true; }
protected new void Awake() { base.Awake(); commandMng = new CommandMng(this); }