Ejemplo n.º 1
0
    /**
     * Set interstitial completed callback
     *
     * @param onInterstitialCallback callback executed when an interstitial completes
     */
    public static void SetInterstitialCallback(Action onInterstitialCallback)
    {
        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.OnInterstitialCallback = onInterstitialCallback;

        InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.RequestInterstitialEvents(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_ANDROID
        FGLAndroidInternals.RequestInterstitialEvents(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.RequestInterstitialEvents(FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }