public PatrolState(string name, FSMSystem fsmSystem, Transform[] path, Transform owner, Transform player) : base(name, fsmSystem) { _paths = path; _pathIndex = 0; _owner = owner; _player = player; }
public void MakeFSM() { fsm = new FSMSystem(); FollowPlayerState followPlayerState = new FollowPlayerState(Constants.FollowPlayerState, fsm, transform, player.transform); followPlayerState.AddTransition(Constants.MissPlayer, Constants.PatrolState); PatrolState patrolState = new PatrolState(Constants.PatrolState, fsm, path, transform, player.transform); patrolState.AddTransition(Constants.LookPlayer, Constants.FollowPlayerState); fsm.AddState(patrolState); fsm.AddState(followPlayerState); }
public FollowPlayerState(string name, FSMSystem fsmSystem, Transform owner, Transform player) : base(name, fsmSystem) { _owner = owner; _player = player; }