Im pretty sure ‘types’ is defined but apparently it isnt
#pragma strict
public class weapon extends overWorld
{
public class weapon
{
private var ammo : int;
private var damage : int;
private var numberOfBullets : int;
private var firetype : int;
private var range :int;
private var weaponType : types;
public function weapon()
{
ammo = 0;
damage = 0;
numberOfBullets = 0;
firetype = 0;
range = 0;
weaponType = types.pistol;
}
public function weapon(amm : int, dmg : int, numOfBullets : int, rateOfFire : int, rng : int, typ : types)
{
ammo = amm;
damage = dmg;
numberOfBullets = numOfBullets;
firetype = rateOfFire;
range = rng;
weaponType = typ;
}
public enum types {sword, pistol, shotgun, machinegun, semiauto, sniper};
}
}
public var sniper : weapon = new weapon(5, 5, 5, 1, 5, types.sniper);
Debug.Log(sniper);