< 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    {
 9320        Collider[] colliders = Physics.OverlapBox(center, box * 0.5f, rotation,
 21            LayerMask.GetMask(AVATAR_TRIGGER_LAYER), QueryTriggerInteraction.Collide);
 22
 9323        if (colliders.Length == 0)
 24        {
 6425            return null;
 26        }
 27
 2928        bool hasExcludeList = excludeColliders != null;
 2929        HashSet<GameObject> result = new HashSet<GameObject>();
 20030        foreach (Collider collider in colliders)
 31        {
 7132            if (hasExcludeList && excludeColliders.Contains(collider))
 33            {
 34                continue;
 35            }
 5636            result.Add(collider.transform.parent.gameObject);
 37        }
 2938        return result;
 39    }
 40}