189 lines
4.7 KiB
C#
189 lines
4.7 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using PhxhSDK;
|
|
using PhxhSDK.AOT.VersionUpdate;
|
|
#if UNITY_EDITOR
|
|
using UnityEditor;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// BI事件 用于本地缓存一次性事件
|
|
/// </summary>
|
|
public class StorageEvent
|
|
{
|
|
public List<string> EventList { get; set; }
|
|
|
|
public StorageEvent()
|
|
{
|
|
EventList = new List<string>();
|
|
}
|
|
|
|
public StorageEvent(List<string> eventStringList)
|
|
{
|
|
EventList = eventStringList;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// BI 需要上报的关卡内信息
|
|
/// </summary>
|
|
public class BIBaseInfo
|
|
{
|
|
/// <summary>
|
|
/// 游戏ID
|
|
/// </summary>
|
|
public string app_name;
|
|
|
|
/// <summary>
|
|
/// 渠道
|
|
/// </summary>
|
|
public string channel;
|
|
|
|
/// <summary>
|
|
/// 设备型号
|
|
/// </summary>
|
|
public string model;
|
|
|
|
/// <summary>
|
|
/// 设备ID
|
|
/// </summary>
|
|
public string uuid;
|
|
|
|
/// <summary>
|
|
/// 分辨率
|
|
/// </summary>
|
|
public string resolution;
|
|
|
|
/// <summary>
|
|
/// 操作系统 安卓 ios
|
|
/// </summary>
|
|
public string platform;
|
|
|
|
/// <summary>
|
|
/// 操作系统
|
|
/// </summary>
|
|
public string os;
|
|
|
|
/// <summary>
|
|
/// 系统内存 单位MB
|
|
/// </summary>
|
|
public string storage_info;
|
|
|
|
/// <summary>
|
|
/// CPU型号
|
|
/// </summary>
|
|
public string cpu;
|
|
|
|
/// <summary>
|
|
/// 客户端版本
|
|
/// </summary>
|
|
public string version;
|
|
|
|
/// <summary>
|
|
/// build code
|
|
/// </summary>
|
|
public string build_code;
|
|
|
|
/// <summary>
|
|
/// 资源版本
|
|
/// </summary>
|
|
public string assets_version;
|
|
|
|
/// <summary>
|
|
/// 游戏语言
|
|
/// </summary>
|
|
public string language;
|
|
|
|
/// <summary>
|
|
/// 地区信息
|
|
/// </summary>
|
|
public string region;
|
|
|
|
/// <summary>
|
|
/// 玩家id
|
|
/// </summary>
|
|
public string actor_id;
|
|
|
|
/// <summary>
|
|
/// 第三方账号源
|
|
/// </summary>
|
|
public string third_platform;
|
|
|
|
/// <summary>
|
|
/// 第三方id
|
|
/// </summary>
|
|
public string third_id;
|
|
|
|
public BIBaseInfo()
|
|
{
|
|
app_name = "nld";
|
|
channel = PackDataInst.Inst.localInfo.workSpace;
|
|
model = SystemInfo.deviceModel;
|
|
uuid = SystemInfo.deviceUniqueIdentifier;
|
|
resolution = Screen.width + "x" + Screen.height;
|
|
|
|
#if UNITY_EDITOR
|
|
if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android)
|
|
platform = "Android";
|
|
else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS)
|
|
platform = "iOS";
|
|
else
|
|
platform = "Editor";
|
|
#else
|
|
platform = Application.platform == RuntimePlatform.Android ? "Android" :
|
|
Application.platform == RuntimePlatform.IPhonePlayer ? "iOS" : "Other";
|
|
#endif
|
|
|
|
os = SystemInfo.operatingSystem;
|
|
storage_info = SystemInfo.systemMemorySize.ToString();
|
|
cpu = SystemInfo.processorType;
|
|
version = Application.version;
|
|
build_code = PackDataInst.Inst.localInfo.buildCode;
|
|
assets_version = PackDataInst.Inst.localInfo.localFullVersion;
|
|
if (LanguageManager.CurLanguage != LanguageManager.LanguageType.Default)
|
|
language = LanguageManager.CurLanguage.ToString();
|
|
else
|
|
language = Application.systemLanguage.ToString();
|
|
|
|
// 新增地区信息获取
|
|
region = Application.systemLanguage.ToString();
|
|
}
|
|
|
|
public void SetUserInfo()
|
|
{
|
|
actor_id = SDKManager.Instance.ApplicationUserID;
|
|
third_platform = SDKManager.Instance.ThirdPartyPlatform;
|
|
third_id = SDKManager.Instance.ThirdPartyUserID;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 打印所有属性值到控制台
|
|
/// </summary>
|
|
public void PrintAllBeforeLoginValues()
|
|
{
|
|
Debug.Log("===== BIBaseInfo 登陆前所有属性值 =====");
|
|
Debug.Log($"app_name: {app_name}");
|
|
Debug.Log($"channel: {channel}");
|
|
Debug.Log($"model: {model}");
|
|
Debug.Log($"uuid: {uuid}");
|
|
Debug.Log($"resolution: {resolution}");
|
|
Debug.Log($"platform: {platform}");
|
|
Debug.Log($"os: {os}");
|
|
Debug.Log($"version: {version}");
|
|
Debug.Log($"build_code: {build_code}");
|
|
Debug.Log($"assets_version: {assets_version}");
|
|
Debug.Log($"language: {language}");
|
|
Debug.Log($"storage_info: {storage_info}");
|
|
Debug.Log($"cpu: {cpu}");
|
|
Debug.Log("================================");
|
|
}
|
|
|
|
public void PrintAllAfterLoginValues()
|
|
{
|
|
Debug.Log("===== BIBaseInfo 登陆后所有属性值 =====");
|
|
Debug.Log($"actor_id: {actor_id}");
|
|
Debug.Log($"third_platform: {third_platform}");
|
|
Debug.Log($"third_id: {third_id}");
|
|
Debug.Log("================================");
|
|
}
|
|
} |