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); }
void Awake() { CanMove = GetComponent <ICanMove>(); rb = GetComponent <Rigidbody2D>(); }
public Move(ICanMove target) => this.target = target;