Esempio n. 1
0
    /**
     * Set ad event on complete
     *
     * @param onComplete executed when an ad is ready
     */
    public static void SetOnCompleteCallback(Action <string, string, string> onComplete)
    {
        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.OnCompleteCallback = onComplete;

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