135 lines
No EOL
3.8 KiB
C#
135 lines
No EOL
3.8 KiB
C#
using System;
|
|
|
|
namespace ShiroginSDK.Runtime.Modules.Events
|
|
{
|
|
public static partial class ShiroginEvents
|
|
{
|
|
public static class Analytics
|
|
{
|
|
[Serializable]
|
|
public class SessionStartedEvent
|
|
{
|
|
public string PlayerId;
|
|
public DateTime StartTime;
|
|
|
|
public SessionStartedEvent(string playerId, DateTime start)
|
|
{
|
|
PlayerId = playerId;
|
|
StartTime = start;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class SessionEndedEvent
|
|
{
|
|
public string PlayerId;
|
|
public float Duration;
|
|
public DateTime EndTime;
|
|
|
|
public SessionEndedEvent(string playerId, DateTime end, float duration)
|
|
{
|
|
PlayerId = playerId;
|
|
EndTime = end;
|
|
Duration = duration;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class AppOpenedEvent
|
|
{
|
|
public string Version;
|
|
public string Locale;
|
|
public DateTime Time;
|
|
|
|
public AppOpenedEvent(string version, string locale, DateTime time)
|
|
{
|
|
Version = version;
|
|
Locale = locale;
|
|
Time = time;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class AppClosedEvent
|
|
{
|
|
public string Version;
|
|
public float SessionDuration;
|
|
|
|
public AppClosedEvent(string version, float duration)
|
|
{
|
|
Version = version;
|
|
SessionDuration = duration;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class DeviceInfoCollectedEvent
|
|
{
|
|
public string DeviceModel;
|
|
public string OSVersion;
|
|
public string Locale;
|
|
|
|
public DeviceInfoCollectedEvent(string model, string os, string locale)
|
|
{
|
|
DeviceModel = model;
|
|
OSVersion = os;
|
|
Locale = locale;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class PermissionChangedEvent
|
|
{
|
|
public string PermissionName;
|
|
public bool Granted;
|
|
|
|
public PermissionChangedEvent(string name, bool granted)
|
|
{
|
|
PermissionName = name;
|
|
Granted = granted;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class ScreenViewedEvent
|
|
{
|
|
public string ScreenName;
|
|
public float TimeSpent;
|
|
|
|
public ScreenViewedEvent(string name, float timeSpent = 0)
|
|
{
|
|
ScreenName = name;
|
|
TimeSpent = timeSpent;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class ErrorLoggedEvent
|
|
{
|
|
public string ErrorMessage;
|
|
public string StackTrace;
|
|
public string Context;
|
|
|
|
public ErrorLoggedEvent(string message, string stack, string context = "")
|
|
{
|
|
ErrorMessage = message;
|
|
StackTrace = stack;
|
|
Context = context;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CustomAnalyticsEvent
|
|
{
|
|
public string EventName;
|
|
public object Data;
|
|
|
|
public CustomAnalyticsEvent(string eventName, object data = null)
|
|
{
|
|
EventName = eventName;
|
|
Data = data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |