mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-11 13:04:17 -05:00
21 lines
390 B
C#
21 lines
390 B
C#
using System;
|
|
|
|
|
|
namespace VRM
|
|
{
|
|
public static class EnumUtil
|
|
{
|
|
public static T TryParseOrDefault<T>(string src)where T: struct
|
|
{
|
|
try
|
|
{
|
|
return (T)Enum.Parse(typeof(T), src, true);
|
|
}
|
|
catch(Exception)
|
|
{
|
|
return default(T);
|
|
}
|
|
}
|
|
}
|
|
}
|