public override void Initialize(ViewModel.Character <Characters> config) { base.Initialize(config); Inventory = new Base.Inventory(UseItem); Manager.Game.Inventory.Initialize(Inventory, this); OnInitialize?.Invoke(this, EventArgs.Empty); }
public void Initialize(Base.Inventory inventory) { Inventory = inventory; Transform mainCanvas = Manager.Game.MainCanvas.transform; Triforce = mainCanvas.Find("Inventory/Triforce").GetComponent <RectTransform>(); BSlotImage = mainCanvas.Find("Inventory/BSlot/Image").GetComponent <Image>(); ItemsGrid = mainCanvas.Find("Inventory/ItemsContainer/ItemsGrid").GetComponent <RectTransform>(); Cursor = ItemsGrid.Find("Cursor").GetComponent <RectTransform>(); int count = Constants.SelectableItems.Length; ItemRefs = new GameObject[count]; ActiveItems = new bool[count]; for (int i = 0; i < count; i++) { SetItemActive(Constants.SelectableItems[i], i); } }