protected void OnShellInserted(Item interactiveObject) { try { Items.InteractiveAmmo insertedShell = interactiveObject.GetComponent <Items.InteractiveAmmo>(); shellReceiver.UnSnap(interactiveObject); if (insertedShell != null) { if (insertedShell.GetAmmoType().Equals(AmmoType.ShotgunShell)) { if (shellInsertSound != null) { shellInsertSound.Play(); } chamberRoundOnNext = true; currentReceiverAmmo += 1; //if (currentReceiverAmmo >= module.maxReceiverAmmo) { shellReceiver.data.locked = true; } } } } catch (Exception e) { Debug.LogError("[ModularFirearmsFramework][ERROR] Exception in Adding magazine: " + e.ToString()); } }
protected void OnShellRemoved(Item interactiveObject) { try { Items.InteractiveAmmo insertedShell = interactiveObject.GetComponent <Items.InteractiveAmmo>(); if (insertedShell != null) { if (insertedShell.GetAmmoType().Equals(AmmoType.ShotgunShell)) { interactiveObject.Despawn(); } } } catch (Exception e) { Debug.Log("[ModularFirearmsFramework][ERROR] Exception in removing shell from receiver." + e.ToString()); } }