Exemple #1
0
        private void Update()
        {
            if (interactionsEnabled)
            {
                if (interactionsCooling)
                {
                    interactionsCooling = false;
                    return;
                }

                if (Input.GetButtonDown(KeyCodeConsts.Use))
                {
                    OnConfirm?.Invoke(INPUT_TYPE.USE);
                    interactionController.Interact();
                }

                if (Input.GetButtonDown(KeyCodeConsts.Cancel))
                {
                    OnCancel?.Invoke(INPUT_TYPE.CANCEL);
                    interactionController.Cancel();
                }

                if (Input.GetButtonDown(KeyCodeConsts.Inventory))
                {
                    OnInventory?.Invoke(INPUT_TYPE.INVENTORY);
                }
            }
        }