mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-13 14:29:38 -05:00
TryParseOrDefault が Try してないので関数名を変える意向
This commit is contained in:
@@ -20,7 +20,7 @@ namespace UniGLTF.Utils
|
||||
}
|
||||
}
|
||||
|
||||
public static T TryParseOrDefault<T>(string name, bool ignoreCase = false, T defaultValue = default)
|
||||
public static T ParseOrDefault<T>(string name, bool ignoreCase = false, T defaultValue = default)
|
||||
where T : struct, Enum
|
||||
{
|
||||
try
|
||||
@@ -33,6 +33,16 @@ namespace UniGLTF.Utils
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// bool を返して out 変数に結果を返すのが TryXXX なので、Try ではない。
|
||||
/// </summary>
|
||||
[Obsolete("use ParseOrDefault")]
|
||||
public static T TryParseOrDefault<T>(string name, bool ignoreCase = false, T defaultValue = default)
|
||||
where T : struct, Enum
|
||||
{
|
||||
return ParseOrDefault<T>(name, ignoreCase: ignoreCase);
|
||||
}
|
||||
|
||||
public static T[] GetValues<T>() where T : struct, Enum
|
||||
{
|
||||
return CachedEnumType<T>.Values;
|
||||
|
||||
Reference in New Issue
Block a user