scripts
This commit is contained in:
@@ -0,0 +1,258 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UnityEngine.Analytics
|
||||
{
|
||||
// Token: 0x020002D9 RID: 729
|
||||
public static class Analytics
|
||||
{
|
||||
// Token: 0x06003023 RID: 12323 RVA: 0x000465E4 File Offset: 0x000447E4
|
||||
internal static UnityAnalyticsHandler GetUnityAnalyticsHandler()
|
||||
{
|
||||
if (Analytics.s_UnityAnalyticsHandler == null)
|
||||
{
|
||||
Analytics.s_UnityAnalyticsHandler = new UnityAnalyticsHandler();
|
||||
}
|
||||
return Analytics.s_UnityAnalyticsHandler;
|
||||
}
|
||||
|
||||
// Token: 0x17000AEF RID: 2799
|
||||
// (get) Token: 0x06003024 RID: 12324 RVA: 0x00046614 File Offset: 0x00044814
|
||||
// (set) Token: 0x06003025 RID: 12325 RVA: 0x00046630 File Offset: 0x00044830
|
||||
public static bool limitUserTracking
|
||||
{
|
||||
get
|
||||
{
|
||||
return UnityAnalyticsHandler.limitUserTracking;
|
||||
}
|
||||
set
|
||||
{
|
||||
UnityAnalyticsHandler.limitUserTracking = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AF0 RID: 2800
|
||||
// (get) Token: 0x06003026 RID: 12326 RVA: 0x0004663C File Offset: 0x0004483C
|
||||
// (set) Token: 0x06003027 RID: 12327 RVA: 0x00046658 File Offset: 0x00044858
|
||||
public static bool deviceStatsEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return UnityAnalyticsHandler.deviceStatsEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
UnityAnalyticsHandler.deviceStatsEnabled = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AF1 RID: 2801
|
||||
// (get) Token: 0x06003028 RID: 12328 RVA: 0x00046664 File Offset: 0x00044864
|
||||
// (set) Token: 0x06003029 RID: 12329 RVA: 0x00046694 File Offset: 0x00044894
|
||||
public static bool enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
return unityAnalyticsHandler != null && unityAnalyticsHandler.enabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
if (unityAnalyticsHandler != null)
|
||||
{
|
||||
unityAnalyticsHandler.enabled = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600302A RID: 12330 RVA: 0x000466B8 File Offset: 0x000448B8
|
||||
public static AnalyticsResult FlushEvents()
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.FlushEvents();
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x0600302B RID: 12331 RVA: 0x000466E8 File Offset: 0x000448E8
|
||||
public static AnalyticsResult SetUserId(string userId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(userId))
|
||||
{
|
||||
throw new ArgumentException("Cannot set userId to an empty or null string");
|
||||
}
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.SetUserId(userId);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x0600302C RID: 12332 RVA: 0x00046730 File Offset: 0x00044930
|
||||
public static AnalyticsResult SetUserGender(Gender gender)
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.SetUserGender(gender);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x0600302D RID: 12333 RVA: 0x00046760 File Offset: 0x00044960
|
||||
public static AnalyticsResult SetUserBirthYear(int birthYear)
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (Analytics.s_UnityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.SetUserBirthYear(birthYear);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x0600302E RID: 12334 RVA: 0x00046794 File Offset: 0x00044994
|
||||
public static AnalyticsResult Transaction(string productId, decimal amount, string currency)
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, null, null);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x0600302F RID: 12335 RVA: 0x000467CC File Offset: 0x000449CC
|
||||
public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature)
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x06003030 RID: 12336 RVA: 0x00046808 File Offset: 0x00044A08
|
||||
public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature, bool usingIAPService)
|
||||
{
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature, usingIAPService);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x06003031 RID: 12337 RVA: 0x00046844 File Offset: 0x00044A44
|
||||
public static AnalyticsResult CustomEvent(string customEventName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(customEventName))
|
||||
{
|
||||
throw new ArgumentException("Cannot set custom event name to an empty or null string");
|
||||
}
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.CustomEvent(customEventName);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x06003032 RID: 12338 RVA: 0x0004688C File Offset: 0x00044A8C
|
||||
public static AnalyticsResult CustomEvent(string customEventName, Vector3 position)
|
||||
{
|
||||
if (string.IsNullOrEmpty(customEventName))
|
||||
{
|
||||
throw new ArgumentException("Cannot set custom event name to an empty or null string");
|
||||
}
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
CustomEventData customEventData = new CustomEventData(customEventName);
|
||||
customEventData.Add("x", (double)Convert.ToDecimal(position.x));
|
||||
customEventData.Add("y", (double)Convert.ToDecimal(position.y));
|
||||
customEventData.Add("z", (double)Convert.ToDecimal(position.z));
|
||||
analyticsResult = unityAnalyticsHandler.CustomEvent(customEventData);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x06003033 RID: 12339 RVA: 0x00046930 File Offset: 0x00044B30
|
||||
public static AnalyticsResult CustomEvent(string customEventName, IDictionary<string, object> eventData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(customEventName))
|
||||
{
|
||||
throw new ArgumentException("Cannot set custom event name to an empty or null string");
|
||||
}
|
||||
UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler();
|
||||
AnalyticsResult analyticsResult;
|
||||
if (unityAnalyticsHandler == null)
|
||||
{
|
||||
analyticsResult = AnalyticsResult.NotInitialized;
|
||||
}
|
||||
else if (eventData == null)
|
||||
{
|
||||
analyticsResult = unityAnalyticsHandler.CustomEvent(customEventName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CustomEventData customEventData = new CustomEventData(customEventName);
|
||||
customEventData.Add(eventData);
|
||||
analyticsResult = unityAnalyticsHandler.CustomEvent(customEventData);
|
||||
}
|
||||
return analyticsResult;
|
||||
}
|
||||
|
||||
// Token: 0x0400098D RID: 2445
|
||||
private static UnityAnalyticsHandler s_UnityAnalyticsHandler;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user