示例#1
0
        // Use this for initialization
        void Start()
        {
            equipmentContainer = Resources.Load <EquipmentUISlot>("GUI/Equipment_Container");
            equipmentManager   = EquipmentManager.instance;

            UIEventHandlers.OnEquipUpdate += Redraw;
            Redraw();
        }
示例#2
0
        private void Redraw()
        {
            foreach (Transform child in EquipmentPanel.transform)
            {
                Destroy(child.gameObject);
            }
            for (int i = 0; i < equipmentManager.GetEquipsList.Length; i++)
            {
                EquipmentUISlot emptyItem = Instantiate(equipmentContainer);
                emptyItem.transform.SetParent(EquipmentPanel);
                emptyItem.SlotType  = SlotType.EQUIPMENT;
                emptyItem.EquipType = (Enums.EquipTypes)i;
                equipmentSlotList.Add(emptyItem);

                emptyItem.SetItem(equipmentManager.GetEquipsList[i]);
            }
        }
示例#3
0
 private void Awake()
 {
     parentCanvas = GameObject.FindGameObjectWithTag("InventoryCanvas").GetComponent <Canvas>();
     parentSlot   = GetComponentInParent <EquipmentUISlot>();
 }