예제 #1
0
        public static void setLogLevel(LogLevel logLevel)
        {
                        #if !UNITY_EDITOR
            int log_level_int = -1;
            switch (logLevel)
            {
            case LogLevel.None:
                log_level_int = 0;
                break;

            case LogLevel.Error:
                log_level_int = 1;
                break;

            case LogLevel.Verbose:
                log_level_int = 2;
                break;
            }
                                #if UNITY_IOS
            AdaptyiOS.setLogLevel(log_level_int);
                                #elif UNITY_ANDROID
            AdaptyAndroid.setLogLevel(log_level_int);
                                #endif
                        #endif
        }
예제 #2
0
        public static void executeCallback()
        {
            Callback callback = null;

                        #if UNITY_IOS
            callback = AdaptyiOS.getCallback();
                        #elif UNITY_ANDROID
            callback = AdaptyAndroid.getCallback();
                        #endif
            if (callback != null && callback.objectName != null && callback.method != null && callback.message != null)
            {
                GameObject gameObject = UnityEngine.GameObject.Find(callback.objectName);
                if (gameObject != null)
                {
                    MonoBehaviour script = gameObject.GetComponent <MonoBehaviour>();
                    if (script != null)
                    {
                        System.Reflection.MethodInfo method = script.GetType().GetMethod(callback.method);
                        if (method != null)
                        {
                            method.Invoke(script, messageToParameters(callback.method, callback.message));
                        }
                    }
                }
            }
        }
예제 #3
0
        public static void updateAttribution(Dictionary <string, string> attribution, AttributionNetwork source, string networkUserId, MonoBehaviour gameObject)
        {
                        #if !UNITY_EDITOR
            int sourceInt = -1;
            switch (source)
            {
            case AttributionNetwork.Appsflyer:
                sourceInt = 0;
                break;

            case AttributionNetwork.Adjust:
                sourceInt = 1;
                break;

            case AttributionNetwork.Branch:
                sourceInt = 2;
                break;

            case AttributionNetwork.Custom:
                sourceInt = 3;
                break;
            }
            string attributionJson = Json.Serialize(attribution);
                                #if UNITY_IOS
            AdaptyiOS.updateAttribution(attributionJson, sourceInt, networkUserId, gameObject ? gameObject.name : null);
                                #elif UNITY_ANDROID
            AdaptyAndroid.updateAttribution(attributionJson, sourceInt, networkUserId, gameObject ? gameObject.name : null);
                                #endif
                        #endif
        }
예제 #4
0
 public static void getPurchaserInfo(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.getPurchaserInfo(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.getPurchaserInfo(gameObject ? gameObject.name : null);
                 #endif
 }
예제 #5
0
 public static void restorePurchases(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.restorePurchases(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.restorePurchases(gameObject ? gameObject.name : null);
                 #endif
 }
예제 #6
0
 public static void logout(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.logout(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.logout(gameObject ? gameObject.name : null);
                 #endif
 }
예제 #7
0
 public static void identify(string customerUserId, MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.identify(customerUserId, gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.identify(customerUserId, gameObject ? gameObject.name : null);
                 #endif
 }
예제 #8
0
 public static void activate(string key, bool observeMode)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.activate(key, observeMode);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.activate(key);
                 #endif
 }
예제 #9
0
 public static void setOnPromoReceivedListener(MonoBehaviour gameObject)
 {
                 #if UNITY_IOS && !UNITY_EDITOR
     AdaptyiOS.setOnPromoReceivedListener(gameObject ? gameObject.name : null);
                 #elif UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.setOnPromoReceivedListener(gameObject ? gameObject.name : null);
                 #endif
 }
예제 #10
0
 public static void makePurchase(ProductModel product, string offerId, MonoBehaviour gameObject)
 {
                 #if !UNITY_EDITOR
     string productJson = Json.Serialize(productToDictionary(product));
                         #if UNITY_IOS
     AdaptyiOS.makePurchase(productJson, offerId, gameObject ? gameObject.name : null);
                         #elif UNITY_ANDROID
     AdaptyAndroid.makePurchase(productJson, gameObject ? gameObject.name : null);
                         #endif
                 #endif
 }
예제 #11
0
 public static void updateProfile(ProfileParameterBuilder profileParams, MonoBehaviour gameObject)
 {
                 #if !UNITY_EDITOR
     string paramsJson = Json.Serialize(profileParams.getDictionary());
                         #if UNITY_IOS
     AdaptyiOS.updateProfile(paramsJson, gameObject ? gameObject.name : null);
                         #elif UNITY_ANDROID
     AdaptyAndroid.updateProfile(paramsJson, gameObject ? gameObject.name : null);
                         #endif
                 #endif
 }
예제 #12
0
 public static void validateGooglePurchase(PurchaseType purchaseType, string productId, string purchaseToken, string purchaseOrderId, ProductModel product, MonoBehaviour gameObject)
 {
                 #if UNITY_ANDROID && !UNITY_EDITOR
     int purchaseTypeInt = 0;
     if (purchaseType == PurchaseType.Subscription)
     {
         purchaseTypeInt = 1;
     }
     string productJson = Json.Serialize(productToDictionary(product));
     AdaptyAndroid.validatePurchase(purchaseTypeInt, productId, purchaseToken, purchaseOrderId, productJson, gameObject ? gameObject.name : null);
                 #endif
 }
예제 #13
0
 public static void syncPurchases(MonoBehaviour gameObject)
 {
                 #if UNITY_ANDROID && !UNITY_EDITOR
     AdaptyAndroid.syncPurchases(gameObject ? gameObject.name : null);
                 #endif
 }