Esempio n. 1
0
    /**
     * Set event for when an ad fails to show
     *
     * @param onReady executed when an ad has failed to show
     */
    public static void SetOnFailedToShowCallback(Action <string, string, string> onFailedToShow)
    {
        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.OnFailedToShowCallback = onFailedToShow;

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