예제 #1
0
    protected virtual void Reload()
    {
        CancelAmmoEvents();
        if (curAmmo)
        {
            ammos.Remove(curAmmo);
        }

        //is ammo all gone?
        if (curAmmoInd > ammos.Count - 1)
        {
            curAmmoInd = -1;
            Debug.Log(this + " is depleted! Need more ammo.");
            OnAmmoDepleted();
            OnClipIndexChanged();
            OnClipAmountChanged();
        }
        else
        {
            //if not reload
            OnClipAmountChanged();
            OnReloadEnter();
            reloadingCoroutine = reloadingCoroutine.ReplayCoroutine(StartReload());
        }
    }
예제 #2
0
 public void Use()
 {
     if (Data.fireType == ItemWeaponRangedData.FireType.Single)
     {
         UseWeapon();
     }
     else
     {
         fireCoroutine = fireCoroutine.ReplayCoroutine(StartFire());
     }
 }
예제 #3
0
 public virtual void Use()
 {
     inUseCoroutine = inUseCoroutine.ReplayCoroutine(StartUse());
 }