Example #1
0
 // 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);
     }
 }
Example #2
0
 void Start()
 {
     ammo      = backpack.GetComponent <ammoController> ();
     inventory = backpack.GetComponent <itemController> ();
 }