Exemplo n.º 1
0
    /**
     * Set ad event on unavailable
     *
     * @param onReady executed when an ad is unavailable
     */
    public static void SetOnUnavailableCallback(Action <string, string, string> onUnavailable)
    {
        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.OnUnavailableCallback = onUnavailable;

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