public static string Get(AcquisitionType acquisitionType) { if (AcquisitionTypeCache.TryGetValue(acquisitionType, out string enumString) == false) { enumString = acquisitionType.ToString(); AcquisitionTypeCache.Add(acquisitionType, enumString); } return(enumString); }
public static AnalyticsResult ItemSpent(AcquisitionType currencyType, string transactionContext, float amount, string itemId, string itemType = null, string level = null, string transactionId = null, IDictionary <string, object> eventData = null) { AnalyticsEvent.m_EventData.Clear(); AnalyticsEvent.m_EventData.Add("currency_type", AnalyticsEvent.RenameEnum(currencyType.ToString())); if (string.IsNullOrEmpty(transactionContext)) { throw new ArgumentException(transactionContext); } AnalyticsEvent.m_EventData.Add("transaction_context", transactionContext); AnalyticsEvent.m_EventData.Add("amount", amount); if (string.IsNullOrEmpty(itemId)) { throw new ArgumentException(itemId); } AnalyticsEvent.m_EventData.Add("item_id", itemId); if (!string.IsNullOrEmpty(itemType)) { AnalyticsEvent.m_EventData.Add("item_type", itemType); } if (!string.IsNullOrEmpty(level)) { AnalyticsEvent.m_EventData.Add("level", level); } if (!string.IsNullOrEmpty(transactionId)) { AnalyticsEvent.m_EventData.Add("transaction_id", transactionId); } AnalyticsEvent.AddCustomEventData(eventData); return(AnalyticsEvent.Custom("item_spent", AnalyticsEvent.m_EventData)); }