Firstborn/Library/PackageCache/com.unity.ads@4.4.2/Runtime/Advertisement/Utilities/EnumUtilities.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

16 lines
510 B
C#

using System;
namespace UnityEngine.Advertisements.Utilities {
public static class EnumUtilities {
public static T GetEnumFromAndroidJavaObject<T>(AndroidJavaObject androidJavaObject, T defaultValue) {
try {
return (T) Enum.Parse(typeof(T), androidJavaObject.Call<string>("toString"), true);
} catch (Exception) {
Debug.LogError("Unable to map native enum to managed enum");
}
return defaultValue;
}
}
}