public static void NewResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
 {
     if (!GameAnalyticsSDK.GameAnalytics._hasInitializeBeenCalled)
     {
         return;
     }
     GA_Resource.NewEvent(flowType, currency, amount, itemType, itemId, null);
 }
		public override void Reset()
		{
			ResourceFlowType = GAResourceFlowType.Source;
			ResourceCurrency = new FsmString() { UseVariable = false };
			Amount = new FsmFloat() { UseVariable = false };
			ItemType = new FsmString() { UseVariable = false };
			ItemID = new FsmString() { UseVariable = false };
		}
Exemplo n.º 3
0
 /// <summary>
 /// Analyze your in-game economy (virtual currencies). You will be able to see the flow (sink/source) for each virtual currency.
 /// </summary>
 /// <param name="flowType">Add or substract resource.</param>
 /// <param name="currency">One of the available currencies set in Settings (Setup tab).</param>
 /// <param name="amount">Amount sourced or sinked.</param>
 /// <param name="itemType">One of the available currencies set in Settings (Setup tab).</param>
 /// <param name="itemId">Item id (string max length=16).</param>
 public static void NewResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
 {
     if (!GameAnalytics._hasInitializeBeenCalled)
     {
         Debug.LogWarning("GameAnalytics: REMEMBER THE SDK NEEDS TO BE MANUALLY INITIALIZED NOW");
     }
     GA_Resource.NewEvent(flowType, currency, amount, itemType, itemId);
 }
