Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 protected new void Awake()
 {
     base.Awake();
     commandMng = new CommandMng(this);
 }