Last updated: Sep 8, 2022
The Inventory component handles all to do with changing weapons/items for the player character.
You can find the Inventory script ****at this path: Assets\Infima Games\Low Poly Animated - Modern Guns\Demo\Code\Inventory\Inventory.cs
Root. The root of all items we're going to spawn.
Items. All the possible items that we can spawn in the game. This is very important!
Equipped. Currently equipped WeaponBehaviour.
Equipped Index. Currently equipped index.
Init. This function is called when the game starts. We don't use Awake or Start because we need the PlayerCharacter component to run this with the index it wants to equip!
Equip. Equips an item.
Get Last Index. Returns the index that is before the current index. Very helpful in order to figure out what the next weapon to equip is.
Get Next Index. Returns the next index after the currently equipped one. Very helpful in order to figure out what the next weapon to equip is.
Get Equipped. Returns the currently equipped WeaponBehaviour.
Get Equipped Index. Returns the currently equipped index. Meaning the index in the weapon array of the equipped weapon.