This is my code
[System.Serializable]
public class MultiDimensionalFloat
{
//public enum myEnum {Classic_Pistol, Classic_Assult_Rifle, Classic_Rocket_Launcher};
//public myEnum[] WepSlot;
public string wepName;
public string wepDescription;
public GameObject WepGameobject;
public GameObject WhenHitGameobject;
public float coolDown;
public float ammo;
public float range;
public float damage;
public float weightKG;
public bool hasProjectile;
public GameObject projectileGameObject;
}
public MultiDimensionalFloat[] weps;
// Use this for initialization
void Start() {
weps = new MultiDimensionalFloat[6];
//adding weapons
weps[0].wepName = "Classic Pistol";
//weps[0].WepGameobject = Instantiate(Resources.Load("WeaponCube")) as GameObject;
weps[0].damage = 40;
weps[0].coolDown = 0.2f;
weps[0].ammo = 100;
weps[0].range =100.0f;
weps[0].damage = 50.0f;
weps[0].weightKG = 24.0f;
weps[0].hasProjectile = false;
//weps[0].projectileGameObject = Instantiate(Resources.Load("bullet")) as GameObject;
}
For some reason I can’t even add 1 item to the array, anyone know why? coz this should be working.