Ejemplo n.º 1
0
        public static void Broadcast <T>(params object[] list) where T : IConsentEventHandler
        {
            CmpDebugUtil.LogWarning("T == " + typeof(T).Name);
            switch (typeof(T).Name)
            {
            case nameof(IOnConsentReady):
                SpConsents consents = (SpConsents)list[0];
                BroadcastEventDispatcher.Execute <IOnConsentReady>(null, (i, d) => i.OnConsentReady(consents));
                break;

            case nameof(IOnConsentAction):
                CONSENT_ACTION_TYPE actionType = (CONSENT_ACTION_TYPE)list[0];
                BroadcastEventDispatcher.Execute <IOnConsentAction>(null, (i, d) => i.OnConsentAction(actionType));
                break;

            case nameof(IOnConsentError):
                Exception exception = (Exception)list[0];
                BroadcastEventDispatcher.Execute <IOnConsentError>(null, (i, d) => i.OnConsentError(exception));
                break;

            case nameof(IOnConsentUIReady):
                BroadcastEventDispatcher.Execute <IOnConsentUIReady>(null, (i, d) => i.OnConsentUIReady());
                break;

            case nameof(IOnConsentUIFinished):
                BroadcastEventDispatcher.Execute <IOnConsentUIFinished>(null, (i, d) => i.OnConsentUIFinished());
                break;
            }
        }
Ejemplo n.º 2
0
        public static SpConsents GetSpConsents()
        {
            SpConsents result = null;

#if UNITY_ANDROID && !UNITY_EDITOR
            if (Application.platform == RuntimePlatform.Android)
            {
                result = ConsentWrapperAndroid.Instance.GetSpConsents();
            }
#elif UNITY_IOS && !UNITY_EDITOR_OSX
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                result = ConsentWrapperIOS.Instance.GetSpConsents();
            }
#endif
            return(result);
        }