Exemplo n.º 4
0
 public static bool ValidateResourceEvent(
     GAResourceFlowType flowType,
     string currency,
     float amount,
     string itemType,
     string itemId)
 {
     if (string.IsNullOrEmpty(currency))
     {
         Debug.Log((object)"Validation fail - resource event - currency: Cannot be (null)");
         return(false);
     }
     if (flowType == GAResourceFlowType.Undefined)
     {
         Debug.Log((object)"Validation fail - resource event - flowType: Invalid flowType");
     }
     if (!GAState.HasAvailableResourceCurrency(currency))
     {
         Debug.Log((object)("Validation fail - resource event - currency: Not found in list of pre-defined resource currencies. String: " + currency));
         return(false);
     }
     if ((double)amount <= 0.0)
     {
         Debug.Log((object)("Validation fail - resource event - amount: Float amount cannot be 0 or negative. Value: " + (object)amount));
         return(false);
     }
     if (string.IsNullOrEmpty(itemType))
     {
         Debug.Log((object)"Validation fail - resource event - itemType: Cannot be (null)");
         return(false);
     }
     if (!GAValidator.ValidateEventPartLength(itemType, false))
     {
         Debug.Log((object)("Validation fail - resource event - itemType: Cannot be (null), empty or above 64 characters. String: " + itemType));
         return(false);
     }
     if (!GAValidator.ValidateEventPartCharacters(itemType))
     {
         Debug.Log((object)("Validation fail - resource event - itemType: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + itemType));
         return(false);
     }
     if (!GAState.HasAvailableResourceItemType(itemType))
     {
         Debug.Log((object)("Validation fail - resource event - itemType: Not found in list of pre-defined available resource itemTypes. String: " + itemType));
         return(false);
     }
     if (!GAValidator.ValidateEventPartLength(itemId, false))
     {
         Debug.Log((object)("Validation fail - resource event - itemId: Cannot be (null), empty or above 64 characters. String: " + itemId));
         return(false);
     }
     if (GAValidator.ValidateEventPartCharacters(itemId))
     {
         return(true);
     }
     Debug.Log((object)("Validation fail - resource event - itemId: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: " + itemId));
     return(false);
 }
Exemplo n.º 5
0
 public CurrencyEvent(GAResourceFlowType flowType, CurrencyType currencyType, CurrencyEventType currencyEventType, ProgressionInfo progressionInfo)
 {
     Assert.IsNotNull(progressionInfo);
     Assert.IsTrue(flowType != GAResourceFlowType.Undefined);
     this.flowType          = flowType;
     this.currencyType      = currencyType;
     this.currencyEventType = currencyEventType;
     eventItemId            = progressionInfo.progressionName;
 }
Exemplo n.º 6
0
 public CurrencyEvent(GAResourceFlowType flowType, CurrencyType currencyType, CurrencyEventType currencyEventType, MachineInfo machineInfo)
 {
     Assert.IsNotNull(machineInfo);
     Assert.IsTrue(flowType != GAResourceFlowType.Undefined);
     this.flowType          = flowType;
     this.currencyType      = currencyType;
     this.currencyEventType = currencyEventType;
     eventItemId            = machineInfo.machineName;
 }
Exemplo n.º 7
0
 public CurrencyEvent(GAResourceFlowType flowType, CurrencyType currencyType, CurrencyEventType currencyEventType, string eventItemId)
 {
     Assert.IsNotNull(eventItemId);
     Assert.IsTrue(flowType != GAResourceFlowType.Undefined);
     this.flowType          = flowType;
     this.currencyType      = currencyType;
     this.currencyEventType = currencyEventType;
     this.eventItemId       = eventItemId;
 }
Exemplo n.º 8
0
 public CurrencyEvent(GAResourceFlowType flowType, CurrencyType currencyType, CurrencyEventType currencyEventType, ItemInfo itemInfo)
 {
     Assert.IsNotNull(itemInfo);
     Assert.IsTrue(flowType != GAResourceFlowType.Undefined);
     this.flowType          = flowType;
     this.currencyType      = currencyType;
     this.currencyEventType = currencyEventType;
     eventItemId            = itemInfo.itemName;
 }
Exemplo n.º 9
0
 public static void NewEvent(
     GAResourceFlowType flowType,
     string currency,
     float amount,
     string itemType,
     string itemId,
     IDictionary <string, object> fields)
 {
     GA_Wrapper.AddResourceEvent(flowType, currency, amount, itemType, itemId, fields);
 }
Exemplo n.º 10
0
 public static void NewResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
 {
     if (!_hasInitializeBeenCalled)
     {
         UnityEngine.Debug.LogError("GameAnalytics: REMEMBER THE SDK NEEDS TO BE MANUALLY INITIALIZED NOW");
     }
     else
     {
         GA_Resource.NewEvent(flowType, currency, amount, itemType, itemId, null);
     }
 }
Exemplo n.º 11
0
        public static void AddResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
        {
#if UNITY_EDITOR
            if (GameAnalyticsSDK.Validators.GAValidator.ValidateResourceEvent(flowType, currency, amount, itemType, itemId))
            {
                addResourceEvent((int)flowType, currency, amount, itemType, itemId);
            }
#else
            addResourceEvent((int)flowType, currency, amount, itemType, itemId);
#endif
        }
Exemplo n.º 12
0
        public static void AddResourceEvent(
            GAResourceFlowType flowType,
            string currency,
            float amount,
            string itemType,
            string itemId,
            IDictionary <string, object> fields)
        {
            string jsonString = GA_Wrapper.DictionaryToJsonString(fields);

            GA_Wrapper.addResourceEvent((int)flowType, currency, amount, itemType, itemId, jsonString);
        }
Exemplo n.º 13
0
        public static void AddResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId, IDictionary <string, object> fields)
        {
            string fieldsAsString = DictionaryToJsonString(fields);

#if UNITY_EDITOR
            if (GameAnalyticsSDK.Validators.GAValidator.ValidateResourceEvent(flowType, currency, amount, itemType, itemId))
            {
                addResourceEvent((int)flowType, currency, amount, itemType, itemId, fieldsAsString);
            }
#else
            addResourceEvent((int)flowType, currency, amount, itemType, itemId, fieldsAsString);
#endif
        }
Exemplo n.º 14
0
 /// <summary>
 /// Analyze your in-game economy (virtual currencies). You will be able to see the flow (sink/source) for each virtual currency.
 /// </summary>
 /// <param name="flowType">Add or substract resource.</param>
 /// <param name="currency">One of the available currencies set in Settings (Setup tab).</param>
 /// <param name="amount">Amount sourced or sinked.</param>
 /// <param name="itemType">One of the available currencies set in Settings (Setup tab).</param>
 /// <param name="itemId">Item id (string max length=16).</param>
 public static void NewResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
 {
     GA_Resource.NewEvent(flowType, currency, amount, itemType, itemId);
 }
Exemplo n.º 15
0
        public static void AddResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId, IDictionary <string, object> fields)
        {
            string fields2 = DictionaryToJsonString(fields);

            addResourceEvent((int)flowType, currency, amount, itemType, itemId, fields2);
        }
Exemplo n.º 16
0
 public static void TrackVirtualEconomy(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
 {
     GameAnalytics.NewResourceEvent(flowType, currency, amount, itemType, itemId);
 }
Exemplo n.º 17
0
 public static void NewEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
 {
     GA_Wrapper.AddResourceEvent(flowType, currency, amount, itemType, itemId);
 }
Exemplo n.º 18
0
 public static void AddResourceEvent(GAResourceFlowType flowType, string currency, float amount, string itemType, string itemId)
 {
     addResourceEvent((int)flowType, currency, amount, itemType, itemId);
 }