public float ratioTooClosesq = 0.3f.Sq(); //gets farther from target while attacking protected new void Awake() { base.Awake(); Currentattack = this.SearchComponent <Attack>(); _SM = new StateMachine(); OutOfRangeState s1 = new OutOfRangeState(_SM, this); WithinRangeButMoveState s2 = new WithinRangeButMoveState(_SM, this); WithinRangeState s3 = new WithinRangeState(_SM, this); TooCloseState s4 = new TooCloseState(_SM, this); s1.SetTargetStates(s2); s2.SetTargetStates(s1, s3); s3.SetTargetStates(s4, s2); s4.SetTargetStates(s2); _SM.SetStartingState(s1); }
public void SetTargetStates(OutOfRangeState outOfARState, WithinRangeState withinARNoMoveState) { _outOfARState = outOfARState; _withinARNoMoveState = withinARNoMoveState; }