< Summary

Class:MainScripts.DCL.Components.Avatar.VRMExporter.VRMBonesMappingSO
Assembly:AvatarShape
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/VRMExporter/VRMBonesMappingSO.cs
Covered lines:0
Uncovered lines:4
Coverable lines:4
Total lines:28
Line coverage:0% (0 of 4)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:3
Method coverage:0% (0 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
VRMBonesMappingSO()0%2100%
TryGetFBXBone(...)0%2100%
EnsureDictionary()0%20400%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/VRMExporter/VRMBonesMappingSO.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Linq;
 3using UnityEngine;
 4
 5namespace MainScripts.DCL.Components.Avatar.VRMExporter
 6{
 7    [System.Serializable]
 8    public struct BonesMapEntry
 9    {
 10        public string nameDCL;
 11        public string nameVRM;
 12    }
 13
 14    [CreateAssetMenu(menuName = "VRM/Create BonesMappingSO", fileName = "VRMBonesMapping", order = 0)]
 15    public class VRMBonesMappingSO : ScriptableObject
 16    {
 017        [SerializeField] private List<BonesMapEntry> bonesMapping = new List<BonesMapEntry>();
 18        private Dictionary<string, string> dclToFbx;
 19
 20        public bool TryGetFBXBone(string dclBoneName, out string fbxBoneName)
 21        {
 022            EnsureDictionary();
 023            return dclToFbx.TryGetValue(dclBoneName, out fbxBoneName);
 24        }
 25
 026        private void EnsureDictionary() => dclToFbx ??= bonesMapping.ToDictionary(x => x.nameDCL, x => x.nameVRM);
 27    }
 28}