void Update() { if (!isCraftMenuOpen) { // Always set the selection angle based on angle from center (0,0) while open selectionAngle = craftMenuMainLayer.GetAngleFromCenter(); int btnIndexToSelect = CraftWheelUtils.GetHighlightedButton(amountOfIcons, selectionAngle); SetSelectedIconIndex(btnIndexToSelect); } }
/// <summary> /// /// </summary> void Update() { // Always set the selection angle based on angle from center (0,0) while open selectionAngle = craftMenuMainLayer.GetAngleFromCenter(); int btnIndexToSelect = CraftWheelUtils.GetHighlightedButton(amountOfIcons, selectionAngle); SetSelectedIconIndex(btnIndexToSelect); if (Input.GetKeyDown(KeyCode.E) && canCraft) { print("Crafted " + itemToCreate.itemName); try { Inventory.Instance.InsertItem(new ItemInstance(itemToCreate)); print("ITEMS Index: " + item1FoundIndex + " - " + item2FoundIndex + " - " + item3FoundIndex); List <int> items = ReverseOrder(item1FoundIndex, item2FoundIndex, item3FoundIndex); items.ForEach(item => { try{ Inventory.Instance.RemoveItem(item); }catch { print("couldnt remove item"); } }); print("ITEMTOCREATE: " + itemToCreate.itemName); try{ textInfoPopup.PlayItemCreatedInfoText(itemToCreate.itemName); }catch { print("popup didn't work!"); } }catch { print("[CraftMenuCraftLayer] - Something Went wrong"); } SetMaterialsNeededInfo(); } if (Input.GetKeyDown(KeyCode.L)) { textInfoPopup.PlayItemCreatedInfoText("Something"); } }
// Update is called once per frame void Update() { transform.localRotation = Quaternion.Euler(0, 0, craftMenuMainLayer.GetAngleFromCenter()); }