< Summary

Class:BoxTriggerArea
Assembly:AvatarShape
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/AvatarModifiers/TriggerArea.cs
Covered lines:7
Uncovered lines:0
Coverable lines:7
Total lines:32
Line coverage:100% (7 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
DetectAvatars(...)0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/AvatarModifiers/TriggerArea.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using UnityEngine;
 3
 4[System.Serializable]
 5public abstract class TriggerArea
 6{
 7    public abstract HashSet<GameObject> DetectAvatars(Vector3 center, Quaternion rotation);
 8
 9}
 10
 11[System.Serializable]
 12public class BoxTriggerArea : TriggerArea
 13{
 14    internal const string AVATAR_TRIGGER_LAYER = "AvatarTriggerDetection";
 15    public Vector3 box;
 16
 17    public override HashSet<GameObject> DetectAvatars(Vector3 center, Quaternion rotation)
 18    {
 3719        Collider[] colliders = Physics.OverlapBox(center, box * 0.5f, rotation, LayerMask.GetMask(AVATAR_TRIGGER_LAYER),
 3720        if (colliders.Length == 0)
 21        {
 3222            return null;
 23        }
 24
 525        HashSet<GameObject> result = new HashSet<GameObject>();
 2026        foreach (Collider collider in colliders)
 27        {
 528            result.Add(collider.transform.parent.gameObject);
 29        }
 530        return result;
 31    }
 32}