Exemplo n.º 1
0
    bool Shoot(Weapon w)
    {
        if (input.GetDirection() == Vector2.zero)
        {
            bool shot = w.Shoot(target, aimDir);
            if (shot)
            {
                shotCount++;
            }
            if (w.MagSize > 0 && shotCount >= w.MagSize)
            {
                w.IsReloading   = true;
                shotCount       = 0;
                reloadCountdown = w.ReloadTime;

                return(false);
            }
            StartCoroutine(cameraControl.CameraShake(0.1f, 0.2f));

            return(shot);
        }
        else
        {
            return(false);
        }
    }