コード例 #1
0
    /**
     * Show offerwall
     */
    public static void ShowOfferwall(string placement)
    {
        InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.ShowOfferwall(placement);
#elif UNITY_ANDROID
        FGLAndroidInternals.ShowOfferwall(placement);
#elif UNITY_IOS
        FGLiOSInternals.ShowOfferwall(placement);
#endif
    }
コード例 #2
0
    /**
     * Hide banner ad
     */
    public static void HideBannerAd()
    {
        InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.HideBannerAd();
#elif UNITY_ANDROID
        FGLAndroidInternals.HideBannerAd();
#elif UNITY_IOS
        FGLiOSInternals.HideBannerAd();
#endif
    }
コード例 #3
0
    /**
     * Set current screen
     *
     * @param name name of the currently displayed screen
     */
    public static void SetCurrentScreen(string name)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.SetCurrentScreen(name);
#elif UNITY_ANDROID
        FGLAndroidInternals.SetCurrentScreen(name);
#elif UNITY_IOS
        FGLiOSInternals.SetCurrentScreen(name);
#endif
    }
コード例 #4
0
    /**
     * Update the value of a particular SDK key
     *
     * @param id ID of sdk to set key for
     * @param key key to set
     * @param value new value
     */
    public static void SetSdkValue(string sdkId, string key, string value)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.SetSdkValue(sdkId, key, value);
#elif UNITY_ANDROID
        FGLAndroidInternals.SetSdkValue(sdkId, key, value);
#elif UNITY_IOS
        FGLiOSInternals.SetSdkValue(sdkId, key, value);
#endif
    }
コード例 #5
0
    ///// PUBLIC /////

    /**
     * Log debug message to the console
     *
     * @param tag tag to use
     * @param message message to log
     */
    public static void LogMessage(string tag, string message)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.LogMessage(tag, message);
#elif UNITY_ANDROID
        FGLAndroidInternals.LogMessage(tag, message);
#elif UNITY_IOS
        FGLiOSInternals.LogMessage(tag, message);
#endif
    }
コード例 #6
0
ファイル: FGLEnhance.cs プロジェクト: kosenshou/gamekit
    /**
     * Show interstitial ad
     */
    public static void ShowInterstitialAd(string placement = INTERSTITIAL_PLACEMENT_DEFAULT)
    {
        InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.ShowInterstitialAd(placement);
#elif UNITY_ANDROID
        FGLAndroidInternals.ShowInterstitialAd(placement);
#elif UNITY_IOS
        FGLiOSInternals.ShowInterstitialAd(placement);
#endif
    }
コード例 #7
0
ファイル: FGLEnhance.cs プロジェクト: kosenshou/gamekit
    /**
     * Log custom analytics event
     *
     * @param eventType event type (for instance 'level_completed')
     * @param paramKey parameter key (for instance 'level')
     * @param paramValue parameter value (for instance '3')
     */
    public static void LogEvent(string eventType, string paramKey, string paramValue)
    {
        InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.LogEvent(eventType, paramKey, paramValue);
#elif UNITY_ANDROID
        FGLAndroidInternals.LogEvent(eventType, paramKey, paramValue);
#elif UNITY_IOS
        FGLiOSInternals.LogEvent(eventType, paramKey, paramValue);
#endif
    }
コード例 #8
0
    /**
     * Log custom analytics event
     *
     * @param eventType event type (for instance 'level_completed')
     * @param paramKey parameter key (for instance 'level')
     * @param paramValue parameter value (for instance '3')
     */
    public static void LogEventWithParameters(string eventType, Dictionary <string, string> parameters)
    {
        InitializeEnhance();

                #if UNITY_EDITOR
        FGLEditorInternals.LogEventWithParameters(eventType, parameters);
                #elif UNITY_ANDROID
        FGLAndroidInternals.LogEventWithParameters(eventType, parameters);
                #elif UNITY_IOS
        FGLiOSInternals.LogEventWithParameters(eventType, parameters);
                #endif
    }
コード例 #9
0
    private static void _SetSdkConfiguration(string sdkId, string configurationKey, string configurationValue)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.SetSdkConfiguration(sdkId, configurationKey, configurationValue);
#elif UNITY_ANDROID
        FGLAndroidInternals.SetSdkConfiguration(sdkId, configurationKey, configurationValue);
#elif UNITY_IOS
        FGLiOSInternals.SetSdkConfiguration(sdkId, configurationKey, configurationValue);
#endif
    }
コード例 #10
0
    private static string _GetDisplayDescription(string sku, string defaultDescription)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        return(defaultDescription);
#elif UNITY_ANDROID
        return(FGLAndroidInternals.GetDisplayDescription(sku, defaultDescription));
#elif UNITY_IOS
        return(FGLiOSInternals.GetDisplayDescription(sku, defaultDescription));
#endif
    }
コード例 #11
0
    static public void ServiceTermsOptOut()
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        Debug.Log("[Enhance] ServiceTermsOptOut - runned in Unity Editor, nothing to do");
#elif UNITY_ANDROID
        FGLAndroidInternals.ServiceTermsOptOut();
