< Summary

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

Metrics

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

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5[Serializable]
 6public abstract class TriggerArea
 7{
 8    public abstract HashSet<GameObject> DetectAvatars(in Vector3 center, in Quaternion rotation, in HashSet<Collider> ex
 9
 10}
 11
 12[Serializable]
 13public class BoxTriggerArea : TriggerArea
 14{
 15    internal const string AVATAR_TRIGGER_LAYER = "AvatarTriggerDetection";
 16    public Vector3 box;
 17
 18    public override HashSet<GameObject> DetectAvatars(in Vector3 center, in Quaternion rotation, in HashSet<Collider> ex
 19    {
 6420        Collider[] colliders = Physics.OverlapBox(center, box * 0.5f, rotation,
 21            LayerMask.GetMask(AVATAR_TRIGGER_LAYER), QueryTriggerInteraction.Collide);
 22
 6423        if (colliders.Length == 0)
 24        {
 4625            return null;
 26        }
 27
 1828        bool hasExcludeList = excludeColliders != null;
 1829        HashSet<GameObject> result = new HashSet<GameObject>();
 13230        foreach (Collider collider in colliders)
 31        {
 4832            if (hasExcludeList && excludeColliders.Contains(collider))
 33            {
 34                continue;
 35            }
 3636            result.Add(collider.transform.parent.gameObject);
 37        }
 1838        return result;
 39    }
 40}