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

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