Beispiel #1
0
        private void Awake()
        {
            movementController = GetComponent <ICanMove>();
            mover = GetComponent <AStarMover>();
            interactionMechanics = GetComponent <InteractionMechanics>();
            followMechanics      = GetComponent <FollowMechanics>();

            followMechanics.OnFollowTransformDestroyed += OnFollowTransformDestroyed;

            var startingState = new IdleState();
            var moveState     = new WalkState();
            var sprintState   = new RunningState();
            var followState   = new FollowState();
            var dashingState  = new DashingState();

            InitializeStateMachine(new List <IState>
            {
                startingState,
                moveState,
                sprintState,
                followState,
                dashingState
            }, startingState);
        }
Beispiel #2
0
 public override void SetState(StateMachine sm)
 {
     base.SetState(sm);
     followMechanics = stateMachine.GetComponent <FollowMechanics>();
 }