| | 1 | | using DCL.Interface; |
| | 2 | | using DCL.Helpers; |
| | 3 | | using DCL.Models; |
| | 4 | | using Ray = UnityEngine.Ray; |
| | 5 | |
|
| | 6 | | namespace DCL.Components |
| | 7 | | { |
| | 8 | | public class OnPointerUp : OnPointerEvent |
| | 9 | | { |
| | 10 | | public const string NAME = "pointerUp"; |
| | 11 | |
|
| | 12 | | public override void Report(WebInterface.ACTION_BUTTON buttonId, Ray ray, HitInfo hit) |
| | 13 | | { |
| 3 | 14 | | if (!enabled || !IsVisible()) |
| 1 | 15 | | return; |
| | 16 | |
|
| 2 | 17 | | Model pointerEventModel = this.model as Model; |
| | 18 | |
|
| 2 | 19 | | if (pointerEventModel == null) |
| 0 | 20 | | return; |
| | 21 | |
|
| 2 | 22 | | bool validButton = pointerEventModel.button == "ANY" || buttonId.ToString() == pointerEventModel.button; |
| | 23 | |
|
| 2 | 24 | | if (IsAtHoverDistance(hit.distance) && validButton) |
| | 25 | | { |
| 2 | 26 | | string meshName = pointerEventHandler.GetMeshName(hit.collider); |
| 2 | 27 | | WebInterface.ReportOnPointerUpEvent(buttonId, scene.sceneData.id, pointerEventModel.uuid, entity.entityI |
| | 28 | | } |
| 2 | 29 | | } |
| | 30 | |
|
| 0 | 31 | | public override int GetClassId() { return (int) CLASS_ID_COMPONENT.UUID_ON_UP; } |
| | 32 | |
|
| 9 | 33 | | public override PointerInputEventType GetEventType() { return PointerInputEventType.UP; } |
| | 34 | | } |
| | 35 | | } |