< Summary

Class:DCL.Components.OnPointerUp
Assembly:DCL.Components.Events
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/UUIDEventComponentsPlugin/UUIDComponent/OnPointerUp.cs
Covered lines:12
Uncovered lines:1
Coverable lines:13
Total lines:45
Line coverage:92.3% (12 of 13)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Report(...)0%6.036090.91%
GetClassId()0%110100%
GetEventType()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/UUIDEventComponentsPlugin/UUIDComponent/OnPointerUp.cs

#LineLine coverage
 1using DCL.Interface;
 2using DCL.Helpers;
 3using DCL.Models;
 4using DCLPlugins.UUIDEventComponentsPlugin.UUIDComponent.Interfaces;
 5using Ray = UnityEngine.Ray;
 6
 7namespace DCL.Components
 8{
 9    public class OnPointerUp : OnPointerEvent
 10    {
 11        public const string NAME = "pointerUp";
 12
 13        public override void Report(WebInterface.ACTION_BUTTON buttonId, Ray ray, HitInfo hit)
 14        {
 315            if (!enabled || !IsVisible())
 116                return;
 17
 218            Model pointerEventModel = this.model as Model;
 19
 220            if (pointerEventModel == null)
 021                return;
 22
 223            bool validButton = pointerEventModel.button == "ANY" || buttonId.ToString() == pointerEventModel.button;
 24
 225            if (IsAtHoverDistance(hit.distance) && validButton)
 26            {
 227                string meshName = pointerEventHandler.GetMeshName(hit.collider);
 228                string entityId = Environment.i.world.sceneController.entityIdHelper.GetOriginalId(entity.entityId);
 29
 230                WebInterface.ReportOnPointerUpEvent(buttonId, scene.sceneData.sceneNumber, pointerEventModel.uuid,
 31                    entityId, meshName, ray, hit.point, hit.normal, hit.distance);
 32            }
 233        }
 34
 35        public override int GetClassId()
 36        {
 137            return (int) CLASS_ID_COMPONENT.UUID_ON_UP;
 38        }
 39
 40        public override PointerInputEventType GetEventType()
 41        {
 542            return PointerInputEventType.UP;
 43        }
 44    }
 45}