Esempio n. 1
0
 private void SetRefrences()
 {
     questJornal    = this.GetComponent <Quest_Jornal>();
     characterStats = this.GetComponent <Character_Stats>();
     if (nPC)
     {
         shopIconParent = GameObject.FindObjectsOfType <Shop_Icon_Parent>()[0].GetComponent <Transform>();
         shopIconParent.GetComponentInParent <Shop_UI_Manager>().gameObject.SetActive(false);
         if (Object.FindObjectsOfType <Shop_Icon_Parent>().Length > 1)
         {
             Debug.LogError("TWO OR MORE SHOP_ICON_PARENTS DETECTED");
         }
     }
     equipmentManager   = this.GetComponent <Equipment_Manager>();
     uiInventoryManager = GameObject.FindObjectOfType <UI_Inventory_Manager>();
 }
Esempio n. 2
0
        private void SetRefrences()
        {
            thisInventory = this.GetComponent <Inventory>();

            if (Resources.FindObjectsOfTypeAll <UI_Inventory_Manager>().Length > 1)
            {
                Debug.LogError("Multiple UI Inventory Manager detected");
            }

            uIInventoryManager = GameObject.FindObjectsOfType <UI_Inventory_Manager>()[0]; // This is trying to find an inactive game object

            if (GameObject.FindObjectsOfType <UI_Inventory_Manager>().Length > 1)
            {
                Debug.LogError("Multiple Shop UI Manager detected");
            }

            shopUIManager    = Resources.FindObjectsOfTypeAll <Shop_UI_Manager>()[0];
            tradersInventory = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>(); // TODO MAKE THIS FOR MULTIPLAYER
        }