< Summary

Class:GDX.Developer.Reports.Resource.Objects.ObjectInfoFactory
Assembly:GDX
File(s):D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/Objects/ObjectInfoFactory.cs
Covered lines:5
Uncovered lines:25
Coverable lines:30
Total lines:75
Line coverage:16.6% (5 of 30)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:2
Method coverage:50% (1 of 2)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetObjectInfo(...)0%1101000%
GetObjectInfoType(...)0%39.6310033.33%

File(s)

D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/Objects/ObjectInfoFactory.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 System;
 8using UnityEngine;
 9
 10namespace GDX.Developer.Reports.Resource.Objects
 11{
 12    /// <exception cref="UnsupportedRuntimeException">Not supported on DOTS Runtime.</exception>
 13    public static class ObjectInfoFactory
 14    {
 15        public static ObjectInfo GetObjectInfo(Type targetType)
 016        {
 017            if (targetType == typeof(Texture2D) ||
 18                targetType == typeof(Texture3D) ||
 19                targetType == typeof(Texture2DArray) ||
 20                targetType == typeof(RenderTexture) ||
 21                targetType == typeof(Cubemap) ||
 22                targetType == typeof(CubemapArray))
 023            {
 024                return new TextureObjectInfo();
 25            }
 26
 027            if (targetType == typeof(Mesh))
 028            {
 029                return new MeshObjectInfo();
 30            }
 31
 032            if (targetType == typeof(Shader))
 033            {
 034                return new ShaderObjectInfo();
 35            }
 36
 037            if (targetType == typeof(AssetBundle))
 038            {
 039                return new AssetBundleObjectInfo();
 40            }
 41
 042            return new ObjectInfo();
 043        }
 44        public static Type GetObjectInfoType(Type targetType)
 145        {
 146            if (targetType == typeof(Texture2D) ||
 47                targetType == typeof(Texture3D) ||
 48                targetType == typeof(Texture2DArray) ||
 49                targetType == typeof(RenderTexture) ||
 50                targetType == typeof(Cubemap) ||
 51                targetType == typeof(CubemapArray))
 152            {
 153                return typeof(TextureObjectInfo);
 54            }
 55
 056            if (targetType == typeof(Mesh))
 057            {
 058                return typeof(MeshObjectInfo);
 59            }
 60
 061            if (targetType == typeof(Shader))
 062            {
 063                return typeof(ShaderObjectInfo);
 64            }
 65
 066            if (targetType == typeof(AssetBundle))
 067            {
 068                return typeof(AssetBundleObjectInfo);
 69            }
 70
 071            return typeof(ObjectInfo);
 172        }
 73    }
 74}
 75#endif