< Summary

Class:ECSTransformParentingSystem
Assembly:DCL.ECSComponents.Transform.System
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Transform/System/ECSTransformParentingSystem.cs
Covered lines:9
Uncovered lines:1
Coverable lines:10
Total lines:28
Line coverage:90% (9 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Update()0%6.026091.67%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Transform/System/ECSTransformParentingSystem.cs

#LineLine coverage
 1using DCL.Models;
 2
 3public static class ECSTransformParentingSystem
 4{
 5    public static void Update()
 6    {
 47        if (ECSTransformUtils.orphanEntities == null || ECSTransformUtils.orphanEntities.Count == 0)
 8        {
 09            return;
 10        }
 11
 412        int count = ECSTransformUtils.orphanEntities.Count;
 13
 1614        for (int i = count - 1; i >= 0; i--)
 15        {
 416            var data = ECSTransformUtils.orphanEntities.Pairs[i].value;
 17
 418            if (ECSTransformUtils.TrySetParent(data.scene, data.entity, data.parentId, out IDCLEntity parent))
 19            {
 320                if (data.entity.parentId != SpecialEntityId.SCENE_ROOT_ENTITY)
 21                {
 222                    parent.childrenId.Add(data.entity.entityId);
 23                }
 324                ECSTransformUtils.orphanEntities.RemoveAt(i);
 25            }
 26        }
 427    }
 28}

Methods/Properties

Update()