well the tiltle says it here is the error i get: Assets/scripts/AddItem.js(29,28): BCE0048: Type ‘System.Type’ does not support slicing.
here is the script where the item is what i want to add.
#pragma strict
import System.Collections.Generic;
var Inventory : PlayerInv;
var GUISKIN : GUISkin;
var Weapons : WeaponInfo[];
class WeaponInfo
{
var GO : GameObject;
var name : String;
var icon : Texture2D;
}
function Start ()
{
Inventory = GetComponent(PlayerInv);
}
function OnGUI()
{
GUI.skin = GUISKIN;
for(var Weapon : WeaponInfo in Weapons)
{
GUILayout.Label(Weapon.icon, GUILayout.Width(300));
if (GUI.Button(Rect(0,0,306,156),""))
{
Debug.Log("You Choose The AKS74U");
Inventory.Inv.Add(WeaponInfo[0]);
}
}
}
here is the script where i want to add it to:
import System.Collections.Generic;
var Inv = List.<itemclass>();
function Start () {
}
function Update () {
}