< Summary

Class:CallbackOnExternalClick
Assembly:HUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/CallbackOnExternalClick.cs
Covered lines:0
Uncovered lines:5
Coverable lines:5
Total lines:24
Line coverage:0% (0 of 5)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%2100%
Update()0%12300%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/CallbackOnExternalClick.cs

#LineLine coverage
 1using UnityEngine;
 2using UnityEngine.Events;
 3
 4[RequireComponent(typeof(RectTransform))]
 5public class CallbackOnExternalClick : MonoBehaviour
 6{
 7    public UnityEvent callback;
 8
 9    private RectTransform rectTransform;
 10
 011    private void Awake() { rectTransform = GetComponent<RectTransform>(); }
 12
 13    // Update is called once per frame
 14    void Update()
 15    {
 016        if (Input.GetMouseButtonDown(0))
 17        {
 018            if (!RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition))
 19            {
 020                callback.Invoke();
 21            }
 22        }
 023    }
 24}

Methods/Properties

Awake()
Update()