Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        switch (CurrentState)
        {
        case xbowState.idle:
            break;

        case xbowState.shoot:
            if (Time.time > nextTimeFire)
            {
                if (target_ != null)
                {
                    shoot();
                    nextTimeFire = Time.time + gameObject.GetComponent <towerInf>().fireRate;
                }
                else
                {
                    CurrentState = xbowState.idle;
                }
            }
            break;
        }
    }
Ejemplo n.º 2
0
 public void stopShoot()
 {
     CurrentState = xbowState.idle;
     target_      = null;
 }
Ejemplo n.º 3
0
 public void shoot(GameObject targetGameObject)
 {
     CurrentState = xbowState.shoot;
     target_      = targetGameObject;
     rotation();
 }