private void MakeFSM() { ActorAttackState attackState = new ActorAttackState(2.0f); ActorMoveState moveState = new ActorMoveState(1.0f); ActorSkillState skillState = new ActorSkillState(0.1f); attackState.AddTransition(Transition.TS_FIND_TARGET, StateID.STS_MOVE); attackState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL); moveState.AddTransition(Transition.TS_ATTACK, StateID.STS_ATTACK); moveState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL); fsm = new FSMMgr(); fsm.AddState(moveState); fsm.AddState(attackState); fsm.AddState(skillState); }
private void MakeFSM() { ActorAttackState attackState = new ActorAttackState(2.0f); ActorMoveState moveState = new ActorMoveState(1.0f); ActorSkillState skillState = new ActorSkillState(0.1f); attackState.AddTransition(Transition.TS_FIND_TARGET, StateID.STS_MOVE); attackState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL); moveState.AddTransition(Transition.TS_ATTACK, StateID.STS_ATTACK); moveState.AddTransition(Transition.TS_SKILL, StateID.STS_SKILL); fsm = new FSMMgr(); fsm.AddState(moveState); fsm.AddState(attackState); fsm.AddState(skillState); }
public override void Reset() { gameObject = null; smm = null; }
// Use this for initialization void Start() { WeaponFollow.gameObject.layer = LayerMask.NameToLayer("PlayerWeapon"); playerFsm = new FSMMgr(gameObject); RegisterStates(); }
/// <summary> /// 用于解析状态机数据 /// </summary> /// <param name="datas"></param> public virtual void OnDataAnalysis(params object[] datas) { ownerMgr = datas[0] as FSMMgr; Name = datas[1] as string; }