| | |
| | | /// <param name="baseCdnUrl">基础 CDN 地址(如 https://cdn.example.com)</param> |
| | | /// <param name="fallbackCdnUrl">备用 CDN 地址(可选,默认同 baseCdnUrl)</param> |
| | | /// <returns>平台对应的 RemoteServicesImpl 实例</returns> |
| | | public static RemoteServicesImpl CreateForCurrentPlatform(string baseCdnUrl, string fallbackCdnUrl = null) |
| | | { |
| | | fallbackCdnUrl = fallbackCdnUrl ?? baseCdnUrl; |
| | | // public static RemoteServicesImpl CreateForCurrentPlatform(string baseCdnUrl, string fallbackCdnUrl = null) |
| | | // { |
| | | // fallbackCdnUrl = fallbackCdnUrl ?? baseCdnUrl; |
| | | |
| | | var platform = PlatformFactory.GetCurrent(); |
| | | var platformType = platform.GetPlatformType(); |
| | | // var platform = PlatformFactory.GetCurrent(); |
| | | // var platformType = platform.GetPlatformType(); |
| | | |
| | | // 按平台类型路由子路径 |
| | | string platformPath = GetPlatformCdnPath(platformType); |
| | | // // 按平台类型路由子路径 |
| | | // string platformPath = GetPlatformCdnPath(platformType); |
| | | |
| | | string mainUrl = $"{baseCdnUrl}/{platformPath}"; |
| | | string fallbackUrl = $"{fallbackCdnUrl}/{platformPath}"; |
| | | // string mainUrl = $"{baseCdnUrl}/{platformPath}"; |
| | | // string fallbackUrl = $"{fallbackCdnUrl}/{platformPath}"; |
| | | |
| | | UnityEngine.Debug.Log($"[RemoteServicesImpl] Platform={platformType}, CDN={mainUrl}"); |
| | | return new RemoteServicesImpl(mainUrl, fallbackUrl); |
| | | } |
| | | // UnityEngine.Debug.Log($"[RemoteServicesImpl] Platform={platformType}, CDN={mainUrl}"); |
| | | // return new RemoteServicesImpl(mainUrl, fallbackUrl); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 获取平台对应的 CDN 子路径。 |