Graphics Reference
In-Depth Information
// enable the newly selected weapon
EnableCurrentWeapon();
}
public virtual void NextWeaponSlot (bool shouldLoop)
{
// disable the current weapon
DisableCurrentWeapon();
// next slot
selectedWeaponSlot++;
// make sure that the slot isn't higher than the total
// number of weapons in our list
if(selectedWeaponSlot==weaponScripts.Count)
{
if(shouldLoop)
{
selectedWeaponSlot= 0;
} else {
selectedWeaponSlot= weaponScripts.Count-1;
}
}
// we store this selected slot to use to prevent duplicate
// weapon slot setting
lastSelectedWeaponSlot=selectedWeaponSlot;
// enable the newly selected weapon
EnableCurrentWeapon();
}
public virtual void PrevWeaponSlot (bool shouldLoop)
{
// disable the current weapon
DisableCurrentWeapon();
// prev slot
selectedWeaponSlot--;
// make sure that the slot is a sensible number
if( selectedWeaponSlot<0 )
{
if(shouldLoop)
{
selectedWeaponSlot= weaponScripts.Count-1;
} else {
selectedWeaponSlot= 0;
}
}
Search WWH ::




Custom Search