Esempio n. 1
0
    /**
     * Set ad event on clicked
     *
     * @param onReady executed when an ad is clicked
     */
    public static void SetOnClickedCallback(Action <string, string, string> onClicked)
    {
        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.OnClickedCallback = onClicked;

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