public SelectableInputEventArgs(
     Selectable selectable,
     PointerRaycastHit raycastHit,
     PointerInputEventArgs pointerInput)
 {
     Selectable   = selectable;
     RaycastHit   = raycastHit;
     PointerInput = pointerInput;
 }
Пример #2
0
        private void onClick(ClickInputEventArgs args)
        {
            if (args.ClickedObjects.Length == 0)
            {
                return;
            }
            PointerRaycastHit hit       = args.ClickedObjects[0];
            Clickable         clickable = hit.Obj.GetComponent <Clickable>();

            if (clickable == null)
            {
                return;
            }
            clickable.Click(new ClickableInputEventArgs(hit, args.PointerInput));
        }
Пример #3
0
        private void onClick(ClickInputEventArgs args)
        {
            if (args.ClickedObjects.Length == 0)
            {
                return;
            }
            PointerRaycastHit hit = args.ClickedObjects[0];

            if (_debugMode)
            {
                Debug.Log($"Trying to select {hit.Obj.name}");
            }
            TSelectable selectable = hit.Obj.GetComponent <TSelectable>();

            if (selectable == null)
            {
                return;
            }
            if (_debugMode)
            {
                Debug.Log($"Selecting {selectable.name}");
            }
            onSelectableClicked(createArgs(selectable, hit, args.PointerInput));
        }
Пример #4
0
 private SelectableInputEventArgs createArgs(TSelectable selectable, PointerRaycastHit hit, PointerInputEventArgs args)
 {
     return(new SelectableInputEventArgs(selectable, hit, args));
 }
 public ClickableInputEventArgs(PointerRaycastHit raycastHit,
                                PointerInputEventArgs pointerInput)
 {
     RaycastHit   = raycastHit;
     PointerInput = pointerInput;
 }