Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     ammoCount        = 5;
     numOfEnemiesLeft = 20;
     rb           = GetComponent <Rigidbody2D>();
     hasAmmoState = new HasAmmoState(this);
     noAmmoState  = new NoAmmoState(this);
     if (ammoCount > 0)
     {
         state = hasAmmoState;
     }
     else
     {
         state = noAmmoState;
     }
 }
Exemplo n.º 2
0
 public void SetState(IGunStates state)
 {
     this.state = state;
 }