diff --git a/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs index 8704dc0d0..05322b2fd 100644 --- a/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs +++ b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs @@ -20,7 +20,7 @@ namespace UniGLTF.Utils } } - public static T TryParseOrDefault(string name, bool ignoreCase = false, T defaultValue = default) + public static T ParseOrDefault(string name, bool ignoreCase = false, T defaultValue = default) where T : struct, Enum { try @@ -33,6 +33,16 @@ namespace UniGLTF.Utils } } + /// + /// bool を返して out 変数に結果を返すのが TryXXX なので、Try ではない。 + /// + [Obsolete("use ParseOrDefault")] + public static T TryParseOrDefault(string name, bool ignoreCase = false, T defaultValue = default) + where T : struct, Enum + { + return ParseOrDefault(name, ignoreCase: ignoreCase); + } + public static T[] GetValues() where T : struct, Enum { return CachedEnumType.Values;