// Use this for initialization void Awake() { Instance = this; gos = Resources.LoadAll("items"); int x = 0; foreach(GameObject go in gos) { if(go.GetComponent("Item") != null) { int tid = go.GetComponent<Item>().id; if(gInv[tid] != null) { Debug.Log("!!!WARNING!!!-> "+ gInv[tid].GetComponent<Item>().title +" being overwritten by "+ go.GetComponent<Item>().title); } gInv[tid] = go; x++; } } Debug.Log("Loaded "+ x +" items into Dev inventory"); }
void Start() { sx = Screen.width; sy = Screen.height; showGUI = false; UserPl = transform.parent.GetComponent<UserPlayer>(); devArray = transform.parent.GetComponent<GameInv>(); detScript = GetComponent<Detector>(); escScript = GetComponent<GameMenu>(); CheckKnife(); }