< Summary

Class:GDX.Developer.Reports.Resource.Objects.MeshObjectInfo
Assembly:GDX
File(s):D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/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)

D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/Objects/MeshObjectInfo.cs

#LineLine coverage
 1// Copyright (c) 2020-2022 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        /// <summary>
 20        /// Create a clone of this object.
 21        /// </summary>
 22        /// <returns></returns>
 23        public override ObjectInfo Clone()
 024        {
 025            return new MeshObjectInfo()
 26            {
 27                CopyCount = CopyCount,
 28                MemoryUsage = MemoryUsage,
 29                Name = Name,
 30                Reference = Reference,
 31                TotalMemoryUsage = TotalMemoryUsage,
 32                Type = Type,
 33                IsReadable =  IsReadable,
 34                SubMeshCount = SubMeshCount,
 35                Triangles =  Triangles
 36            };
 037        }
 38
 39        public int VertexCount;
 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