예제 #1
0
	// 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");
	}
예제 #2
0
    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();
    }