refactor: Update Unity to 2022.3.62
This commit is contained in:
@@ -35,8 +35,8 @@ namespace Cryville.Common {
|
||||
return null;
|
||||
else if (type.IsAssignableFrom(value.GetType()))
|
||||
return value;
|
||||
else if (type.IsEnum && value is string) {
|
||||
return Enum.Parse(type, (string)value);
|
||||
else if (type.IsEnum && value is string strValue) {
|
||||
return Enum.Parse(type, strValue);
|
||||
}
|
||||
throw new InvalidCastException(string.Format("Cannot cast {0} to {1}", value.GetType(), type));
|
||||
}
|
||||
|
Reference in New Issue
Block a user