The question i have is. I have a class with all possible things i will need for the weapon how would i go about creating an index of these weapons and select them with the mouse scroll wheel and only allow them to be selected if they have been bought here is my code and it is literally just the weapon class i hope someone can point me in the right direction
var gunList : Gun;
class Gun
{
var name : String;
var isSelected : boolean;
var canUserShoot : boolean;
var shootForce : float;
var ammo : int;
var bullet : GameObject;
var bullet2 : GameObject;
var bullet3 : GameObject;
var bulletHolder1 : Transform;
var bulletHolder2 : Transform; // only use these if the gun has more then one barrel
var bulletHolder3 : Transform; // only use these if the gun has more then one barrel
var shootSound : AudioClip;
var cost : int;
var unlocked : boolean;
var shootEffect : Transform;
var fireRate : float;
var currentWeapon : int;
var weaponModel : Renderer;
}
function NextWeapon()
{
}
function PreviousWeapon()
{
}
function SwapWeapon()
{
}
// i dont know if this is possible but create and index of the weapons and say something like raygun = 1 then when the player uses the mouse scroll wheel increase the number
// Then when it gets to the max reset the number to 1 which will be the raygun
// We also need to disable the renderer of unused guns
// and make sure that only the correct values for the guns are used. No point in having a rocket launcher the firs rockets and lasers would be pretty cool though:)