Beispiel #1
0
 public PatrolState(string name, FSMSystem fsmSystem, Transform[] path, Transform owner, Transform player) : base(name, fsmSystem)
 {
     _paths     = path;
     _pathIndex = 0;
     _owner     = owner;
     _player    = player;
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public FollowPlayerState(string name, FSMSystem fsmSystem, Transform owner, Transform player) : base(name, fsmSystem)
 {
     _owner  = owner;
     _player = player;
 }