Graphics Reference
In-Depth Information
// we store this selected slot to use to prevent duplicate
// weapon slot setting
lastSelectedWeaponSlot=selectedWeaponSlot;
// enable the newly selected weapon
EnableCurrentWeapon();
}
public virtual void DisableCurrentWeapon ()
{
if(weaponScripts.Count==0)
return;
// grab reference to currently selected weapon script
TEMPWeapon= ( BaseWeaponScript )weaponScripts[selectedWeapon
Slot];
// now tell the script to disable itself
TEMPWeapon.Disable();
// grab reference to the weapon's gameObject and disable
// that, too
TEMPgameObject= ( GameObject )weaponSlots[selectedWeaponSlot];
TEMPgameObject.SetActive( false );
}
public virtual void EnableCurrentWeapon ()
{
if( weaponScripts.Count==0 )
return;
// grab reference to currently selected weapon
TEMPWeapon= ( BaseWeaponScript )weaponScripts[selectedWeapon
Slot];
// now tell the script to enable itself
TEMPWeapon.Enable();
TEMPgameObject= ( GameObject )weaponSlots[selectedWeapon
Slot];
TEMPgameObject.SetActive( true );
}
public virtual void Fire ()
{
if(weaponScripts==null)
return;
Search WWH ::




Custom Search