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)); }
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)); }