Esempio n. 1
0
    protected new void Awake()
    {
        base.Awake();

        _SM = new StateMachine();
        WayTooCloseState    s1 = new WayTooCloseState(_SM, this);
        FleeingState        s2 = new FleeingState(_SM, this);
        InSafeDistanceState s3 = new InSafeDistanceState(_SM, this);

        s1.SetTargetStates(s2);
        s2.SetTargetStates(s1, s3);
        s3.SetTargetStates(s2);
        _SM.SetStartingState(s1);
    }
Esempio n. 2
0
 public void SetTargetStates(WayTooCloseState wayTooCloseState, InSafeDistanceState inSafeDistanceState)
 {
     _wayTooCloseState    = wayTooCloseState;
     _inSafeDistanceState = inSafeDistanceState;
 }