< Summary

Class:GDX.Developer.Reports.Resource.Objects.MeshObjectInfo
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/Objects/MeshObjectInfo.cs
Covered lines:11
Uncovered lines:3
Coverable lines:14
Total lines:61
Line coverage:78.5% (11 of 14)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:3
Method coverage:66.6% (2 of 3)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Clone()0%2100%
Populate(...)0%110100%
GetDetailedInformation(...)0%660100%

File(s)

./Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/Objects/MeshObjectInfo.cs

#LineLine coverage
 1// Copyright (c) 2020-2024 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5#if !UNITY_DOTSRUNTIME
 6
 7using UnityEngine;
 8
 9namespace GDX.Developer.Reports.Resource.Objects
 10{
 11    /// <exception cref="UnsupportedRuntimeException">Not supported on DOTS Runtime.</exception>
 12    public sealed class MeshObjectInfo : ObjectInfo
 13    {
 14        public new const string TypeDefinition = "GDX.Developer.Reports.Resource.Objects.MeshObjectInfo,GDX";
 15        public bool IsReadable;
 16        public int SubMeshCount;
 17        public int Triangles;
 18
 19        public int VertexCount;
 20
 21        /// <summary>
 22        ///     Create a clone of this object.
 23        /// </summary>
 24        /// <returns></returns>
 25        public override ObjectInfo Clone()
 026        {
 027            return new MeshObjectInfo
 28            {
 29                CopyCount = CopyCount,
 30                MemoryUsage = MemoryUsage,
 31                Name = Name,
 32                Reference = Reference,
 33                TotalMemoryUsage = TotalMemoryUsage,
 34                Type = Type,
 35                IsReadable = IsReadable,
 36                SubMeshCount = SubMeshCount,
 37                Triangles = Triangles
 38            };
 039        }
 40
 41        public override void Populate(Object targetObject, TransientReference reference = null)
 1542        {
 1543            base.Populate(targetObject, reference);
 1544            Mesh meshAsset = (Mesh)targetObject;
 45
 46            // Useful mesh information
 1547            VertexCount = meshAsset.vertexCount;
 1548            SubMeshCount = meshAsset.subMeshCount;
 1549            Triangles = meshAsset.triangles.Length;
 1550            IsReadable = meshAsset.isReadable;
 1551        }
 52
 53        public override string GetDetailedInformation(int maximumWidth)
 2054        {
 2055            return maximumWidth < 40
 56                ? $"{(IsReadable ? "RW" : "")} (V:{VertexCount.ToString()}, SM:{SubMeshCount.ToString()})"
 57                : $"{(IsReadable ? "RW" : "")} (Verts:{VertexCount.ToString()}, SubMeshes:{SubMeshCount.ToString()})";
 2058        }
 59    }
 60}
 61#endif // !UNITY_DOTSRUNTIME

Coverage by test methods




Methods/Properties

Clone()
Populate(UnityEngine.Object, GDX.Developer.TransientReference)
GetDetailedInformation(System.Int32)