Exemplo n.º 1
0
        public bool AllPressed(MobileUIActions actionPerformed, EventType eventUsed, PointerEventData data)
        {
            // Not the right event
            if ((eventUsed != eventType || eventUsed == EventType.None) && eventUsed != EventType.All)
            {
                return(false);
            }

            if (alwaysTriggerMobileActions || Application.isMobilePlatform)
            {
                if (actionPerformed == mobileAction)
                {
                    return(true);
                }
            }

            if (data == null || data.button != button)
            {
                return(false);
            }

            if (keyCode != KeyCode.None && Input.GetKey(keyCode) == false)
            {
                return(false);
            }

            return(true);
        }
 public InventoryActionInput(PointerEventData.InputButton button, EventType eventType, KeyCode keyCode, MobileUIActions mobileAction = MobileUIActions.None)
 {
     this.button = button;
     this.keyCode = keyCode;
     this.mobileAction = mobileAction;
     this.eventType = eventType;
 }
Exemplo n.º 3
0
 public InventoryActionInput(PointerEventData.InputButton button, EventType eventType, KeyCode keyCode, MobileUIActions mobileAction = MobileUIActions.None)
 {
     this.button       = button;
     this.keyCode      = keyCode;
     this.mobileAction = mobileAction;
     this.eventType    = eventType;
 }
        public bool AllPressed(MobileUIActions actionPerformed, EventType eventUsed, PointerEventData data)
        {
            // Not the right event
            if ((eventUsed != eventType || eventUsed == EventType.None) && eventUsed != EventType.All)
                return false;

            if (alwaysTriggerMobileActions || Application.isMobilePlatform)
            {
                if (actionPerformed == mobileAction)
                    return true;

            }

            if (data == null || data.button != button)
                return false;

            if (keyCode != KeyCode.None && Input.GetKey(keyCode) == false)
                return false;

            return true;
        }