#elif UNITY_IOS
        FGLiOSInternals.ServiceTermsOptOut();
#endif
    }
コード例 #12
0
    /**
     * Disable local notifications
     */
    static public void DisableLocalNotification()
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.DisableLocalNotifications();
#elif UNITY_ANDROID
        FGLAndroidInternals.DisableLocalNotifications();
#elif UNITY_IOS
        FGLiOSInternals.DisableLocalNotifications();
#endif
    }
コード例 #13
0
    /**
     * Enable local notifications
     *
     * @param title notification title
     * @param message notification message
     * @param delay notification delay in seconds
     */
    public static void EnableLocalNotification(string title, string message, int delay)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        FGLEditorInternals.EnableLocalNotifications(title, message, delay);
#elif UNITY_ANDROID
        FGLAndroidInternals.EnableLocalNotifications(title, message, delay);
#elif UNITY_IOS
        FGLiOSInternals.EnableLocalNotifications(title, message, delay);
#endif
    }
コード例 #14
0
    /**
     * Check if a banner ad is ready
     *
     * @return true if an banner ad is ready, false if not
     */
    public static bool IsBannerAdReady(string placement)
    {
        InitializeEnhance();
#if UNITY_EDITOR
        return(FGLEditorInternals.IsBannerAdReady(placement));
#elif UNITY_ANDROID
        return(FGLAndroidInternals.IsBannerAdReady(placement));
#elif UNITY_IOS
        return(FGLiOSInternals.IsBannerAdReady(placement));
#else
        return(false);
#endif
    }
コード例 #15
0
ファイル: FGLEnhance.cs プロジェクト: kosenshou/gamekit
    /**
     * Check if a rewarded ad is ready
     *
     * @return true if a rewarded ad is ready, false if not
     */
    public static bool IsRewardedAdReady(string placement = REWARDED_PLACEMENT_NEUTRAL)
    {
        InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.IsRewardedAdReady(placement));
#elif UNITY_ANDROID
        return(FGLAndroidInternals.IsRewardedAdReady(placement));
#elif UNITY_IOS
        return(FGLiOSInternals.IsRewardedAdReady(placement));
#else
        return(false);
#endif
    }
コード例 #16
0
    private static int _GetOwnedItemCount(string sku)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.GetOwnedItemCount(sku));
#elif UNITY_ANDROID
        return(FGLAndroidInternals.GetOwnedItemCount(sku));
#elif UNITY_IOS
        return(FGLiOSInternals.GetOwnedItemCount(sku));
#else
        return(0);
#endif
    }
コード例 #17
0
    public static bool IsRestoringNeeded()
    {
        FGLEnhance.InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.IsRestoringNeeded());
#elif UNITY_ANDROID
        return(FGLAndroidInternals.IsRestoringNeeded());
#elif UNITY_IOS
        return(FGLiOSInternals.IsRestoringNeeded());
#else
        return(false);
#endif
    }
コード例 #18
0
    private static bool _IsProductStatusPending(string sku)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.IsProductStatusPending(sku));
#elif UNITY_ANDROID
        return(FGLAndroidInternals.IsProductStatusPending(sku));
#elif UNITY_IOS
        return(false); //iOS doesn't need pending transations
#else
        return(false);
#endif
    }
コード例 #19
0
    private static bool _IsItemOwned(string sku)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.IsItemOwned(sku));
#elif UNITY_ANDROID
        return(FGLAndroidInternals.IsItemOwned(sku));
#elif UNITY_IOS
        return(FGLiOSInternals.IsItemOwned(sku));
#else
        return(false);
#endif
    }
コード例 #20
0
    private static string _GetDisplayPrice(string sku, string defaultPrice)
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.GetDisplayPrice(sku, defaultPrice));
#elif UNITY_ANDROID
        return(FGLAndroidInternals.GetDisplayPrice(sku, defaultPrice));
#elif UNITY_IOS
        return(FGLiOSInternals.GetDisplayPrice(sku, defaultPrice));
#else
        return(defaultPrice);
#endif
    }
コード例 #21
0
ファイル: FGLEnhance.cs プロジェクト: kosenshou/gamekit
    /**
     * Check if an interstitial ad is ready
     *
     * @return true if an interstitial ad is ready, false if not
     */
    public static bool IsInterstitialReady(string placement = INTERSTITIAL_PLACEMENT_DEFAULT)
    {
        InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.IsInterstitialReady(placement));
#elif UNITY_ANDROID
        return(FGLAndroidInternals.IsInterstitialReady(placement));
#elif UNITY_IOS
        return(FGLiOSInternals.IsInterstitialReady(placement));
#else
        return(true);
#endif
    }
コード例 #22
0
    ///// PUBLIC /////

    private static bool _IsSupported()
    {
        Enhance.InitializeEnhance();

#if UNITY_EDITOR
        return(FGLEditorInternals.IsPurchasingSupported());
#elif UNITY_ANDROID
        return(FGLAndroidInternals.IsPurchasingSupported());
#elif UNITY_IOS
        return(FGLiOSInternals.IsPurchasingSupported());
#else
        return(false);
#endif
    }
