Example #1
0
    /**
     * Set ad event for when an ad is showing
     *
     * @param onReady executed when an ad is clicked
     */
    public static void SetOnShowingCallback(Action <string, string, string> onShowing)
    {
        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.OnShowingCallback = onShowing;

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