public void OnInputAction(InputActionData action_data) { if (action_data.m_Action == InputsManager.InputAction.LMB || action_data.m_Action == InputsManager.InputAction.Button_X) { int i = 0; while (i < this.m_Masks.Count) { if (this.m_Masks[i].gameObject.activeSelf) { ConstructionController component = Player.Get().GetComponent <ConstructionController>(); if (!component.IsActive()) { string itemID = this.m_Masks[i].gameObject.transform.parent.GetComponent <NotepadConstructionData>().m_ItemID; ItemID id = (ItemID)Enum.Parse(typeof(ItemID), itemID); ItemInfo info = ItemsManager.Get().GetInfo(id); component.SetupPrefab(info); Player.Get().StartController(PlayerControllerType.Construction); return; } break; } else { i++; } } } }
public void OnSlotPress(int slot_index) { MenuConstructionSlot menuConstructionSlot = this.m_Slots[slot_index]; ConstructionController component = Player.Get().GetComponent <ConstructionController>(); component.SetupPrefab(menuConstructionSlot.info); Player.Get().StartController(PlayerControllerType.Construction); this.m_MenuInGameManager.HideMenu(); }