Esempio n. 1
0
    public void FillInventoryButton(ItemTypeSO itemType, bool isInteractable = true)
    {
        _buttonAction.interactable        = isInteractable;
        _buttonActionText.StringReference = itemType.ActionName;
        //bool isKeyboard = !(Input.GetJoystickNames() != null && Input.GetJoystickNames().Length > 0);

        bool isKeyboard = true;

        buttonPromptSetter.SetButtonPrompt(isKeyboard);
        if (isInteractable)
        {
            if (_inputReader != null)
            {
                hasEvent = true;
                _inputReader.inventoryActionButtonEvent += ClickActionButton;
            }
        }
        else
        {
            if (_inputReader != null)
            {
                if (hasEvent)
                {
                    _inputReader.inventoryActionButtonEvent -= ClickActionButton;
                }
            }
        }
    }
Esempio n. 2
0
    public void FillInventoryButton(ItemTypeSO itemType, bool isInteractable = true)
    {
        _buttonAction.interactable        = isInteractable;
        _buttonActionText.StringReference = itemType.ActionName;

        bool isKeyboard = true;

        _buttonPromptSetter.SetButtonPrompt(isKeyboard);
        if (isInteractable)
        {
            if (_inputReader != null)
            {
                _hasEvent = true;
                _inputReader.InventoryActionButtonEvent += ClickActionButton;
            }
        }
        else
        {
            if (_inputReader != null)
            {
                if (_hasEvent)
                {
                    _inputReader.InventoryActionButtonEvent -= ClickActionButton;
                }
            }
        }
    }
Esempio n. 3
0
 public bool Unregister(ItemTypeSO itemType, UnityObject handler)
 {
     if (_itemHandlerMap.TryGetValue(itemType, out UnityObjectSet set))
     {
         return(set.Remove(handler));
     }
     return(false);
 }
Esempio n. 4
0
 public bool Register(ItemTypeSO itemType, UnityObject handler)
 {
     if (_itemHandlerMap.TryGetValue(itemType, out UnityObjectSet set))
     {
         return(set.Add(handler));
     }
     else
     {
         set = new UnityObjectSet();
         set.Add(handler);
         _itemHandlerMap.Add(itemType, set);
         return(true);
     }
 }
Esempio n. 5
0
 public void FillInventoryButtons(ItemTypeSO itemType, bool isInteractable = true)
 {
     buttonAction.interactable        = isInteractable;
     buttonActionText.StringReference = itemType.ActionName;
 }