// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); backpack = player.transform.Find("Backpack").gameObject; inventory = backpack.GetComponent <itemController>(); ammo = backpack.GetComponent <ammoController>(); ui.enabled = false; if (!invExists) { invExists = true; DontDestroyOnLoad(transform.gameObject); } else { Destroy(gameObject); } }
void Start() { ammo = backpack.GetComponent <ammoController> (); inventory = backpack.GetComponent <itemController> (); }