< Summary

Class:DragAndDropSceneObjectView
Assembly:BuildModeHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuildModeHUD/Scripts/GodMode/DragAndDropSceneObjectView.cs
Covered lines:6
Uncovered lines:1
Coverable lines:7
Total lines:37
Line coverage:85.7% (6 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Create()0%110100%
Awake()0%110100%
OnDestroy()0%110100%
GetGeneralCanvas()0%2100%
Drop()0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuildModeHUD/Scripts/GodMode/DragAndDropSceneObjectView.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3using UnityEngine.EventSystems;
 4
 5public interface IDragAndDropSceneObjectView
 6{
 7    Canvas GetGeneralCanvas();
 8    event Action OnDrop;
 9
 10    void Drop();
 11}
 12
 13public class DragAndDropSceneObjectView : MonoBehaviour, IDragAndDropSceneObjectView
 14{
 15    public Canvas generalCanvas;
 16    public event Action OnDrop;
 17
 18    [SerializeField] internal EventTrigger dragAndDropEventTrigger;
 19
 20    private const string VIEW_PATH = "GodMode/DragAndDropSceneObjectView";
 21
 22    internal static DragAndDropSceneObjectView Create()
 23    {
 124        var view = Instantiate(Resources.Load<GameObject>(VIEW_PATH)).GetComponent<DragAndDropSceneObjectView>();
 125        view.gameObject.name = "_DragAndDropSceneObjectView";
 26
 127        return view;
 28    }
 29
 9230    private void Awake() { BIWUtils.ConfigureEventTrigger(dragAndDropEventTrigger, EventTriggerType.Drop, (eventData) =>
 31
 9232    private void OnDestroy() { BIWUtils.RemoveEventTrigger(dragAndDropEventTrigger, EventTriggerType.Drop); }
 33
 034    public Canvas GetGeneralCanvas() { return generalCanvas; }
 35
 236    public void Drop() { OnDrop?.Invoke(); }
 37}