private static void Init3rdPlatformSDK(Type t) { bool flag = false; string text = SDKParams.Get3rdPlatformName(t); object[] customAttributes = t.GetCustomAttributes(false); for (int i = 0; i < customAttributes.Length; i++) { object obj = customAttributes[i]; JoyYouSDKAttribute joyYouSDKAttribute = obj as JoyYouSDKAttribute; if (joyYouSDKAttribute != null && joyYouSDKAttribute.NAME == text) { Debug.Log("SDK initialised begin --> " + text); joyYouSDKAttribute.InitSDK(); flag = true; break; } } FieldInfo field = t.GetField("isInitialised", BindingFlags.Static | BindingFlags.NonPublic); field.SetValue(t, flag); if (!flag) { Debug.LogWarning("SDK initialised failed!"); } else { Debug.Log("SDK initialised succeed --> " + text); } }
private static bool Platform_Cast <T>(bool tag, JoyYouSDKAttribute attr) where T : class { return(tag && attr is T); }