namespace HC { public class HCWebGLSDKManager : HCSingleton { public static HCIAccount Account { get { #if WEBGL_WX && !UNITY_EDITOR return new HCWXAccount(); #elif WEBGL_BYTEDANCE return new HCBytedanceAccount(); #else return new HCAccount(); #endif } } public static HCIAds Ads { get { #if WEBGL_WX && !UNITY_EDITOR return HCWXAds.Instance; #elif WEBGL_BYTEDANCE return HCBytedanceAds.Instance; #else return new HCAds(); #endif } } public static HCIAnalytics Analytics { get { #if WEBGL_WX && !UNITY_EDITOR return new HCWXAnalytics(); #elif WEBGL_BYTEDANCE return new HCBytedanceAnalytics(); #else return new HCDefaultAnalytics(); #endif } } private static HCIAppInfo _AppInfo; public static HCIAppInfo AppInfo { get { if (_AppInfo == null) { #if WEBGL_WX && !UNITY_EDITOR _AppInfo = new HCWXAppInfo(); #elif WEBGL_BYTEDANCE _AppInfo = new HCBytedanceAppInfo(); #else _AppInfo = new HCAppInfo(); #endif } return _AppInfo; } } public static HCIShare Share { get { #if WEBGL_WX && !UNITY_EDITOR return new HCWXShare(); #elif WEBGL_BYTEDANCE return new HCBytedanceShare(); #else return new HCShare(); #endif } } public static HCIBase Base { get { #if WEBGL_WX && !UNITY_EDITOR return HCWXBase.Instance; #elif WEBGL_BYTEDANCE return new HCBytedanceBase(); #else return new HCBase(); #endif } } public static HCIPurchase Purchase { get { #if WEBGL_WX && !UNITY_EDITOR return HCWxPurchase.Instance; #elif WEBGL_BYTEDANCE return new HCBytedancePurchase(); #else return new HCPurchase(); #endif } } protected override void OnInstanceCreate() { base.OnInstanceCreate(); Purchase.Init(); // 先屏蔽掉,后续还需要统一 #if WEBGL_WX var hcWxTools = HCWxTools.Instance; #endif var hciShare = Share; } } }