using System; using UnityEngine; /// /// 广告类型枚举 /// public enum AdType { /// 视频广告(激励视频) Video, /// 横幅广告 Banner, /// 插屏广告 Interstitial } /// /// 震动类型枚举 /// public enum VibrationType { /// 轻量震动(15ms) Light, /// 中等震动(30ms) Medium, /// 重量震动(50ms) Heavy } /// /// 登录结果 /// [Serializable] public class LoginResult { /// 登录是否成功 public bool Success; /// 用户ID(平台唯一标识) public string UserId; /// 用户昵称 public string Nickname; /// 用户头像URL public string AvatarUrl; /// 错误消息(如果失败) public string ErrorMessage; } /// /// 分享数据 /// [Serializable] public class ShareData { /// 分享标题 public string Title; /// 分享描述 public string Description; /// 分享图片URL public string ImageUrl; /// 分享页面路径(可选) public string PagePath; } /// /// 广告结果 /// [Serializable] public class AdResult { /// 广告是否成功展示 public bool Success; /// 用户是否看完广告(针对激励视频) public bool Completed; /// 错误消息(如果失败) public string ErrorMessage; } /// /// 系统信息 /// [Serializable] public class SystemInfo { /// 设备型号 public string DeviceModel; /// 系统版本 public string SystemVersion; /// 平台版本(如微信版本) public string PlatformVersion; /// 屏幕宽度(像素) public int ScreenWidth; /// 屏幕高度(像素) public int ScreenHeight; /// 安全区域 public SafeAreaData SafeArea; /// 设备像素比 public float PixelRatio; } /// /// 安全区域数据 /// [Serializable] public class SafeAreaData { public float Left; public float Top; public float Right; public float Bottom; public float Width; public float Height; /// /// 从Unity Screen.safeArea创建 /// public static SafeAreaData FromRect(Rect safeArea) { return new SafeAreaData { Left = safeArea.x, Top = safeArea.y, Right = safeArea.x + safeArea.width, Bottom = safeArea.y + safeArea.height, Width = safeArea.width, Height = safeArea.height }; } }