예제 #1
0
 void EnterState(BallState NewState)
 {
     if (NewState != null)
     {
         CurrentState.Exit();
         NewState.Enter(this);
         CurrentState = NewState;
     }
 }
예제 #2
0
    // Use this for initialization
    void OnEnable()
    {
        _mesh = GetComponent <MeshRenderer>();
        _mat  = _mesh.material;

        CurrentState = new GrowState
        {
            GrowRate = .1f
        };

        CurrentState.Enter(this);
    }
예제 #3
0
 public void ChangeState(BallState newState)
 {
     CurrentState.Exit();
     CurrentState = newState;
     CurrentState.Enter();
 }
예제 #4
0
 public void Initialize(BallState startingState)
 {
     CurrentState = startingState;
     CurrentState.Enter();
 }