コード例 #23
0
ファイル: FGLEnhance.cs プロジェクト: kosenshou/gamekit
    ///// PRIVATE /////
    static void InitializeEnhance()
    {
        if (!mInitialized)
        {
            mInitialized = true;

#if UNITY_EDITOR
            FGLEditorInternals.Initialize();
#elif UNITY_ANDROID
            FGLAndroidInternals.Initialize();
#elif UNITY_IOS
            FGLiOSInternals.Initialize();
#endif
        }
    }
コード例 #24
0
    /**
     * Show banner ad
     *
     * @param position position (top or bottom)
     */
    public static void ShowBannerAdWithPosition(string placement, Position position)
    {
        string strPos = "BOTTOM";

        if (position == Position.TOP)
        {
            strPos = "TOP";
        }

        InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.ShowBannerAd(placement, strPos);
#elif UNITY_ANDROID
        FGLAndroidInternals.ShowBannerAd(placement, strPos);
#elif UNITY_IOS
        FGLiOSInternals.ShowBannerAd(placement, strPos);
#endif
    }
コード例 #25
0
    private static void _ManuallyRestorePurchases(Action onRestoreSuccessCallback, Action onRestoreFailedCallback)
    {
        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.OnRestorePurchasesSuccessCallback = onRestoreSuccessCallback;
        FGLEnhance_Callbacks.OnRestorePurchasesFailedCallback  = onRestoreFailedCallback;

        Enhance.InitializeEnhance();
#if UNITY_ANDROID
        FGLAndroidInternals.ManuallyRestorePurchases(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.ManuallyRestorePurchases(FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }
コード例 #26
0
    /**
     * Set event for when an ad is loaded
     *
     * @param onReady executed when an ad has loaded
     */
    public static void SetOnLoadingCallback(Action <string, string, string> onLoading)
    {
        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.OnLoadingCallback = onLoading;

        InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.SetOnLoadingCallback(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_ANDROID
        FGLAndroidInternals.SetOnLoadingCallback(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.SetOnLoadingCallback(FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }
コード例 #27
0
    static public void ShowServiceOptInDialogs(string[] requestedSdks, Action onDialogComplete)
    {
        Enhance.InitializeEnhance();

        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.OnDialogCompleteCallback = onDialogComplete;

#if UNITY_EDITOR
        Debug.Log("[Enhance] ShowServiceOptInDialogs - runned in Unity Editor, nothing to do");
#elif UNITY_ANDROID
        FGLAndroidInternals.ShowServiceOptInDialogs(requestedSdks, FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.ShowServiceOptInDialogs(requestedSdks, FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }
コード例 #28
0
    /**
     * Request permission from the user to show local notifications
     *
     * @param onPermissionGrantedCallback executed when the permission is granted
     * @param onPermissionRefusedCallback executed when the permission is refused
     */
    public static void RequestLocalNotificationPermission(Action onPermissionGrantedCallback, Action onPermissionRefusedCallback)
    {
        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.OnLocalNotificationPermissionGrantedCallback = onPermissionGrantedCallback;
        FGLEnhance_Callbacks.OnLocalNotificationPermissionRefused         = onPermissionRefusedCallback;

        Enhance.InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.RequestLocalNotificationsPermission(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_ANDROID
        FGLAndroidInternals.RequestLocalNotificationsPermission(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.RequestLocalNotificationsPermission(FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }
コード例 #29
0
    private static void _AttemptPurchase(string sku, Action onPurchaseSuccessCallback, Action onPurchaseFailedCallback)
    {
        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.OnPurchaseSuccessCallback = onPurchaseSuccessCallback;
        FGLEnhance_Callbacks.OnPurchaseFailedCallback  = onPurchaseFailedCallback;

        Enhance.InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.AttemptPurchase(sku, FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_ANDROID
        FGLAndroidInternals.AttemptPurchase(sku, FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.AttemptPurchase(sku, FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }
コード例 #30
0
ファイル: FGLEnhance.cs プロジェクト: kosenshou/gamekit
    /**
     * Show rewarded ad
     *
     * @param placement placement type for this ad
     * @param onRewardGrantedCallback callback executed when the ad reward is granted
     * @param onRewardDeclinedCallback callback executed when the ad reward is declined
     * @param onRewardUnavailableCallback callback executed when the ad reward is unavailable
     */
    public static void ShowRewardedAd(string placement, Action <RewardType, int> onRewardGrantedCallback, Action onRewardDeclinedCallback, Action onRewardUnavailableCallback)
    {
        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.OnRewardGrantedCallback     = onRewardGrantedCallback;
        FGLEnhance_Callbacks.OnRewardDeclinedCallback    = onRewardDeclinedCallback;
        FGLEnhance_Callbacks.OnRewardUnavailableCallback = onRewardUnavailableCallback;

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