From 07a3de4baabd53f585da411fb14366687227dd54 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Fri, 7 May 2021 19:26:12 +0900 Subject: [PATCH] Remove unused class --- .../UniGLTF/IO/TextureIO/ColorSpace.cs | 52 ------------------- .../UniGLTF/IO/TextureIO/ColorSpace.cs.meta | 11 ---- 2 files changed, 63 deletions(-) delete mode 100644 Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs delete mode 100644 Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs.meta diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs deleted file mode 100644 index 1274075ee..000000000 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Linq; -using UnityEngine; - -namespace UniGLTF -{ - public static class ColorSpace - { - public static RenderTextureReadWrite GetColorSpace(this glTFTextureTypes textureType) - { - switch (textureType) - { - case glTFTextureTypes.SRGB: - return RenderTextureReadWrite.sRGB; - case glTFTextureTypes.OcclusionMetallicRoughness: - case glTFTextureTypes.Normal: - return RenderTextureReadWrite.Linear; - default: - throw new NotImplementedException(); - } - } - - public static bool TryGetglTFTextureType(this glTF glTf, int textureIndex, out glTFTextureTypes textureType) - { - foreach (var material in glTf.materials) - { - var textureInfo = material.GetTextures().FirstOrDefault(x => (x != null) && x.index == textureIndex); - if (textureInfo != null) - { - textureType = textureInfo.TextureType; - return true; - } - } - - // textureIndex is not used by Material. - textureType = default; - return false; - } - - public static RenderTextureReadWrite GetColorSpace(this glTF gltf, int textureIndex) - { - if (TryGetglTFTextureType(gltf, textureIndex, out glTFTextureTypes textureType)) - { - return GetColorSpace(textureType); - } - else - { - return RenderTextureReadWrite.sRGB; - } - } - } -} diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs.meta deleted file mode 100644 index d5bf0544c..000000000 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/ColorSpace.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 1a3edb24329fd454db97cac12f30c0d8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: