From d4daa3951fd4ee6a73316b455b9367a53263fb7e Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 21 May 2021 13:12:54 +0900 Subject: [PATCH] remove #if UNITY_2017_1_OR_NEWER --- .../IO/TextureIO/TextureSamplerUtil.cs | 32 +++---------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/TextureSamplerUtil.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/TextureSamplerUtil.cs index 19f699377..8c6b1de09 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/TextureSamplerUtil.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/TextureSamplerUtil.cs @@ -43,24 +43,6 @@ namespace UniGLTF } } - public static TextureWrapMode GetWrapS(Texture texture) - { -#if UNITY_2017_1_OR_NEWER - return texture.wrapModeU; -#else - return texture.wrapMode; -#endif - } - - public static TextureWrapMode GetWrapT(Texture texture) - { -#if UNITY_2017_1_OR_NEWER - return texture.wrapModeV; -#else - return texture.wrapMode; -#endif - } - public static glWrap ExportWrapMode(TextureWrapMode wrapMode) { switch (wrapMode) @@ -68,18 +50,14 @@ namespace UniGLTF case TextureWrapMode.Clamp: return glWrap.CLAMP_TO_EDGE; - case (TextureWrapMode)(-1): - case TextureWrapMode.Repeat: - return glWrap.REPEAT; - -#if UNITY_2017_1_OR_NEWER case TextureWrapMode.Mirror: case TextureWrapMode.MirrorOnce: return glWrap.MIRRORED_REPEAT; -#endif + // case (TextureWrapMode)(-1): + // case TextureWrapMode.Repeat: default: - throw new NotImplementedException(); + return glWrap.REPEAT; } } @@ -87,8 +65,8 @@ namespace UniGLTF { var magFilter = ExportMagFilter(texture); var minFilter = ExportMinFilter(texture); - var wrapS = ExportWrapMode(GetWrapS(texture)); - var wrapT = ExportWrapMode(GetWrapT(texture)); + var wrapS = ExportWrapMode(texture.wrapModeU); + var wrapT = ExportWrapMode(texture.wrapModeV); return new glTFTextureSampler { magFilter = magFilter,