Ejemplo n.º 1
0
    static public void RequiresDataConsentOptIn(Action onRequired, Action onNotRequired)
    {
        Enhance.InitializeEnhance();

        if (GameObject.Find(FGLEnhance_Callbacks.CallbackObjectName) == null)
        {
            string     newName        = "__FGLEnhance_Callback_" + UnityEngine.Random.Range(0, int.MaxValue);
            GameObject callbackObject = new GameObject(newName);
            callbackObject.AddComponent <FGLEnhance_Callbacks>();
        }

        FGLEnhance_Callbacks.OnOptInRequiredCallback    = onRequired;
        FGLEnhance_Callbacks.OnOptInNotRequiredCallback = onNotRequired;
#if UNITY_EDITOR
        if (onNotRequired != null)
        {
            onNotRequired();
        }
#elif UNITY_ANDROID
        FGLAndroidInternals.RequiresDataConsentOptIn(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.RequiresDataConsentOptIn(FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }