void OnEnable()
    {
        UIActionInputModule inputModule = GetComponent <UIActionInputModule>();

        if (inputModule != null)
        {
            inputModule.EnableAllActions();
        }
    }
    void OnEnable()
    {
        UIActionInputModule inputModule = GetComponent <UIActionInputModule>();

        if (inputModule != null)
        {
            var pointAction = inputModule.point.action;
            if (pointAction != null && !pointAction.enabled)
            {
                pointAction.Enable();
            }

            var leftClickAction = inputModule.leftClick.action;
            if (leftClickAction != null && !leftClickAction.enabled)
            {
                leftClickAction.Enable();
            }

            var rightClickAction = inputModule.rightClick.action;
            if (rightClickAction != null && !rightClickAction.enabled)
            {
                rightClickAction.Enable();
            }

            var middleClickAction = inputModule.middleClick.action;
            if (middleClickAction != null && !middleClickAction.enabled)
            {
                middleClickAction.Enable();
            }

            var moveAction = inputModule.move.action;
            if (moveAction != null && !moveAction.enabled)
            {
                moveAction.Enable();
            }

            var submitAction = inputModule.submit.action;
            if (submitAction != null && !submitAction.enabled)
            {
                submitAction.Enable();
            }

            var cancelAction = inputModule.cancel.action;
            if (cancelAction != null && !cancelAction.enabled)
            {
                cancelAction.Enable();
            }
        }
    }
Esempio n. 3
0
 public static void BindUIActions(this UIActionInputModule uiInputModule, DemoControls.MenuActions menuActions)
 {
     uiInputModule.move      = new InputActionProperty(menuActions.navigate);
     uiInputModule.leftClick = new InputActionProperty(menuActions.click);
 }
Esempio n. 4
0
 private void Awake()
 {
     EventSystem = GetComponent <EventSystem>();
     UIModule    = GetComponent <UIActionInputModule>();
 }