Next: Inventory Component, Previous: Active Object, Up: Inventory [Contents][Index]
This component is an inventory that goes on the Player object and is required for the use of ’ModernGun’ objects. To use, simply decide how many ammo types you would like. Then, input that as the ’Size’ for both Num Clips and Max Clips. Finally set a maximum and initial value for each. So, if machine gun bullets are the first ammo type, then NumClips[0] represents the number of machine gun clips we currently have, and MaxClips[0] represents the maximum number of machine gun clips we can have. A clip is an object that contains many bullets. So this gives a ’realistic’ reloading system where partial clips are discarded (clips are tracked instead of individual rounds).
int[]
numClipsNumber of currently held clips for a given clip type index
int[]
maxClipsMaximum number of clips for a given clip type index
bool
useGUIShould we show a legacy Unity GUI for this information?
Default value: true
Rect
guiAreaNormalized viewport rectangle for the GUI, values between 0 and 1
Default value: new Rect(0.2f,.8f, .1f, .19f)
bool
autoSaveShould we save this data in the Player Prefs file?
Default value: true
float
autoSaveIntervalHow often do we attempt to auto-save?
Default value: 30.0f
Saves the current clip counts in Player Prefs
Loads the clip counts from Player Prefs
int[]
numClipsNumber of currently held clips for a given clip type index
int[]
maxClipsMaximum number of clips for a given clip type index
bool
useGUIShould we show a legacy Unity GUI for this information?
Default value: true
Rect
guiAreaNormalized viewport rectangle for the GUI, values between 0 and 1
Default value: new Rect(0.2f,.8f, .1f, .19f)
bool
autoSaveShould we save this data in the Player Prefs file?
Default value: true
float
autoSaveIntervalHow often do we attempt to auto-save?
Default value: 30.0f
Saves the current clip counts in Player Prefs
Loads the clip counts from Player Prefs
Next: Inventory Component, Previous: Active Object, Up: Inventory [Contents][Index]