◆ ConsumeAmmo()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.ConsumeAmmo |
( |
| ) |
|
|
protectedvirtual |
Consumes ammo based on the amount of ammo to consume per shot
◆ DelayedRefreshCurrentAmmoAvailable()
IEnumerator MoreMountains.TopDownEngine.WeaponAmmo.DelayedRefreshCurrentAmmoAvailable |
( |
| ) |
|
|
protected |
◆ EmptyMagazine()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.EmptyMagazine |
( |
| ) |
|
|
virtual |
Empties the weapon's magazine and puts the ammo back in the inventory
◆ EnoughAmmoToFire()
virtual bool MoreMountains.TopDownEngine.WeaponAmmo.EnoughAmmoToFire |
( |
| ) |
|
|
virtual |
Returns true if this weapon has enough ammo to fire, false otherwise
- Returns
◆ FillWeaponWithAmmo()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.FillWeaponWithAmmo |
( |
| ) |
|
|
virtual |
Fills the weapon with ammo
◆ LoadOnStart()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.LoadOnStart |
( |
| ) |
|
|
protectedvirtual |
Loads our weapon with ammo
◆ OnDestroy()
void MoreMountains.TopDownEngine.WeaponAmmo.OnDestroy |
( |
| ) |
|
|
protected |
◆ OnDisable()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On disable, we stop listening for MMGameEvents. You may want to extend that to stop listening to other types of events.
◆ OnEnable()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable, we start listening for MMGameEvents. You may want to extend that to listen to other types of events.
◆ OnMMEvent() [1/3]
virtual void MoreMountains.TopDownEngine.WeaponAmmo.OnMMEvent |
( |
MMGameEvent |
gameEvent | ) |
|
|
virtual |
Grabs inventory events and refreshes ammo if needed
- Parameters
-
◆ OnMMEvent() [2/3]
virtual void MoreMountains.TopDownEngine.WeaponAmmo.OnMMEvent |
( |
MMInventoryEvent |
inventoryEvent | ) |
|
|
virtual |
Grabs inventory events and refreshes ammo if needed
- Parameters
-
◆ OnMMEvent() [3/3]
When getting weapon events, we either consume ammo or refill it
- Parameters
-
◆ RefreshCurrentAmmoAvailable()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.RefreshCurrentAmmoAvailable |
( |
| ) |
|
|
protectedvirtual |
Updates the CurrentAmmoAvailable counter
◆ Start()
virtual void MoreMountains.TopDownEngine.WeaponAmmo.Start |
( |
| ) |
|
|
protectedvirtual |
On start, we grab the ammo inventory if we can find it
◆ _ammoItem
◆ _emptied
bool MoreMountains.TopDownEngine.WeaponAmmo._emptied = false |
|
protected |
◆ _weapon
Weapon MoreMountains.TopDownEngine.WeaponAmmo._weapon |
|
protected |
◆ AmmoID
string MoreMountains.TopDownEngine.WeaponAmmo.AmmoID |
the ID of this ammo, to be matched on the ammo display if you use one
◆ AmmoInventoryName
string MoreMountains.TopDownEngine.WeaponAmmo.AmmoInventoryName = "MainInventory" |
the name of the inventory where the system should look for ammo
◆ CurrentAmmoAvailable
int MoreMountains.TopDownEngine.WeaponAmmo.CurrentAmmoAvailable |
the current amount of ammo available in the inventory
◆ MaxAmmo
int MoreMountains.TopDownEngine.WeaponAmmo.MaxAmmo = 100 |
the theoretical maximum of ammo
◆ ShouldEmptyOnSave
bool MoreMountains.TopDownEngine.WeaponAmmo.ShouldEmptyOnSave = true |
if this is true, everytime you equip this weapon, it'll auto fill with ammo
◆ ShouldLoadOnStart
bool MoreMountains.TopDownEngine.WeaponAmmo.ShouldLoadOnStart = true |
if this is true, everytime you equip this weapon, it'll auto fill with ammo
◆ AmmoInventory
virtual Inventory MoreMountains.TopDownEngine.WeaponAmmo.AmmoInventory |
|
getset |
the inventory where ammo for this weapon is stored
The documentation for this class was generated from the following file:
- F:/Github/Store/TopDownEngine/Assets/TopDownEngine/Common/Scripts/Characters/Weapons/WeaponAmmo.cs