diff --git a/Assets/TKGSDK/Common/GameInterface/TKGSDKManager.cs b/Assets/TKGSDK/Common/GameInterface/TKGSDKManager.cs index d7a2dd14..8976c9e3 100644 --- a/Assets/TKGSDK/Common/GameInterface/TKGSDKManager.cs +++ b/Assets/TKGSDK/Common/GameInterface/TKGSDKManager.cs @@ -3,11 +3,14 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using Touka; + +#if H5_WX using WeChatWASM; +#endif public class TKGSDKManager : TKGSingleton { - #region webgl +#region webgl //static string cdnPath = "https://touka-pkg.oss-cn-beijing.aliyuncs.com/Temp/chicken_webgl/"; // Appid: wx1a9ad77bb8f3b66a static string cdnPath = "https://touka-artifacts.oss-cn-beijing.aliyuncs.com/WXResource/Chicken_WebGL/"; // Appid: wxb8f1bd49ef160a9a @@ -24,7 +27,7 @@ public class TKGSDKManager : TKGSingleton "这奇葩结局,必须要跟你分享一下!", "这声音,建议躲在被窝里玩"}; - #endregion +#endregion public bool IsNoAllAD { @@ -147,7 +150,7 @@ public class TKGSDKManager : TKGSingleton m_sdkInterface.SetLogEnable(_enable); } - #region Ads +#region Ads // 去广告接口调用 public void PurchasedRemoveAds() { @@ -589,9 +592,9 @@ public class TKGSDKManager : TKGSingleton m_sdkInterface.RemoveNotification(notiId); } - #endregion +#endregion - #region others +#region others /// /// Set user source listener @@ -612,9 +615,9 @@ public class TKGSDKManager : TKGSingleton m_sdkInterface.SetTKGCommonCallback(_commonCallbackAction); } - #endregion +#endregion - #region h5 +#region h5 public enum WayOfReward @@ -670,16 +673,20 @@ public class TKGSDKManager : TKGSingleton public void ShowShareMenu() { +#if H5_WX ShowShareMenuOption ssmo = new ShowShareMenuOption(); ssmo.menus = new string[] { "shareAppMessage", "shareTimeline" }; WX.ShowShareMenu(ssmo); +#endif } public void HideShareMenu() { +#if H5_WX HideShareMenuOption hsmo = new HideShareMenuOption(); hsmo.menus = new string[] { "shareAppMessage", "shareTimeline" }; WX.HideShareMenu(hsmo); +#endif } /// @@ -687,12 +694,14 @@ public class TKGSDKManager : TKGSingleton /// public void ShareAppMessageOriginImg() { +#if H5_WX ShareAppMessageOption samo = new ShareAppMessageOption(); int tipIndex = GetRandomIndex(); samo.title = GetRandomShareTips(tipIndex); //samo.imageUrlId = "这是图片路径ID"; //samo.path ="独立分包路径"; WX.ShareAppMessage(samo); +#endif } /// @@ -700,6 +709,7 @@ public class TKGSDKManager : TKGSingleton /// public void ShareAppMessageFixedImg() { +#if H5_WX ShareAppMessageOption samo = new ShareAppMessageOption(); int tipIndex = GetRandomIndex(); @@ -709,6 +719,7 @@ public class TKGSDKManager : TKGSingleton //samo.imageUrlId = "这是图片路径ID"; //samo.path ="独立分包路径"; WX.ShareAppMessage(samo); +#endif } /// @@ -732,9 +743,11 @@ public class TKGSDKManager : TKGSingleton public void ShowShareImageMenu() { +#if H5_WX ShowShareImageMenuOption ssimo = new ShowShareImageMenuOption(); ssimo.path = "Share.png"; WX.ShowShareImageMenu(ssimo); +#endif } #endregion diff --git a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceWebgl.cs b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceWebgl.cs index 5f04bc74..d19dc35e 100644 --- a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceWebgl.cs +++ b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceWebgl.cs @@ -4,7 +4,10 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; + +#if H5_WX using WeChatWASM; +#endif namespace Touka { @@ -16,10 +19,12 @@ namespace Touka private AndroidJavaObject jo; +#if H5_WX private WXBannerAd bannerAd; private WXInterstitialAd interstitialAd; private WXRewardedVideoAd rewardAd; private WeChatWASM.SystemInfo sysInfo; +#endif public TKGNativeInterfaceWebgl() { @@ -44,10 +49,12 @@ namespace Touka SetSDKCommonCallback(new AndroidTKGCommonCalllback()); TKGDebugger.LogDebug("init ----- 01 ------- d"); +#if H5_WX WXBase.InitSDK((_code) => { _initCallback(); initAds(); }); +#endif TKGDebugger.LogDebug("init ----- 02"); } @@ -88,6 +95,7 @@ namespace Touka private void initBanner() { +#if H5_WX Debug.Log("tkg native webgl initBanner -----"); sysInfo = WX.GetSystemInfoSync(); bannerAd = WX.CreateBannerAd(new WXCreateBannerAdParam() @@ -115,6 +123,7 @@ namespace Touka //拉取的广告可能跟设置的不一样,需要动态调整位置 bannerAd.style.top = (int)sysInfo.windowHeight - res.height; }); +#endif } /// @@ -131,12 +140,12 @@ namespace Touka //{ // _posIndex = 1; - //} - //else if(_pos == TKGBannerAlign.BannerCenterBottomAlign) - //{ - // _posIndex = 2; - //} - +//} +//else if(_pos == TKGBannerAlign.BannerCenterBottomAlign) +//{ +// _posIndex = 2; +//} +#if H5_WX if(bannerAd != null) { Debug.Log("tkg native webgl showBannerAd ----- 01"); @@ -146,6 +155,7 @@ namespace Touka { Debug.Log("tkg native webgl showBannerAd ----- 02"); } +#endif } /// @@ -153,19 +163,23 @@ namespace Touka /// public override void hideBannerAd() { +#if H5_WX if (bannerAd != null) { bannerAd.Hide(); } +#endif } private void initInterstitialAd() { +#if H5_WX Debug.Log("tkg native webgl initInterstitialAd -----"); interstitialAd = WX.CreateInterstitialAd(new WXCreateInterstitialAdParam() { adUnitId = "" }); +#endif } /// @@ -183,6 +197,7 @@ namespace Touka public override void showInterstitialAd(string _adPos, IVADType _IvType = IVADType.IV1) { Debug.Log("tkg native webgl showInterstitialAd -----"); +#if H5_WX if(interstitialAd != null) { Debug.Log("tkg native webgl showInterstitialAd ----- 01"); @@ -192,14 +207,17 @@ namespace Touka { Debug.Log("tkg native webgl showInterstitialAd ----- 02"); } +#endif } private void initRewardAd() { Debug.Log("tkg native webgl initRewardAd -----"); +#if H5_WX rewardAd = WX.CreateRewardedVideoAd(new WXCreateRewardedVideoAdParam() { adUnitId = "" }); +#endif } /// @@ -210,6 +228,7 @@ namespace Touka public override void showRewardAd(string _adPos, int _itemCount = -1) { Debug.Log("tkg native webgl showRewardAd -----"); +#if H5_WX if (rewardAd != null) { Debug.Log("tkg native webgl showRewardAd ----- 01"); @@ -219,6 +238,7 @@ namespace Touka { Debug.Log("tkg native webgl showRewardAd ----- 02"); } +#endif } /// @@ -268,10 +288,10 @@ namespace Touka SDKCall("hideNative"); #endif } - #endregion +#endregion - #region Ads isready +#region Ads isready /// /// banner isReady diff --git a/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset b/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset index e331e7e5..d9334555 100644 --- a/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset +++ b/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset @@ -33,7 +33,6 @@ MonoBehaviour: - StompyRobot.SRF - StompyRobot.SRDebugger - PsdPlugin - - Mischief.MDV.Editor - StompyRobot.SRF.Editor - StompyRobot.SRDebugger.Editor showAdvancedSettings: 0 diff --git a/Assets/WX-WASM-SDK.meta b/Assets/WX-WASM-SDK.meta deleted file mode 100644 index cbe896c7..00000000 --- a/Assets/WX-WASM-SDK.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bab620ecf43334dba8ff8df1de83bcf6 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/CHANGELOG.md b/Assets/WX-WASM-SDK/CHANGELOG.md deleted file mode 100644 index 9abd4ae9..00000000 --- a/Assets/WX-WASM-SDK/CHANGELOG.md +++ /dev/null @@ -1,445 +0,0 @@ - -## 2022-7-28 -### Feature -* 增加UDP接口能力 -## 2022-7-20 -### Feature -* 增加重启小游戏的API支持 -### Fixed -* 纹理压缩并行下载完成未正常显示 -### Added -* 设置启动时是否自动检查小游戏版本更新 -## 2022-7-14 -### Fixed -* 转换面板的最大内存提示与指引优化 -* WebGL导出失败时不进行小游戏转换 -* 非playing状态调用WX接口的告警提示 -## 2022-7-1 -### Fixed -* 开发阶段没显示耗时弹框 -* 21.3unity服务器错误且无跨域头导致报错 -## 2022-6-30 -### Fixed -* 压缩纹理工具逻辑异常,增加进度条 -* 完善限帧率接口SetPreferredFramesPerSecond - -## 2022-6-28 -### Feature -* 导出插件的brotli压缩不依赖python环境 -### Fixed -* 压缩纹理工具独立命名,避免有NuGet产生dll冲突 - -## 2022-6-18 -### Fixed -* 小游戏模板错误 -## 2022-6-16 -### Added -* 支持自定义可缓存文件及可清理文件 -* 优化缓存目录统计 - -### Fixed -* 21.3unity在iOS上网络报错 -## 2022-6-13 -### Fixed -* `RemoveFile`参数转字符串 -* 8.0.16安卓worker写文件报错 -## 2022-6-8 -### Added -* 提供Loader启动数据 - -### Fixed -* 修复是否需要下载代码包上报 -* 21.3版本Unity webrequest设置请求头;注册进度事件 -## 2022-6-7 -### Added -* 增加MemoryProfiler,开发阶段分析内存 - -## 2022-6-1 -### Added -* 使用worker做文件写入临时绕过安卓文件写入多时造成卡顿 -## 2022-5-31 -### Added -* 暴露插件进度事件 -## 2022-5-30 -### Fixed -* pc小游戏首包资源通过分包加载时读取失败 -## 2022-5-26 -### Changed -* 默认关闭纹理缓存,影响安卓帧率 - -### Fixed -* 修复21.3替换规则 -## 2022-5-24 -### Added -* 增加对21.3版本unity支持 -* MiniGameConfig.asset增加不常用配置入口 -## 2022-4-29 -### Fixed -* 通过分包加载资源时读取bug - -## 2022-4-26 -### Fixed -* 带`dataFileSubPrefix`时iOS首包资源下载bug - -### Added -* 游戏异常时增加重启游戏按钮 -* 检查是否32位微信导致无法进入游戏 -* 修正URL中非法路径 -## 2022-4-24 -### Fixed -更新独立域插件版本`1.0.60` -* 达缓存上限时未正常清理旧缓存 -* 1.0.58版本插件iOS报错 -## 2022-4-22 - -### Fixed -更新独立域插件版本`1.0.58` -* 预下载问题路径bug -* 不支持webgl2时提示 -### Added -* 增加清理指定文件接口`RemoveFile` -* 是否缓存纹理开关 - -## 2022-4-18 -### Added -* 修改文件删除接口使用方法`CleanFileCache`,`CleanAllFileCache` -## 2022-4-14 -### Added -* 增加清除文件缓存接口`CleanFileCache` - -## 2022-4-11 -### Changed -* 2021版本调整为需要手动分离symbols,由于Unity自身产生的symbols存在缺失问题 -* 增加CleaStreamingAssets选项,控制是否清理webgl/StreamingAssets - -## 2022-3-29 -### Changed -* 更新插件版本为1.0.53 -* `streamingUrlSubPath`支持传自定义拼接到streamingcdn后面的路径 -* iOS不支持webgl2时提示 - -## 2022-3-22 -### Changed -* 更新压缩纹理工具使用方式 - -## 2022-3-7 -### Changed -* 更新独立域插件版本为1.0.51 -* 预载列表按照填写顺序生成 -* Unity2021不再提示分离symbols,2021.2.11以后版本已支持 -* Pointer_stringify导致的浏览器告警 - -## 2022-3-7 -### Changed -* 更新独立域插件版本为1.0.50 - -## 2022-2-17 -### Changed -* 更新独立域插件版本 -* 增加日志输出 -* 限帧时禁用后台执行Loop - -## 2022-2-15 -### Fixed -* UnityAudio循环播放修复 -* 2021版本修改为默认使用External Symbols(需升级Unity到2021.2.11以上) -* PlayerSettings默认去除"Run In Background" - -## 2022-2-14 -### Added -* 支持PC端DXT5压缩纹理 - -## 2022-2-11 -### Added -* 调整部分API -* 支持webgl2.0的压缩纹理 - -## 2022-1-26 -### Added -* 新增API -* 修复API中不确定类型的数据可能导致类型转换失败的问题 - -## 2022-1-25 -### Fixed -* 修复Login方法,默认不传timeout,默认超时为1000ms,容易失败的问题 - -## 2022-1-24 -### Added -* 兼容浏览器环境,修复部分API问题 - -## 2022-1-21 -### Added -* 新增WXCleanAllFileCache接口,用于清理所有文件缓存 - -### Changed -* 独立域插件版本更新到1.0.46,包含以下修改 -1. 自动清理存量旧文件 -2. 达到缓存上限时清理更多空间,具体值可通过minigame/unity-namespace.js中releaseMemorySize修改 -3. 上报unity版本和转换插件版本 -4. 支持以文件名全匹配的方式忽略缓存 -5. 插件错误报实时日志 -6. pc小游戏兼容 - -## 2022-1-20 - -### Added -* 新增API,旧API批量重命名,用法保持不变 - -## 2022-1-17 -### Fixed -* 同名文件缓存未清理 - -### Changed -* 版本限制条件更新 - -## 2022-1-13 -### Fixed - -* Unity Audio能力适配, 不支持设备兼容处理; 退后台暂停播放音频; 性能提升 - -## 2022-1-7 -### Fixed - -* Unity Audio能力适配 -* Unity Input Touch能力适配 - -## 2021-12-31 -### Fixed - -* 调整为默认不打开性能面板,单独提供WX.OpenProfileStats - -## 2021-12-30 - -### Fixed -* 修复引擎初始化失败后依然回调calledMainCb导致统计问题 -* 修复2021版本abort时执行WXUncaughtException -* 补充小程序框架异常时上报实时日志 - -## 2021-12-20 - -### Fixed -* 2021 dev 运行报错(randomDevices替换) -* 跳转小游戏接口错误 -* 缓存大小为0,AssetBundle重试失败问题 - -## 2021-12-16 - -### Added -* 开发、体验版本增加性能面板 - -## 2021-12-10 - -### Fixed -* 修复独立域插件未编译子包bug - -## 2021-12-06 - -### Added -* WebGL2.0 增加适配,该特性处于测试阶段 -* 2021增加embedded symbols分离 -* 增加error日志回调 - -### Fixed -* 2021 dev 运行报错 - -## 2021-12-02 - -### Fixed -* dev build报错 -* 设备方向无法选中"LandscapeLeft", "LandscapeRight" - -## 2021-11-30 - -### Changed -* 导出配置调整:统一资源CDN路径配置;配置顺序调整。 - -### Fixed -* 低版本C#导致markdownviewer报错'interpolated strings' cannot be used. - -## 2021-11-19 - -### Fixed -* 更新小游戏模板 - -## 2021-11-18 -### Added -增加bundle相关导出配置 - -* 自定义bundle名中hash长度:用于缓存控制,默认32 -* 自定义需缓存的路径标识符:下载路径命中标识符时会自动缓存本次下载文件。 -* 忽略路径下指定类型文件:路径命中标识符时,过滤不需缓存的文件类型。 - -### Fixed -* markdownviewer可能出现guiskin引用丢失 - -### Changed -* 更新小游戏模板 - -## 2021-10-26 -### Added -* 增加部分文件操作API -* 压缩纹理替换优化,提升转换速度 - -## 2021-10-09 -### Added -* 增加Unity2020、2021版本支持 - - -## 2021-09-23 -### Fixed -* 程序crash时触发用户反馈入口 - - -## 2021-09-22 - -### Added -* 支持短音频的播放API(WX.ShortAudioPlayer),更接近Unity的API调用方式 - -### Added -* 当禁用异常时,程序即将crash之前弹出用户反馈入口,并自动提交用户反馈日志、JS Error与实时日志 - -### Added -* 编译选项增加"Profiling Funcs", 仅调试问题时勾选此选项时,编译代码将含有函数名,代码体积变大 - -## 2021-09-14 - -### Added -* 支持PlayerPrefs优化,支持配置key -### Fixed -* 修复排行榜内存增长问题 - -## 2021-09-06 - -### Added -* 支持导出时配置封面图 - -## 2021-8-20 - -### Added -* 支持创建视频 - -## 2021-8-12 - -### Added -* 修复IOS下音频被系统打断后的恢复问题 -* 支持客服消息 - -## 2021-8-10 - -### Changed -* 小游戏项目模板更新 -* 独立域插件更新为1.0.27。优化文件删除;修复资源预载bug - -## 2021-08-05 - -### Added -* 音频支持获取播放状态 -* 非POT图也支持延迟加载 - -## 2021-08-04 - -### Fixed -* 独立域插件版本更新为1.0.24,修复若干问题 - -## 2021-08-02 - -### Fixed -* 独立域插件更新1.0.20,修复首包资源下载异常 -* 更新小游戏项目模板 - -## 2021-08-01 - -### Changed -* 小游戏项目模板更新 - -## 2021-07-31 - -### Added -* 增加预下载并发数控制接口WX.SetConcurrent - -### Changed -* 小游戏项目模板变更 - -## 2021-07-26 -### Added -* 增加预下载猎豹配置,自动从导出目录webgl/StreamingAssets查找资源并填充到game.js的Preload列表 - -## 2021-07-26 -### Added -* 支持文件二进制读写(同步和异步) -* 压缩纹理替换速度优化 - -## 2021-07-20 -### Fixed -* 独立域插件版本升级为1.0.16,修复初始上报时机 - -## 2021-07-19 - -### Changed -* 优化插件更新提示 - -## 2021-07-13 - -### Fixed -* 独立域插件版本升级为1.0.14,修复了一些bug - -### Changed -* 导出插件只提示更新,不自动下载 - -## 2021-07-09 - -### Fixed -* 独立域插件版本升级为1.0.13,修复了一些bug - -## 2021-07-02 - -### Fixed -* 微信版本或基础库版本过低时`WXWebAssembly`未定义,未弹框提示更新客户端 - -## 2021-06-30 - -### Fixed - -* 压缩纹理兼容flare - -### Added - -* 支持游戏恢复到前台后自动播放,默认开启分享 - -## 2021-06-29 - -### Fixed - -* 云测试设置UI框架导致editor运行错误 - -### Added - -* 引入[UnityMarkdownViewer](https://github.com/gwaredd/UnityMarkdownViewer)在inspector面板预览changelog - -### Removed - -* 移除转换小游戏面板中`游戏内存大小`字段: 从Unity 2019开始已不支持设置`PlayerSettings.WebGL.memorySize` - -### Changed - -* 资源优化工具代码添加namespace, 避免与游戏代码冲突 - -### Others - -独立域插件更新为(1.0.11) - -* `.untiy3d`拓展名文件视为bundle文件,可做缓存。 -* 根据是否调试模式控制日志输出,规则为: 若为开发版, enableDebugLog=false且为调试模式时输出详细日志;其他版本, 开启调试模式则输出详细日志 - -## 2021-06-10 - -### Fixed - -* 独立域插件更新(1.0.10): 修复安卓分片读取包内资源内存越界 diff --git a/Assets/WX-WASM-SDK/CHANGELOG.md.meta b/Assets/WX-WASM-SDK/CHANGELOG.md.meta deleted file mode 100644 index 3ea750e0..00000000 --- a/Assets/WX-WASM-SDK/CHANGELOG.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 28f40a500a3f8441ab9cd7f003194f69 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Cloud.cs b/Assets/WX-WASM-SDK/Cloud.cs deleted file mode 100644 index 8917f099..00000000 --- a/Assets/WX-WASM-SDK/Cloud.cs +++ /dev/null @@ -1,88 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Runtime.InteropServices; - -namespace WeChatWASM -{ - /// - /// 云函数,调用前必须先Init初始化 - /// - public class Cloud - { - #region C#调用JS桥接方法 -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - - private static extern void WXCallFunction(string name, string data, string conf, string s, string f, string c); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXCallFunctionInit(string conf); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCloudID(string cloudID); - #endregion - - /// - /// 初始化,详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html - /// - /// - public void Init(CallFunctionInitParam param) - { - WXCallFunctionInit(JsonUtility.ToJson(param)); - } - - /// - /// 调用云函数,详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html - /// - /// - /// - //WX.cloud.Init(new CallFunctionInitParam() - //{ - // env = "product", - // traceUser = false - // }); - - // var p = new C() - // { - // content = "haha" - // }; - //WX.cloud.CallFunction(new CallFunctionParam() - //{ - // name = "msgSecCheck", - // data = JsonUtility.ToJson(p), - // success = (res) => { - // Debug.Log("success"); - // Debug.Log(res.result); - // }, - // fail = (res) => { - // Debug.Log("fail"); - // Debug.Log(res.errMsg); - // }, - // complete = (res) => { - // Debug.Log("complete"); - // Debug.Log(res.result); - // } - // }); - /// - public void CallFunction(CallFunctionParam param) - { - WXCallFunction(param.name, param.data, - param.config == null ? "" : JsonUtility.ToJson(param.config), - WXCallBackHandler.Add(param.success), WXCallBackHandler.Add(param.fail), WXCallBackHandler.Add(param.complete)); - } - /// - /// 声明字符串为 CloudID(开放数据 ID),该接口传入一个字符串,返回一个 CloudID 特殊字符串,将该对象传至云函数可以获取其对应的开放数据。详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/open/Cloud.CloudID.html - /// - /// 通过开放能力在小程序端 / web 端获取得到的 CloudID - /// 返回字符串,原样传回云函数调用就好 - public string CloudID(string cloudID) - { - return WXCloudID(cloudID); - } - - - } -} diff --git a/Assets/WX-WASM-SDK/Cloud.cs.meta b/Assets/WX-WASM-SDK/Cloud.cs.meta deleted file mode 100644 index 43a5eba1..00000000 --- a/Assets/WX-WASM-SDK/Cloud.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7dc67f38c6b669248935f7a81515cc15 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor.meta b/Assets/WX-WASM-SDK/Editor.meta deleted file mode 100644 index 59e2cf9a..00000000 --- a/Assets/WX-WASM-SDK/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1461508a27147425681d08856088988f -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli.meta b/Assets/WX-WASM-SDK/Editor/Brotli.meta deleted file mode 100644 index 1c1e9d4d..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 375e4432d7f4a4055a9f4917213823fe -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/LICENSE.txt b/Assets/WX-WASM-SDK/Editor/Brotli/LICENSE.txt deleted file mode 100755 index 33b7cdd2..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/LICENSE.txt.meta b/Assets/WX-WASM-SDK/Editor/Brotli/LICENSE.txt.meta deleted file mode 100755 index eed20d82..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/LICENSE.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 094d36fd8b54c4c3d98d21b57d92ae26 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/commits.txt b/Assets/WX-WASM-SDK/Editor/Brotli/commits.txt deleted file mode 100755 index c5516b97..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/commits.txt +++ /dev/null @@ -1,2 +0,0 @@ -https://github.com/Unity-Technologies/brotli -359ceef04a4eae97cb8a161c4b768fd639eef98b diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/commits.txt.meta b/Assets/WX-WASM-SDK/Editor/Brotli/commits.txt.meta deleted file mode 100755 index 092373de..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/commits.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 5aaeb4910866f4388a86efc2ac5bde76 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64.meta b/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64.meta deleted file mode 100644 index 922c1ca4..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7b5e3d7c7e2c4428dba8fa6c696cbbbd -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64/brotli b/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64/brotli deleted file mode 100755 index 8a0548f4..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64/brotli and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64/brotli.meta b/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64/brotli.meta deleted file mode 100755 index cf3a6561..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/linux_x86_64/brotli.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c7d34b53fefa24bf5b0ce2914fc60ad8 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/macos.meta b/Assets/WX-WASM-SDK/Editor/Brotli/macos.meta deleted file mode 100644 index efe3e763..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/macos.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 27ae0e87a88534b17b4f74e9f0cb89ca -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/macos/brotli b/Assets/WX-WASM-SDK/Editor/Brotli/macos/brotli deleted file mode 100755 index e49bace5..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/Brotli/macos/brotli and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/macos/brotli.meta b/Assets/WX-WASM-SDK/Editor/Brotli/macos/brotli.meta deleted file mode 100755 index 0bb9b715..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/macos/brotli.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 74b4e5c821cda4b7d8f401d7935a892e -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64.meta b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64.meta deleted file mode 100644 index ecd8f5d9..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 258016e4493c34ce497c7a325a855a34 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/brotli.exe.meta b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/brotli.exe.meta deleted file mode 100755 index 2a15356b..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/brotli.exe.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 14077bb4dfcdf487aa222261b4719a0e -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140.dll b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140.dll deleted file mode 100755 index 94cbba79..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140.dll.meta b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140.dll.meta deleted file mode 100755 index 75145c32..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140.dll.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 482c84c1110074e5295b51734fa3053b -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_1.dll b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_1.dll deleted file mode 100755 index efb7d98d..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_1.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_1.dll.meta b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_1.dll.meta deleted file mode 100755 index 4b98f466..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_1.dll.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 713e2b6c25b3540e595a5036bacaedbd -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_2.dll b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_2.dll deleted file mode 100755 index d135c2a4..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_2.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_2.dll.meta b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_2.dll.meta deleted file mode 100755 index 3e932bcc..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/msvcp140_2.dll.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 250ffb10dd8854b5d8b5d31a7f9afd14 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140.dll b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140.dll deleted file mode 100755 index f59e67e9..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140.dll.meta b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140.dll.meta deleted file mode 100755 index 77fdacc5..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140.dll.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: e23a7460c65914b4995b078d7edfcd55 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140_1.dll b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140_1.dll deleted file mode 100755 index f5642047..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140_1.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140_1.dll.meta b/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140_1.dll.meta deleted file mode 100755 index 236b7c97..00000000 --- a/Assets/WX-WASM-SDK/Editor/Brotli/win_x86_64/vcruntime140_1.dll.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 466c0abf5fe5847879df912061e09f9e -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset b/Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset deleted file mode 100644 index 3a75a51c..00000000 --- a/Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset +++ /dev/null @@ -1,58 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8958f46b6ca6d6440b590cbfa69e1103, type: 3} - m_Name: MiniGameConfig - m_EditorClassIdentifier: - ProjectConf: - projectName: Chicken - Appid: wxb8f1bd49ef160a9a - CDN: https://touka-artifacts.oss-cn-beijing.aliyuncs.com/WXResource/Chicken_WebGL/ - assetLoadType: 0 - VideoUrl: - DST: /Users/yangjing/Desktop/Chicken_WX - StreamCDN: - bundleHashLength: 32 - bundlePathIdentifier: StreamingAssets; - bundleExcludeExtensions: json; - AssetsUrl: - MemorySize: 256 - HideAfterCallMain: 1 - preloadFiles: - Orientation: 0 - bgImageSrc: Assets/Art/open.jpg - dataFileSubPrefix: - maxStorage: 200 - defaultReleaseSize: 31457280 - texturesHashLength: 8 - texturesPath: Assets/Textures - needCacheTextures: 1 - loadingBarWidth: 240 - SDKOptions: - UseAudioApi: 0 - UseFriendRelation: 0 - UseCompressedTexture: 0 - CompileOptions: - DevelopBuild: 0 - AutoProfile: 0 - ScriptOnly: 0 - profilingFuncs: 0 - Webgl2: 0 - DeleteStreamingAssets: 1 - ProfilingMemory: 0 - CompressTexture: - halfSize: 0 - useDXT5: 0 - bundleSuffix: bundle - parallelWithBundle: 0 - bundleDir: - dstMinDir: - PlayerPrefsKeys: [] diff --git a/Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset.meta b/Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset.meta deleted file mode 100644 index 7af3dac6..00000000 --- a/Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 23ce2bd10a28244debb0ff0b050c68c8 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis.meta deleted file mode 100644 index e607d7e6..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 47f63e08c47354fbdba0c44309f3ce26 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Analysis.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Analysis.cs deleted file mode 100644 index 1b3cdb89..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Analysis.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -namespace WeChatWASM.Analysis -{ - public class Analysis : ScriptableObject - { - - } -} diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Analysis.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Analysis.cs.meta deleted file mode 100644 index 20ad2a2f..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Analysis.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2aab4fbbf46a75b408a8a38ff77fbbb9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AnalysisWindow.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AnalysisWindow.cs deleted file mode 100644 index 0553019a..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AnalysisWindow.cs +++ /dev/null @@ -1,75 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; - -namespace WeChatWASM.Analysis -{ - public class AnalysisWindow : EditorWindow - { - public int AssetsTypeSelected; - public string[] AssetsTypeOptions = new string[] { "Texture", "Font", "Audio", "Prefab" }; - - public TextureWindow TextureWindow; - public FontWindow FontWindow; - public AudioWindow AudioWindow; - public PrefabWindow PrefabWindow; - - static private EditorWindow win; - - [MenuItem("微信小游戏 / 资源优化工具")] - static void ShowTextureWindow() - { - //EditorUtility.DisplayDialog("MyTool", "Do It in C# !", "OK", ""); - win = AnalysisWindow.GetCurrentWindow(); - win.minSize = new Vector2(1600, 800); - win.Show(); - } - - public static EditorWindow GetCurrentWindow() - { - return GetWindow(typeof(AnalysisWindow), false, "Optimize", true); - } - - private void OnEnable() - { - this.TextureWindow = TextureWindow.GetInstance(); - this.FontWindow = FontWindow.GetInstance(); - this.AudioWindow = AudioWindow.GetInstance(); - this.PrefabWindow = PrefabWindow.GetInstance(); - } - - private void OnDisable() - { - this.TextureWindow = null; - this.FontWindow = null; - } - - private void OnGUI() - { - GUILayout.BeginHorizontal(Array.Empty()); - GUILayout.FlexibleSpace(); - GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Height(25f) }; - this.AssetsTypeSelected = GUILayout.Toolbar(this.AssetsTypeSelected, this.AssetsTypeOptions, "LargeButton", GUI.ToolbarButtonSize.FitToContents, options); - GUILayout.FlexibleSpace(); - GUILayout.EndHorizontal(); - - switch (this.AssetsTypeSelected) - { - case 0: - this.TextureWindow.Show(); - break; - case 1: - this.FontWindow.Show(); - break; - case 2: - this.AudioWindow.Show(); - break; - case 3: - this.PrefabWindow.Show(); - break; - default: - break; - } - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AnalysisWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AnalysisWindow.cs.meta deleted file mode 100644 index 3f8c0c75..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AnalysisWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7d06d74ece63a234b9cf5994c689e33e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AssetTreeView.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AssetTreeView.cs deleted file mode 100644 index 88335073..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AssetTreeView.cs +++ /dev/null @@ -1,164 +0,0 @@ -using UnityEngine; -using UnityEditor; -using UnityEditor.IMGUI.Controls; - -namespace WeChatWASM.Analysis -{ - //带数据的TreeViewItem - public class AssetViewItem : TreeViewItem - { - public ReferenceFinderData.AssetDescription data; - } - - //资源引用树 - public class AssetTreeView : TreeView - { - //图标宽度 - const float kIconWidth = 18f; - //列表高度 - const float kRowHeights = 20f; - public AssetViewItem assetRoot; - - private GUIStyle stateGUIStyle = new GUIStyle { richText = true, alignment = TextAnchor.MiddleCenter }; - - //列信息 - enum MyColumns - { - Name, - Path, - State, - } - - public AssetTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader) : base(state, multicolumnHeader) - { - useScrollView = false; - rowHeight = kRowHeights; - columnIndexForTreeFoldouts = 0; - showAlternatingRowBackgrounds = true; - showBorder = false; - customFoldoutYOffset = (kRowHeights - EditorGUIUtility.singleLineHeight) * 0.5f; // center foldout in the row since we also center content. See RowGUI - extraSpaceBeforeIconAndLabel = kIconWidth; - } - //响应双击事件 - protected override void DoubleClickedItem(int id) - { - var item = (AssetViewItem)FindItem(id, rootItem); - //在ProjectWindow中高亮双击资源 - if (item != null) - { - var assetObject = AssetDatabase.LoadAssetAtPath(item.data.path, typeof(UnityEngine.Object)); - EditorUtility.FocusProjectWindow(); - Selection.activeObject = assetObject; - EditorGUIUtility.PingObject(assetObject); - } - } - - //生成ColumnHeader - public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState(float treeViewWidth) - { - var columns = new[] - { - //图标+名称 - new MultiColumnHeaderState.Column - { - headerContent = new GUIContent("Name"), - headerTextAlignment = TextAlignment.Center, - sortedAscending = false, - width = 200, - minWidth = 60, - autoResize = false, - allowToggleVisibility = false, - canSort = false - }, - //路径 - new MultiColumnHeaderState.Column - { - headerContent = new GUIContent("Path"), - headerTextAlignment = TextAlignment.Center, - sortedAscending = false, - width = 360, - minWidth = 60, - autoResize = false, - allowToggleVisibility = false, - canSort = false - }, - ////状态 - //new MultiColumnHeaderState.Column - //{ - // headerContent = new GUIContent("State"), - // headerTextAlignment = TextAlignment.Center, - // sortedAscending = false, - // width = 60, - // minWidth = 60, - // autoResize = false, - // allowToggleVisibility = true, - // canSort = false - //}, - }; - var state = new MultiColumnHeaderState(columns); - return state; - } - - protected override TreeViewItem BuildRoot() - { - return assetRoot; - } - - protected override void RowGUI(RowGUIArgs args) - { - var item = (AssetViewItem)args.item; - for (int i = 0; i < args.GetNumVisibleColumns(); ++i) - { - CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args); - } - } - - //绘制列表中的每项内容 - void CellGUI(Rect cellRect, AssetViewItem item, MyColumns column, ref RowGUIArgs args) - { - CenterRectUsingSingleLineHeight(ref cellRect); - switch (column) - { - case MyColumns.Name: - { - var iconRect = cellRect; - iconRect.x += GetContentIndent(item); - iconRect.width = kIconWidth; - if (iconRect.x < cellRect.xMax) - { - var icon = GetIcon(item.data.path); - if (icon != null) - GUI.DrawTexture(iconRect, icon, ScaleMode.ScaleToFit); - } - args.rowRect = cellRect; - base.RowGUI(args); - } - break; - case MyColumns.Path: - { - GUI.Label(cellRect, item.data.path); - } - break; - case MyColumns.State: - { - GUI.Label(cellRect, ReferenceFinderData.GetInfoByState(item.data.state), stateGUIStyle); - } - break; - } - } - - //根据资源信息获取资源图标 - private Texture2D GetIcon(string path) - { - Object obj = AssetDatabase.LoadAssetAtPath(path, typeof(Object)); - if (obj != null) - { - Texture2D icon = AssetPreview.GetMiniThumbnail(obj); - if (icon == null) - icon = AssetPreview.GetMiniTypeThumbnail(obj.GetType()); - return icon; - } - return null; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AssetTreeView.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AssetTreeView.cs.meta deleted file mode 100644 index e5bf20b6..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AssetTreeView.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 913d7b4e37be64446863ebfd1b6b3294 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AudioWindow.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AudioWindow.cs deleted file mode 100644 index 4f2cbdfd..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AudioWindow.cs +++ /dev/null @@ -1,148 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.Linq; -using System; - -namespace WeChatWASM.Analysis -{ - public class AudioWindow : BaseWindow - { - private AssetDataTable m_table; - private List selectedObjects; - private List originalInfos; - private List renderInfos; - - public class AssetDataTable : CommonTable - { - public AssetDataTable(List datas, - CommonTableColumn[] cs, - FilterMethod onfilter, - SelectMethod onselect = null) - : base(datas, cs, onfilter, onselect) - { - } - } - - public AudioWindow() : base() - { - if (m_table == null) - { - var datas = new List(); - var cols = GetViewColumn(); - m_table = new AssetDataTable(datas, cols, OnFilter, OnRowSelect); - } - } - - public CommonTableColumn[] GetViewColumn() - { - var cols = new CommonTableColumn[] - { - new CommonTableColumn - { - headerContent = new GUIContent("name"), - canSort = true, - minWidth = 170, - width = 170, - Compare = (a,b) => -a.name.CompareTo(b.name), - DrawCell = (rect, data) => EditorGUI.LabelField(rect, data.name) - }, - new CommonTableColumn - { - headerContent = new GUIContent("path"), - canSort = true, - minWidth = 350, - width = 350, - Compare = (a,b) => -a.assetPath.CompareTo(b.assetPath), - DrawCell = (rect, data) => EditorGUI.LabelField(rect, data.assetPath) - } - }; - - return cols; - } - - public void OnRowSelect(List datas) - { - currentAssetPathList = datas.Select((info) => info.assetPath).ToArray(); - selectedObjects = new List(datas); - var list = new List(); - foreach (var data in datas) - { - var info = data._info; - list.Add(info); - } - Selection.objects = list.ToArray(); - } - - private bool OnFilter(AudioInfo data, string std) - { - string name = std; - if (name.Length == 0) - { - return true; - } - return data.name.ToLower().IndexOf(name.ToLower()) > -1; - } - - public override void RefreshTable() - { - if (needUpdateMainContent) - { - needUpdateMainContent = false; - var cols = GetViewColumn(); - m_table = new AssetDataTable(renderInfos, cols, OnFilter, OnRowSelect); - } - m_table.OnGUI(); - } - - public override void DrawOptionArea() - { - GUILayout.Space(40); - if (GUILayout.Button("搜索音频文件", GUILayout.Width(160), GUILayout.Height(40))) - { - CollectAssets(); - } - } - - public void CollectAssets(Boolean needRefreshCurrentFolder = true) - { - if (needRefreshCurrentFolder) - { - this.currentFolder = GetCurrentFolder(); - } - originalInfos = new List(); - var guids = AssetDatabase.FindAssets("t:audioclip", new[] { this.currentFolder }); - var count = guids.Length; - var current = 0; - foreach (string guid in guids) - { - current++; - EditorUtility.DisplayCancelableProgressBar("search Audio", "searching " + current, (float)current / count); - var obj = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid)); - var filePath = AssetDatabase.GetAssetPath(obj); - originalInfos.Add(new AudioInfo(obj, filePath)); - } - - EditorUtility.ClearProgressBar(); - - renderInfos = new List(originalInfos); - - needUpdateMainContent = true; - Selection.objects = null; - } - } - - public class AudioInfo - { - public string assetPath; - public string name; - public AudioClip _info; - - public AudioInfo(AudioClip info, string assetPath) - { - this._info = info; - this.assetPath = assetPath; - this.name = info.name; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AudioWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AudioWindow.cs.meta deleted file mode 100644 index 1c5cd47b..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/AudioWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e222bfdf52432fb429ffe36b48050b51 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/BaseWindow.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/BaseWindow.cs deleted file mode 100644 index 054e8fbf..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/BaseWindow.cs +++ /dev/null @@ -1,254 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using UnityEditor.IMGUI.Controls; -using System.Collections.Generic; -using System.IO; - -//public abstract class BaseWindow -//{ - -//} -namespace WeChatWASM.Analysis -{ - public class BaseWindow where T : class, new() - { - //private AssetDataTable m_table; - Vector2 assetListScrollPosition = Vector2.zero; - - float splitterPos = 1000; - Rect splitterRect; - float splitterWidth = 5; - bool dragging; - - Vector2 refrenceListScrollPostion = Vector2.zero; - - public EditorWindow win; - - public string currentFolder; - public Boolean needRefreshCurrentFolder; - - public string[] currentAssetPathList; - public AssetTreeView assetTreeView; - public List selectedAssetGuid = new List(); - public static ReferenceFinderData assetRefrenceDatas = new ReferenceFinderData(); - public Boolean initializedRefrenceData = false; - - public TreeViewState treeViewState; - - // 是否需要刷新扫描结果 - public Boolean needUpdateMainContent = false; - // 是否更新资源引用结果 - public Boolean needUpdateAssetTree = false; - - // 单例 - public static T instance; - public static readonly object locker = new object(); - - public BaseWindow() - { - win = AnalysisWindow.GetCurrentWindow(); - - if (!initializedRefrenceData) - { - if (!assetRefrenceDatas.ReadFromCache()) - { - assetRefrenceDatas.CollectDependenciesInfo(); - } - initializedRefrenceData = true; - } - } - - public static T GetInstance() - { - lock (locker) - { - if (instance == null) - { - instance = new T(); - } - } - return instance; - } - - public void Show() - { - GUILayout.BeginHorizontal(); - - DrawOptionBtn(); - DrawMainContent(); - DrawSplitter(); - DrawReferenceLayout(); - - GUILayout.EndHorizontal(); - } - - public void DrawOptionBtn() - { - GUILayout.BeginVertical(); - - DrawOptionArea(); - - GUILayout.EndVertical(); - } - - public virtual void DrawOptionArea() - { - - } - - public string GetCurrentFolder() - { - string path = "Assets"; - - foreach (UnityEngine.Object obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets)) - { - path = AssetDatabase.GetAssetPath(obj); - if (!string.IsNullOrEmpty(path) && File.Exists(path)) - { - path = Path.GetDirectoryName(path); - break; - } - } - return path; - } - - public void DrawMainContent() - { - assetListScrollPosition = GUILayout.BeginScrollView(assetListScrollPosition, GUILayout.Width(splitterPos), GUILayout.MinWidth(splitterPos), GUILayout.MaxWidth(splitterPos)); - RefreshTable(); - GUILayout.EndScrollView(); - } - - public virtual void RefreshTable() - { - } - - public void DrawSplitter() - { - // splitter - GUILayout.Box("", - GUILayout.Width(splitterWidth), - GUILayout.MaxWidth(splitterWidth), - GUILayout.MinWidth(splitterWidth), - GUILayout.ExpandHeight(true)); - splitterRect = GUILayoutUtility.GetLastRect(); - - if (Event.current != null) - { - switch (Event.current.rawType) - { - case EventType.MouseDown: - if (splitterRect.Contains(Event.current.mousePosition)) - { - dragging = true; - } - break; - case EventType.MouseDrag: - if (dragging) - { - splitterPos += Event.current.delta.x; - win.Repaint(); - } - break; - case EventType.MouseUp: - if (dragging) - { - dragging = false; - } - break; - } - } - } - - public void DrawReferenceLayout() - { - GUILayout.BeginVertical(); - if (GUILayout.Button("检查依赖", GUILayout.Width(160), GUILayout.Height(40))) - { - if (currentAssetPathList.Length > 0) - { - selectedAssetGuid.Clear(); - selectedAssetGuid.Add(AssetDatabase.AssetPathToGUID(currentAssetPathList[0])); - needUpdateAssetTree = true; - } - } - var btnRect = GUILayoutUtility.GetLastRect(); - - // asset reference - var scrollViewWidth = win.position.width - splitterRect.xMax; - var scrollViewY = btnRect.yMax + 5; - - refrenceListScrollPostion = GUILayout.BeginScrollView(refrenceListScrollPostion, GUILayout.Width(scrollViewWidth), GUILayout.MinWidth(scrollViewWidth), GUILayout.MaxWidth(scrollViewWidth), GUILayout.ExpandHeight(true)); - UpdateAssetTree(); - if (assetTreeView != null) - { - var rect = GUILayoutUtility.GetRect(0f, Screen.width, 0f, Screen.height); - if (Event.current.type != EventType.Layout) - { - assetTreeView.OnGUI(rect); - } - } - GUILayout.EndScrollView(); - - GUILayout.EndVertical(); - } - - public void UpdateAssetTree() - { - if (needUpdateAssetTree && selectedAssetGuid.Count != 0) - { - var root = SelectedAssetGuidToRootItem(selectedAssetGuid); - if (assetTreeView == null) - { - if (treeViewState == null) - { - treeViewState = new TreeViewState(); - } - var headerState = AssetTreeView.CreateDefaultMultiColumnHeaderState(win.position.width - splitterRect.x); - var multiColumnHeader = new MultiColumnHeader(headerState); - assetTreeView = new AssetTreeView(treeViewState, multiColumnHeader); - } - assetTreeView.assetRoot = root; - assetTreeView.CollapseAll(); - assetTreeView.Reload(); - needUpdateAssetTree = false; - } - } - - //生成root相关 - private HashSet updatedAssetSet = new HashSet(); - //通过选择资源列表生成TreeView的根节点 - private AssetViewItem SelectedAssetGuidToRootItem(List selectedAssetGuid) - { - updatedAssetSet.Clear(); - int elementCount = 0; - var root = new AssetViewItem { id = elementCount, depth = -1, displayName = "Root", data = null }; - int depth = 0; - foreach (var childGuid in selectedAssetGuid) - { - root.AddChild(CreateTree(childGuid, ref elementCount, depth)); - } - updatedAssetSet.Clear(); - return root; - } - //通过每个节点的数据生成子节点 - private AssetViewItem CreateTree(string guid, ref int elementCount, int _depth) - { - if (!updatedAssetSet.Contains(guid)) - { - assetRefrenceDatas.UpdateAssetState(guid); - updatedAssetSet.Add(guid); - } - ++elementCount; - var referenceData = assetRefrenceDatas.assetDict[guid]; - var root = new AssetViewItem { id = elementCount, displayName = referenceData.name, data = referenceData, depth = _depth }; - var childGuids = referenceData.references; - foreach (var childGuid in childGuids) - { - root.AddChild(CreateTree(childGuid, ref elementCount, _depth + 1)); - } - return root; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/BaseWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/BaseWindow.cs.meta deleted file mode 100644 index 9550787b..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/BaseWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ea47c9c594c266a4f94dff634585161e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTable.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTable.cs deleted file mode 100644 index 9c4cccef..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTable.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEditor.IMGUI.Controls; -using UnityEngine; - -namespace WeChatWASM.Analysis -{ - public abstract class CommonTable - { - public abstract void OnGUI(); - } - - public class CommonTable : CommonTable where T : class - { - private const float DragHeight = 20f; - - private const float DragWidth = 5f; - - private readonly float m_FilterHeight = 20f; - - private bool m_initialized; - - private CommonTreeView m_treeView; - - private TreeViewState m_treeViewState; - - private readonly List m_datas; - private readonly FilterMethod m_filter; - private readonly SelectMethod m_select; - private readonly Action m_toggleSelectAll; - - protected MultiColumnHeaderState MultiColumnHeaderState { get; private set; } - - public CommonTable(List datas, CommonTableColumn[] cs, FilterMethod onfilter, SelectMethod onselect = null, Action toggleSelectAll = null) - { - var state = new MultiColumnHeaderState(cs); - MultiColumnHeaderState = state; - m_filter = onfilter; - m_datas = datas; - m_select = onselect; - m_toggleSelectAll = toggleSelectAll; - } - - private void InitIfNeeded() - { - if (!m_initialized) - { - if (m_treeViewState == null) - m_treeViewState = new TreeViewState(); - var multiColumnHeader = new MultiColumnHeader(MultiColumnHeaderState); - m_treeView = new CommonTreeView(m_treeViewState, multiColumnHeader, m_datas, m_filter, m_select, m_toggleSelectAll); - m_treeView.Reload(); - m_initialized = true; - } - } - - public void SelectAll() - { - if (m_treeView != null) - { - m_treeView.SelectAllRows(); - } - } - - public override void OnGUI() - { - - InitIfNeeded(); - - var rect = GUILayoutUtility.GetRect(0f, Screen.width, 0f, Screen.height); - if (Event.current.type == EventType.Layout) - return; - rect.x += DragWidth; - rect.width -= DragWidth; - - rect.y += DragHeight; - - var r = rect; - rect.y += m_FilterHeight; - rect.height = rect.height - m_FilterHeight - DragHeight * 2; - - var rect2 = rect; - m_treeView.OnCheckAllGUI(); - m_treeView.OnGUI(rect2); - //DrawExportButton(r); - m_treeView.OnFilterGUI(r); - //if (m_treeView.IsFilteredDirty()) - // m_treeView.Reload(); - } - - //private void DrawExportButton(Rect rect) - //{ - // var br = rect; - // br.height = 20; - // br.width = 50; - // if (GUI.Button(br, "Export")) - // { - // var path = EditorUtility.SaveFilePanel("file", Application.dataPath, "data", "xml"); - // if (!string.IsNullOrEmpty(path)) - // Serializer.SaveAsXml(m_datas, path); - // } - //} - } - - public delegate void DrawCellMethod(Rect cellRect, T item); - - public delegate bool FilterMethod(T data, string std); - - public delegate int CompareMethod(T data1, T data2); - - public delegate void SelectMethod(List datas); - - public class StringFilter - { - public static bool Contains(string req, string std) - { - if (req == null || std == null) - return false; - return req.IndexOf(std, 0, StringComparison.OrdinalIgnoreCase) >= 0; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTable.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTable.cs.meta deleted file mode 100644 index d0759813..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTable.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3141a5220cd78d9468884a5aaa571bd1 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeView.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeView.cs deleted file mode 100644 index a5a53ecc..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeView.cs +++ /dev/null @@ -1,275 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; -using UnityEditor; -using UnityEditor.IMGUI.Controls; -using UnityEngine; - -namespace WeChatWASM.Analysis -{ - public class CommonTreeView : TreeView where T : class - { - private List> m_items; - private Boolean isAllCheck; - private Action m_toggleSelectAll; - - private readonly List m_datas; - public CommonTreeView( - TreeViewState state, - MultiColumnHeader multiColumnHeader, - List datas, - FilterMethod filter, - SelectMethod select = null, - Action toggleSelectAll = null) - : base(state, multiColumnHeader) - { - m_datas = datas; - - m_filter = filter; - m_select = select; - m_toggleSelectAll = toggleSelectAll; - - multiColumnHeader.sortingChanged += OnSortingChanged; - multiColumnHeader.visibleColumnsChanged += OnVisibleColumnChanged; - - showAlternatingRowBackgrounds = true; - showBorder = true; - rowHeight = EditorGUIUtility.singleLineHeight; - } - - private void OnVisibleColumnChanged(MultiColumnHeader multicolumnheader) - { - Reload(); - } - - private void OnSortingChanged(MultiColumnHeader multicolumnheader) - { - var rows = GetRows(); - Sort(rows, multiColumnHeader.sortedColumnIndex); - } - - protected override TreeViewItem BuildRoot() - { - return new CommonTreeViewItem(-1, -1, null); - } - - protected override IList BuildRows(TreeViewItem root) - { - if (m_items == null) - { - m_items = new List>(); - for (var i = 0; i < m_datas.Count; i++) - { - var data = m_datas[i]; - m_items.Add(new CommonTreeViewItem(i, 0, data)); - } - } - var items = m_items; - if (!string.IsNullOrEmpty(m_text)) - items = Filter(items); - - var list = new List(); - foreach (var item in items) - { - list.Add(item); - } - if (multiColumnHeader.sortedColumnIndex >= 0) - Sort(list, multiColumnHeader.sortedColumnIndex); - return items.Cast().ToList(); - } - - private readonly FilterMethod m_filter; - - [CanBeNull] - private readonly SelectMethod m_select; - - private List> Filter(IEnumerable> rows) - { - var enumerable = rows; - var i = 0; - if (IsColumnVisible(i) && m_filter != null) - { - enumerable = from item in enumerable - where m_filter(item.Data, m_text) - select item; - } - return enumerable.ToList(); - } - private CommonTableColumn Col(int idx) - { - return (CommonTableColumn)multiColumnHeader.state.columns[idx]; - } - - private void Sort(IList rows, int sortIdx) - { - var flag = multiColumnHeader.IsSortedAscending(sortIdx); - var comp = Col(sortIdx).Compare; - var list = (List)rows; - if (comp != null) - { - Comparison comparison = (lhs, rhs) => - { - var x1 = (CommonTreeViewItem)lhs; - var x2 = (CommonTreeViewItem)rhs; - return comp(x1.Data, x2.Data); - }; - Comparison comparison2 = (lhs, rhs) => - { - var x1 = (CommonTreeViewItem)lhs; - var x2 = (CommonTreeViewItem)rhs; - return -comp(x1.Data, x2.Data); - }; - list.Sort(!flag ? comparison2 : comparison); - } - } - - protected override void RowGUI(RowGUIArgs args) - { - var item = (CommonTreeViewItem)args.item; - for (var i = 0; i < args.GetNumVisibleColumns(); i++) - { - CellGUI(args.GetCellRect(i), item.Data, args.GetColumn(i)); - } - } - - private void CellGUI(Rect cellRect, T item, int columnIndex) - { - CenterRectUsingSingleLineHeight(ref cellRect); - var column = (CommonTableColumn)multiColumnHeader.GetColumn(columnIndex); - if (column.DrawCell != null) - column.DrawCell(cellRect, item); - } - - public void OnCheckAllGUI() - { - var selectedList = this.GetSelection(); - if (selectedList.Count != m_datas.Count) - { - isAllCheck = false; - } - var newState = GUI.Toggle(new Rect(5, 20, 50, 20), isAllCheck, "全选"); - if (newState != isAllCheck) - { - isAllCheck = newState; - if (isAllCheck) - { - if (m_datas.Count != 0) - { - this.SelectAllRows(); - } - } else - { - this.SetSelection(new List()); - } - if (m_toggleSelectAll != null) - { - m_toggleSelectAll(isAllCheck); - } - } - } - - public void OnFilterGUI(Rect r) - { - EditorGUI.BeginChangeCheck(); - var width = r.width; - var num = 16f; - r.width = num; - r.x += num; - r.width = GUI.skin.label.CalcSize(Styles.filterSelection).x; - - //EditorGUI.LabelField(r, Styles.filterSelection); - r.width = Mathf.Min(width - (r.x + r.width), 300f); - r.x = width - r.width + 25; - FilterGUI(r); - if (EditorGUI.EndChangeCheck()) - { - Reload(); - } - } - - private string m_text; - private void FilterGUI(Rect r) - { - r.width -= 15f; - //GUI.SetNextControlName("InputText"); - m_text = EditorGUI.DelayedTextField(r, GUIContent.none, m_text, Styles.searchField); - //EditorGUI.FocusTextInControl("InputText"); - r.x += r.width; - r.width = 15f; - bool flag = m_text != ""; - if (GUI.Button(r, GUIContent.none, (!flag) ? Styles.searchFieldCancelButtonEmpty : Styles.searchFieldCancelButton) && flag) - { - m_text = ""; - GUIUtility.keyboardControl = 0; - } - } - - private bool IsColumnVisible(int idx) - { - return multiColumnHeader.state.visibleColumns.Any(t => t == idx); - } - - protected override void KeyEvent() - { - if (Event.current.type == EventType.KeyDown) - { - if (Event.current.character == '\t') - { - GUI.FocusControl(Styles.focusHelper); - Event.current.Use(); - } - } - } - - protected override void SelectionChanged(IList selectedIds) - { - var datas = new List(); - foreach (var id in selectedIds) - { - if (id < 0 || id > m_datas.Count) - { - Debug.Log(id + "out of range"); - continue; - } - var data = m_datas[id]; - datas.Add(data); - } - if (m_select != null) - m_select(datas); - } - } - - public class CommonTableColumn : MultiColumnHeaderState.Column - { - public DrawCellMethod DrawCell; - - //public IFilter Filter; - public CompareMethod Compare { get; set; } - } - - //public interface IFilter - //{ - // void OnGUI(Rect r); - //} - - //public interface IFilter : IFilter - //{ - // bool Filter(T prop); - //} - - //public class StringFilter - //{ - // [SerializeField] - // protected string m_Text = ""; - // public void OnGUI(Rect r) - // { - - // } - - // public bool Filter(string prop) - // { - // return prop.IndexOf(m_Text, 0, StringComparison.OrdinalIgnoreCase) >= 0; - // } - //} -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeView.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeView.cs.meta deleted file mode 100644 index 501988ee..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeView.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 140f89fd874af114195925d1022b71a3 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeViewItem.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeViewItem.cs deleted file mode 100644 index b8e659af..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeViewItem.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEditor.IMGUI.Controls; - -namespace WeChatWASM.Analysis -{ - internal class CommonTreeViewItem : TreeViewItem where T : class - { - public T Data { get; private set; } - - public CommonTreeViewItem(int id, int depth, T data) - : base(id, depth, data == null ? "Root" : data.ToString()) - { - Data = data; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeViewItem.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeViewItem.cs.meta deleted file mode 100644 index f0458732..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/CommonTreeViewItem.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6cc83ac7be086cb4fa205a6a463b7ab7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/FontWindow.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/FontWindow.cs deleted file mode 100644 index d90e43a1..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/FontWindow.cs +++ /dev/null @@ -1,140 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.Linq; -using System; - -namespace WeChatWASM.Analysis -{ - public class FontWindow : BaseWindow - { - private AssetDataTable m_table; - private List selectedObjects; - private List originalInfos; - private List renderInfos; - - public class AssetDataTable : CommonTable - { - public AssetDataTable(List datas, - CommonTableColumn[] cs, - FilterMethod onfilter, - SelectMethod onselect = null) - : base(datas, cs, onfilter, onselect) - { - } - } - - public FontWindow() : base() - { - if (m_table == null) - { - var datas = new List(); - var cols = GetViewColumn(); - m_table = new AssetDataTable(datas, cols, OnFilter, OnRowSelect); - } - } - - public CommonTableColumn[] GetViewColumn() - { - var cols = new CommonTableColumn[] - { - new CommonTableColumn - { - headerContent = new GUIContent("name"), - canSort = true, - minWidth = 170, - width = 170, - Compare = (a,b) => -a.name.CompareTo(b.name), - DrawCell = (rect, data) => EditorGUI.LabelField(rect, data.name) - }, - new CommonTableColumn - { - headerContent = new GUIContent("path"), - canSort = true, - minWidth = 350, - width = 350, - Compare = (a,b) => -a.assetPath.CompareTo(b.assetPath), - DrawCell = (rect, data) => EditorGUI.LabelField(rect, data.assetPath) - } - }; - - return cols; - } - - public void OnRowSelect(List datas) - { - currentAssetPathList = datas.Select((info) => info.assetPath).ToArray(); - selectedObjects = new List(datas); - var list = new List(); - } - - private bool OnFilter(FontInfo data, string std) - { - string name = std; - if (name.Length == 0) - { - return true; - } - return data.name.ToLower().IndexOf(name.ToLower()) > -1; - } - - public override void RefreshTable() - { - if (needUpdateMainContent) - { - needUpdateMainContent = false; - var cols = GetViewColumn(); - m_table = new AssetDataTable(renderInfos, cols, OnFilter, OnRowSelect); - } - m_table.OnGUI(); - } - - public override void DrawOptionArea() - { - GUILayout.Space(40); - if (GUILayout.Button("搜索字体文件", GUILayout.Width(160), GUILayout.Height(40))) - { - CollectAssets(); - } - } - - public void CollectAssets(Boolean needRefreshCurrentFolder = true) - { - if (needRefreshCurrentFolder) - { - this.currentFolder = GetCurrentFolder(); - } - originalInfos = new List(); - var guids = AssetDatabase.FindAssets("t:font", new[] { this.currentFolder }); - var count = guids.Length; - var current = 0; - foreach (string guid in guids) - { - current++; - EditorUtility.DisplayCancelableProgressBar("search font", "searching " + current, (float)current / count); - var obj = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid)); - var filePath = AssetDatabase.GetAssetPath(obj); - originalInfos.Add(new FontInfo(obj, filePath)); - } - - EditorUtility.ClearProgressBar(); - - renderInfos = new List(originalInfos); - - needUpdateMainContent = true; - Selection.objects = null; - } - } - - public class FontInfo - { - public string assetPath; - public string name; - - public FontInfo(Font info, string assetPath) - { - this.assetPath = assetPath; - this.name = info.name; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/FontWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/FontWindow.cs.meta deleted file mode 100644 index 7514cf42..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/FontWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8778b602782fa0845bc139a7683d43f9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeOverview.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeOverview.cs deleted file mode 100644 index 0c73232a..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeOverview.cs +++ /dev/null @@ -1,65 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using UnityEngine.Profiling; -using System; -using UnityEditor.IMGUI.Controls; -using System.IO; -using System.Linq; -using System.Runtime.Serialization.Formatters.Binary; - -namespace WeChatWASM.Analysis -{ - public class OptimizeOverview - { - private EditorWindow win; - // 单例 - private static OptimizeOverview instance; - private static readonly object locker = new object(); - - private OptimizeOverview() - { - win = AnalysisWindow.GetCurrentWindow(); - } - - public static OptimizeOverview GetInstance() - { - lock (locker) - { - if (instance == null) - { - instance = new OptimizeOverview(); - } - } - return instance; - } - - public void Show() - { - GUILayout.BeginHorizontal(); - if (GUILayout.Button("检查资源", GUILayout.Width(140), GUILayout.Height(40))) - { - GetOverview(); - } - GUILayout.EndHorizontal(); - - //DrawOverview(); - } - - public void GetOverview() - { - var textureWindow = TextureWindow.GetInstance(); - textureWindow.CollectAssets(); - } - - public void DrawOverview() - { - GUILayout.BeginVertical(); - - var textureWindow = TextureWindow.GetInstance(); - - - GUILayout.EndVertical(); - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeOverview.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeOverview.cs.meta deleted file mode 100644 index 0b2878f9..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeOverview.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 18cb6224e95e79540ad2fdc8626616de -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeTexture.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeTexture.cs deleted file mode 100644 index 4c7f6fba..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeTexture.cs +++ /dev/null @@ -1,234 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.IO; -using System.Collections.Generic; -using System.Runtime.Serialization.Formatters.Binary; - -namespace WeChatWASM.Analysis -{ - public static class OptimizeTexture - { - static string CACHE_PATH = "Library/AssetImporterbak"; - public static Boolean CheckNeedOptimization(Texture texture, out TextureImporter textureImporter) - { - var textureWindow = TextureWindow.GetInstance(); - string path = AssetDatabase.GetAssetPath(texture); - textureImporter = AssetImporter.GetAtPath(path) as TextureImporter; - if (!textureImporter || !texture) - { - return false; - } - var _info = textureImporter.GetPlatformTextureSettings("WebGL"); - if (textureWindow.checkMipMap) - { - if (!textureImporter.mipmapEnabled) - { - return false; - } - } - if (textureWindow.formatError) - { - var list = new List() { TextureImporterFormat.DXT5, TextureImporterFormat.DXT5Crunched, TextureImporterFormat.DXT1, TextureImporterFormat.DXT1Crunched }; - var format = _info.format == TextureImporterFormat.Automatic ? textureImporter.GetAutomaticFormat("WebGL") : _info.format; - if (!(!IsPowerOfTwo(texture.width) || !IsPowerOfTwo(texture.height))) - { - return false; - } - } - if (textureWindow.checkIsReadable) - { - if (!textureImporter.isReadable) - { - return false; - } - } - if (textureWindow.checkMaxSize) - { - if (!(_info.maxTextureSize >= 512)) - { - return false; - } - } - return true; - } - - static bool IsPowerOfTwo(int x) - { - return (x & (x - 1)) == 0; - } - - public static void Optimize(List textureInfos) - { - RecordSettings(textureInfos); - var textureWindow = TextureWindow.GetInstance(); - var totalCount = textureInfos.Count; - var idx = 0; - var changedTextures = new List(); - foreach (var info in textureInfos) - { - idx++; - TextureImporter textureImporter = AssetImporter.GetAtPath(info.assetPath) as TextureImporter; - TextureImporterPlatformSettings settings = new TextureImporterPlatformSettings(); - settings.overridden = true; - int maxRect = Math.Max(info.width, info.height) / 2; - var needReImport = false; - if (textureWindow.disableReadable) - { - needReImport = true; - textureImporter.isReadable = false; - } - if (textureWindow.disableMipmap) - { - needReImport = true; - textureImporter.mipmapEnabled = false; - } - if (textureWindow.changeMaxSize) - { - needReImport = true; - if (textureWindow.selectedMaxSizeIdx == 0) - { - settings.maxTextureSize = getMaxSize(maxRect); - //textureImporter.maxTextureSize = getMaxSize(maxRect); - } - else - { - settings.maxTextureSize = int.Parse(textureWindow.maxSizeOptions[textureWindow.selectedMaxSizeIdx]); - //textureImporter.maxTextureSize = int.Parse(textureWindow.maxSizeOptions[textureWindow.selectedMaxSizeIdx]); - } - } - if (textureWindow.changeFormat) - { - needReImport = true; - var formatMap = textureWindow.formatMap; - var list = new List(formatMap.Keys); - var i = textureWindow.textureFormatSelected; - TextureImporterFormat format = formatMap[list[i]]; - settings.name = "WebGL"; - settings.format = format; - - } - if (needReImport) - { - var tex = AssetDatabase.LoadAssetAtPath(info.assetPath); - changedTextures.Add(tex); - EditorUtility.DisplayCancelableProgressBar("Recover", "Reading Cache " + idx, (float)idx / totalCount); - textureImporter.SetPlatformTextureSettings(settings); - textureImporter.SaveAndReimport(); - AssetDatabase.ImportAsset(info.assetPath); - } - } - //Undo.RecordObjects(changedTextures.ToArray(), "optimize"); - EditorUtility.ClearProgressBar(); - } - - private static int getMaxSize(int size) - { - if (size <= 32) - { - return 32; - } - else if (size > 32 && size <= 64) - { - return 64; - } - else if (size > 64 && size <= 128) - { - return 128; - } - else if (size > 128 && size <= 256) - { - return 256; - } - else if (size > 256 && size <= 512) - { - return 512; - } - else if (size > 512 && size <= 1024) - { - return 1024; - } - return 1024; - } - - public static void RecordSettings(List textureInfos) - { - if (textureInfos.Count == 0) - { - return; - } - if (File.Exists(CACHE_PATH)) - { - File.Delete(CACHE_PATH); - } - var guids = new List(); - var importsettings = new List(); - foreach (var info in textureInfos) - { - var textInfo = new BaseInfo(); - textInfo.assetPath = info.assetPath; - textInfo.maxTextureSize = info.maxTextureSize; - textInfo.mipmapEnabled = info.mipmapEnabled; - textInfo.isReadable = info.isReadable; - textInfo._webglFormat = info._webglFormat; - guids.Add(AssetDatabase.AssetPathToGUID(info.assetPath)); - importsettings.Add(textInfo); - } - using (FileStream fs = File.OpenWrite(CACHE_PATH)) - { - BinaryFormatter bf = new BinaryFormatter(); - bf.Serialize(fs, guids); - bf.Serialize(fs, importsettings); - } - } - - public static void Recover(List textureInfos) - { - if (File.Exists(CACHE_PATH)) - { - var guids = new List(); - var importSettings = new List(); - using (FileStream fs = File.OpenRead(CACHE_PATH)) - { - BinaryFormatter bf = new BinaryFormatter(); - guids = (List)bf.Deserialize(fs); - importSettings = (List)bf.Deserialize(fs); - } - - var totalCount = textureInfos.Count; - for (int i = 0; i < totalCount; i++) - { - string path = textureInfos[i].assetPath; - if (!string.IsNullOrEmpty(path)) - { - TextureImporterPlatformSettings settings = new TextureImporterPlatformSettings(); - EditorUtility.DisplayCancelableProgressBar("Recover", "Reading Cache " + i, (float)i / totalCount); - TextureImporter textureImporter = AssetImporter.GetAtPath(path) as TextureImporter; - BaseInfo info = importSettings[i]; - textureImporter.maxTextureSize = info.maxTextureSize; - textureImporter.mipmapEnabled = info.mipmapEnabled; - textureImporter.isReadable = info.isReadable; - settings.name = "WebGL"; - settings.format = info._webglFormat; - textureImporter.SetPlatformTextureSettings(settings); - textureImporter.SaveAndReimport(); - AssetDatabase.ImportAsset(path); - } - } - File.Delete(CACHE_PATH); - EditorUtility.ClearProgressBar(); - } - //Debug.Log("call undo"); - - //var list = new List(); - //foreach (var data in textureInfos) - //{ - // var texture = data.texture; - // list.Add(texture); - //} - //Selection.objects = list.ToArray(); - - //Undo.PerformUndo(); - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeTexture.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeTexture.cs.meta deleted file mode 100644 index 4b4184f9..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/OptimizeTexture.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 369d620a6ebd49d48b655b7f71fa0cd9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/PrefabWindow.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/PrefabWindow.cs deleted file mode 100644 index 1959480d..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/PrefabWindow.cs +++ /dev/null @@ -1,153 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.Linq; -using System; - -namespace WeChatWASM.Analysis -{ - public class PrefabWindow : BaseWindow - { - private AssetDataTable m_table; - private List selectedObjects; - private List originalInfos; - private List renderInfos; - - public class AssetDataTable : CommonTable - { - public AssetDataTable(List datas, - CommonTableColumn[] cs, - FilterMethod onfilter, - SelectMethod onselect = null) - : base(datas, cs, onfilter, onselect) - { - } - } - - public PrefabWindow() : base() - { - if (m_table == null) - { - var datas = new List(); - var cols = GetViewColumn(); - m_table = new AssetDataTable(datas, cols, OnFilter, OnRowSelect); - } - } - - public CommonTableColumn[] GetViewColumn() - { - var cols = new CommonTableColumn[] - { - new CommonTableColumn - { - headerContent = new GUIContent("name"), - canSort = true, - minWidth = 210, - width = 210, - Compare = (a,b) => -a.name.CompareTo(b.name), - DrawCell = (rect, data) => EditorGUI.LabelField(rect, data.name) - }, - new CommonTableColumn - { - headerContent = new GUIContent("path"), - canSort = true, - minWidth = 650, - width = 650, - Compare = (a,b) => -a.assetPath.CompareTo(b.assetPath), - DrawCell = (rect, data) => EditorGUI.LabelField(rect, data.assetPath) - } - }; - - return cols; - } - - public void OnRowSelect(List datas) - { - currentAssetPathList = datas.Select((info) => info.assetPath).ToArray(); - selectedObjects = new List(datas); - var list = new List(); - foreach (var data in datas) - { - var info = data._info; - list.Add(info); - } - Selection.objects = list.ToArray(); - } - - private bool OnFilter(PrefabInfo data, string std) - { - string name = std; - if (name.Length == 0) - { - return true; - } - return data.name.ToLower().IndexOf(name.ToLower()) > -1; - } - - public override void RefreshTable() - { - if (needUpdateMainContent) - { - needUpdateMainContent = false; - var cols = GetViewColumn(); - m_table = new AssetDataTable(renderInfos, cols, OnFilter, OnRowSelect); - } - m_table.OnGUI(); - } - - public override void DrawOptionArea() - { - GUILayout.Space(40); - if (GUILayout.Button("搜索prefab", GUILayout.Width(160), GUILayout.Height(40))) - { - CollectAssets(); - } - } - - public void CollectAssets(Boolean needRefreshCurrentFolder = true) - { - if (needRefreshCurrentFolder) - { - this.currentFolder = GetCurrentFolder(); - } - - originalInfos = new List(); - var guids = AssetDatabase.FindAssets("t:prefab", new[] { this.currentFolder }); - var count = guids.Length; - var current = 0; - foreach (string guid in guids) - { - current++; - EditorUtility.DisplayCancelableProgressBar("search prefab", "searching " + current, (float)current / count); - var obj = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid)); - PrefabAssetType pType = PrefabUtility.GetPrefabAssetType(obj); - if (pType == PrefabAssetType.Regular) - { - var filePath = AssetDatabase.GetAssetPath(obj); - originalInfos.Add(new PrefabInfo(obj, filePath)); - } - } - - EditorUtility.ClearProgressBar(); - - renderInfos = new List(originalInfos); - - needUpdateMainContent = true; - Selection.objects = null; - } - } - - public class PrefabInfo - { - public string assetPath; - public string name; - public GameObject _info; - - public PrefabInfo(GameObject info, string assetPath) - { - this._info = info; - this.assetPath = assetPath; - this.name = info.name; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/PrefabWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/PrefabWindow.cs.meta deleted file mode 100644 index b86d1933..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/PrefabWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f6b6e40684e6347479197156333a29e2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/ReferenceFinderData.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/ReferenceFinderData.cs deleted file mode 100644 index 3eac051c..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/ReferenceFinderData.cs +++ /dev/null @@ -1,255 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.Serialization.Formatters.Binary; -using UnityEditor; -using UnityEngine; - -namespace WeChatWASM.Analysis -{ - public class ReferenceFinderData - { - //缓存路径 - private const string CACHE_PATH = "Library/ReferenceFinderCache"; - //资源引用信息字典 - public Dictionary assetDict = new Dictionary(); - - //收集资源引用信息并更新缓存 - public void CollectDependenciesInfo() - { - try - { - //ReadFromCache(); - var allAssets = AssetDatabase.GetAllAssetPaths(); - int totalCount = allAssets.Length; - for (int i = 0; i < allAssets.Length; i++) - { - //每遍历100个Asset,更新一下进度条,同时对进度条的取消操作进行处理 - if ((i % 100 == 0) && EditorUtility.DisplayCancelableProgressBar("Refresh", string.Format("Collecting {0} assets", i), (float)i / totalCount)) - { - EditorUtility.ClearProgressBar(); - return; - } - if (File.Exists(allAssets[i])) - ImportAsset(allAssets[i]); - if (i % 2000 == 0) - GC.Collect(); - } - - ////将信息写入缓存 - //EditorUtility.DisplayCancelableProgressBar("Refresh", "Write to cache", 1f); - //WriteToChache(); - ////生成引用数据 - //EditorUtility.DisplayCancelableProgressBar("Refresh", "Generating asset reference info", 1f); - UpdateReferenceInfo(); - EditorUtility.ClearProgressBar(); - } - catch (Exception e) - { - Debug.LogError(e); - EditorUtility.ClearProgressBar(); - } - } - - //通过依赖信息更新引用信息 - private void UpdateReferenceInfo() - { - foreach (var asset in assetDict) - { - foreach (var assetGuid in asset.Value.dependencies) - { - assetDict[assetGuid].references.Add(asset.Key); - } - } - } - - //生成并加入引用信息 - private void ImportAsset(string path) - { - //通过path获取guid进行储存 - string guid = AssetDatabase.AssetPathToGUID(path); - //获取该资源的最后修改时间,用于之后的修改判断 - Hash128 assetDependencyHash = AssetDatabase.GetAssetDependencyHash(path); - //如果assetDict没包含该guid或包含了修改时间不一样则需要更新 - if (!assetDict.ContainsKey(guid) || assetDict[guid].assetDependencyHash != assetDependencyHash) - { - //将每个资源的直接依赖资源转化为guid进行储存 - var guids = AssetDatabase.GetDependencies(path, false). - Select(p => AssetDatabase.AssetPathToGUID(p)). - ToList(); - - //生成asset依赖信息,被引用需要在所有的asset依赖信息生成完后才能生成 - AssetDescription ad = new AssetDescription(); - ad.name = Path.GetFileNameWithoutExtension(path); - ad.path = path; - ad.assetDependencyHash = assetDependencyHash; - ad.dependencies = guids; - - if (assetDict.ContainsKey(guid)) - assetDict[guid] = ad; - else - assetDict.Add(guid, ad); - } - } - - //读取缓存信息 - public bool ReadFromCache() - { - assetDict.Clear(); - if (File.Exists(CACHE_PATH)) - { - var serializedGuid = new List(); - var serializedDependencyHash = new List(); - var serializedDenpendencies = new List(); - //反序列化数据 - using (FileStream fs = File.OpenRead(CACHE_PATH)) - { - BinaryFormatter bf = new BinaryFormatter(); - //EditorUtility.DisplayCancelableProgressBar("Import Cache", "Reading Cache", 0); - serializedGuid = (List)bf.Deserialize(fs); - serializedDependencyHash = (List)bf.Deserialize(fs); - serializedDenpendencies = (List)bf.Deserialize(fs); - //EditorUtility.ClearProgressBar(); - } - - for (int i = 0; i < serializedGuid.Count; ++i) - { - string path = AssetDatabase.GUIDToAssetPath(serializedGuid[i]); - if (!string.IsNullOrEmpty(path)) - { - var ad = new AssetDescription(); - ad.name = Path.GetFileNameWithoutExtension(path); - ad.path = path; - ad.assetDependencyHash = serializedDependencyHash[i]; - assetDict.Add(serializedGuid[i], ad); - } - } - - for (int i = 0; i < serializedGuid.Count; ++i) - { - string guid = serializedGuid[i]; - if (assetDict.ContainsKey(guid)) - { - var guids = serializedDenpendencies[i]. - Select(index => serializedGuid[index]). - Where(g => assetDict.ContainsKey(g)). - ToList(); - assetDict[guid].dependencies = guids; - } - } - UpdateReferenceInfo(); - return true; - } - return false; - } - - //写入缓存 - private void WriteToChache() - { - if (File.Exists(CACHE_PATH)) - File.Delete(CACHE_PATH); - - var serializedGuid = new List(); - var serializedDependencyHash = new List(); - var serializedDenpendencies = new List(); - //辅助映射字典 - var guidIndex = new Dictionary(); - //序列化 - using (FileStream fs = File.OpenWrite(CACHE_PATH)) - { - foreach (var pair in assetDict) - { - guidIndex.Add(pair.Key, guidIndex.Count); - serializedGuid.Add(pair.Key); - serializedDependencyHash.Add(pair.Value.assetDependencyHash); - } - - foreach (var guid in serializedGuid) - { - int[] indexes = assetDict[guid].dependencies.Select(s => guidIndex[s]).ToArray(); - serializedDenpendencies.Add(indexes); - } - - BinaryFormatter bf = new BinaryFormatter(); - bf.Serialize(fs, serializedGuid); - bf.Serialize(fs, serializedDependencyHash); - bf.Serialize(fs, serializedDenpendencies); - } - } - - //更新引用信息状态 - public void UpdateAssetState(string guid) - { - AssetDescription ad; - if (assetDict.TryGetValue(guid, out ad) && ad.state != AssetState.NODATA) - { - if (File.Exists(ad.path)) - { - //修改时间与记录的不同为修改过的资源 - if (ad.assetDependencyHash != AssetDatabase.GetAssetDependencyHash(ad.path)) - { - ad.state = AssetState.CHANGED; - } - else - { - //默认为普通资源 - ad.state = AssetState.NORMAL; - } - } - //不存在为丢失 - else - { - ad.state = AssetState.MISSING; - } - } - - //字典中没有该数据 - else if (!assetDict.TryGetValue(guid, out ad)) - { - string path = AssetDatabase.GUIDToAssetPath(guid); - ad = new AssetDescription(); - ad.name = Path.GetFileNameWithoutExtension(path); - ad.path = path; - ad.state = AssetState.NODATA; - assetDict.Add(guid, ad); - } - } - - //根据引用信息状态获取状态描述 - public static string GetInfoByState(AssetState state) - { - if (state == AssetState.CHANGED) - { - return "Changed"; - } - else if (state == AssetState.MISSING) - { - return "Missing"; - } - else if (state == AssetState.NODATA) - { - return "No Data"; - } - return "Normal"; - } - - public class AssetDescription - { - public string name = ""; - public string path = ""; - public Hash128 assetDependencyHash; - public List dependencies = new List(); - public List references = new List(); - public AssetState state = AssetState.NORMAL; - } - - public enum AssetState - { - NORMAL, - CHANGED, - MISSING, - NODATA, - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/ReferenceFinderData.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/ReferenceFinderData.cs.meta deleted file mode 100644 index 08a6ba68..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/ReferenceFinderData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 1a00bcbadc21a944794aa56d47279b44 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyDataStore.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyDataStore.cs deleted file mode 100644 index 21a92229..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyDataStore.cs +++ /dev/null @@ -1,135 +0,0 @@ -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; -using UnityEngine.Profiling; - -namespace WeChatWASM.Analysis -{ - internal class SerializedPropertyDataStore - { - private Data[] m_elements; - - private readonly GatherDelegate m_gatherDel; - - private Object[] m_objects; - - private readonly string[] m_propNames; - - public SerializedPropertyDataStore(string[] propNames, GatherDelegate gatherDel) - { - m_propNames = propNames; - m_gatherDel = gatherDel; - Repopulate(); - } - - public Data[] GetElements() - { - return m_elements; - } - - ~SerializedPropertyDataStore() - { - Clear(); - } - - public bool Repopulate() - { - Profiler.BeginSample("SerializedPropertyDataStore.Repopulate.GatherDelegate"); - var array = m_gatherDel(); - Profiler.EndSample(); - if (m_objects != null) - { - if (array.Length == m_objects.Length && - ArrayUtility.ArrayReferenceEquals(array, m_objects)) - { - return false; - } - Clear(); - } - m_objects = array; - m_elements = new Data[array.Length]; - for (var i = 0; i < array.Length; i++) - m_elements[i] = new Data(array[i], m_propNames); - return true; - } - - private void Clear() - { - foreach (var t in m_elements) - t.Dispose(); - m_objects = null; - m_elements = null; - } - - internal class Data - { - private Object m_object; - - public Data(Object obj, IList props) - { - m_object = obj; - SerializedObject = new SerializedObject(obj); - Properties = new SerializedProperty[props.Count]; - for (var i = 0; i < props.Count; i++) - Properties[i] = SerializedObject.FindProperty(props[i]); - } - - public string Name - { - get { return !(m_object != null) ? string.Empty : m_object.name; } - } - - public SerializedObject SerializedObject { get; private set; } - - public SerializedProperty[] Properties { get; private set; } - - public int ObjectId - { - get - { - int result; - if (!m_object) - { - result = 0; - } - else - { - var component = m_object as Component; - result = !(component != null) - ? m_object.GetInstanceID() - : component.gameObject.GetInstanceID(); - } - return result; - } - } - - public void Dispose() - { - var serializedProperties = Properties; - for (var i = 0; i < serializedProperties.Length; i++) - { - var serializedProperty = serializedProperties[i]; - if (serializedProperty != null) - serializedProperty.Dispose(); - } - SerializedObject.Dispose(); - m_object = null; - SerializedObject = null; - Properties = null; - } - - public bool Update() - { - return m_object != null && SerializedObject.UpdateIfRequiredOrScript(); - } - - public void Store() - { - if (m_object != null) - SerializedObject.ApplyModifiedProperties(); - } - } - - internal delegate Object[] GatherDelegate(); - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyDataStore.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyDataStore.cs.meta deleted file mode 100644 index 46d72ced..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyDataStore.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a64fa4108bbbbd24180bd924f26457f4 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyFilters.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyFilters.cs deleted file mode 100644 index b1b90c48..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyFilters.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using UnityEditor; -using UnityEngine; - -namespace WeChatWASM.Analysis -{ - internal class SerializedPropertyFilters - { - internal interface IFilter - { - bool Active(); - - bool Filter(SerializedProperty prop); - - void OnGUI(Rect r); - - string SerializeState(); - - void DeserializeState(string state); - } - - internal abstract class SerializableFilter : SerializedPropertyFilters.IFilter - { - public abstract bool Active(); - - public abstract bool Filter(SerializedProperty prop); - - public abstract void OnGUI(Rect r); - - public string SerializeState() - { - return JsonUtility.ToJson(this); - } - - public void DeserializeState(string state) - { - JsonUtility.FromJsonOverwrite(state, this); - } - } - - internal class String : SerializedPropertyFilters.SerializableFilter - { - private static class Styles - { - public static readonly GUIStyle searchField = "SearchTextField"; - - public static readonly GUIStyle searchFieldCancelButton = "SearchCancelButton"; - - public static readonly GUIStyle searchFieldCancelButtonEmpty = "SearchCancelButtonEmpty"; - } - - [SerializeField] - protected string m_Text = ""; - - public override bool Active() - { - return !string.IsNullOrEmpty(this.m_Text); - } - - public override bool Filter(SerializedProperty prop) - { - return prop.stringValue.IndexOf(this.m_Text, 0, StringComparison.OrdinalIgnoreCase) >= 0; - } - - public override void OnGUI(Rect r) - { - r.width -= 15f; - this.m_Text = EditorGUI.TextField(r, GUIContent.none, this.m_Text, SerializedPropertyFilters.String.Styles.searchField); - r.x += r.width; - r.width = 15f; - bool flag = this.m_Text != ""; - if (GUI.Button(r, GUIContent.none, (!flag) ? SerializedPropertyFilters.String.Styles.searchFieldCancelButtonEmpty : SerializedPropertyFilters.String.Styles.searchFieldCancelButton) && flag) - { - this.m_Text = ""; - GUIUtility.keyboardControl = 0; - } - } - } - - internal sealed class Name : SerializedPropertyFilters.String - { - public bool Filter(string str) - { - return str.IndexOf(this.m_Text, 0, StringComparison.OrdinalIgnoreCase) >= 0; - } - } - - internal sealed class None : SerializedPropertyFilters.IFilter - { - public bool Active() - { - return false; - } - - public bool Filter(SerializedProperty prop) - { - return true; - } - - public void OnGUI(Rect r) - { - } - - public string SerializeState() - { - return null; - } - - public void DeserializeState(string state) - { - } - } - - internal static readonly SerializedPropertyFilters.None s_FilterNone = new SerializedPropertyFilters.None(); - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyFilters.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyFilters.cs.meta deleted file mode 100644 index 4e5fe661..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyFilters.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 66f1c580c01b20b45aed097c7b7f5655 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTable.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTable.cs deleted file mode 100644 index 6591b409..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTable.cs +++ /dev/null @@ -1,141 +0,0 @@ -using UnityEditor; -using UnityEditor.IMGUI.Controls; -using UnityEngine; -using UnityEngine.Profiling; - -namespace WeChatWASM.Analysis -{ - internal class SerializedPropertyTable - { - private readonly float m_DragHeight = 20f; - - private readonly float m_DragWidth = 32f; - - private readonly float m_FilterHeight = 20f; - - private float m_ColumnHeaderHeight; - - private SerializedPropertyDataStore m_DataStore; - - private readonly SerializedPropertyDataStore.GatherDelegate m_GatherDelegate; - - private readonly HeaderDelegate m_HeaderDelegate; - - private bool m_Initialized; - - private MultiColumnHeaderState m_MultiColumnHeaderState; - - private readonly string m_SerializationUID; - - //private float m_TableHeight = 200f; - - private SerializedPropertyTreeView m_TreeView; - - private TreeViewState m_TreeViewState; - - public SerializedPropertyTable(string serializationUID, SerializedPropertyDataStore.GatherDelegate gatherDelegate, HeaderDelegate headerDelegate) - { - //dragHandleEnabled = true; - m_SerializationUID = serializationUID; - m_GatherDelegate = gatherDelegate; - m_HeaderDelegate = headerDelegate; - //OnEnable(); - } - - //public bool dragHandleEnabled { get; set; } - - private void InitIfNeeded() - { - if (!m_Initialized) - { - if (m_TreeViewState == null) - m_TreeViewState = new TreeViewState(); - if (m_MultiColumnHeaderState == null) - { - string[] propNames; - m_MultiColumnHeaderState = new MultiColumnHeaderState(m_HeaderDelegate(out propNames)); - m_DataStore = new SerializedPropertyDataStore(propNames, m_GatherDelegate); - } - var multiColumnHeader = new MultiColumnHeader(m_MultiColumnHeaderState); - m_ColumnHeaderHeight = multiColumnHeader.height; - m_TreeView = new SerializedPropertyTreeView(m_TreeViewState, multiColumnHeader, m_DataStore); - m_TreeView.DeserializeState(m_SerializationUID); - m_TreeView.Reload(); - m_Initialized = true; - } - } - - private float GetMinHeight() - { - var singleLineHeight = EditorGUIUtility.singleLineHeight; - var num = m_FilterHeight + m_ColumnHeaderHeight + singleLineHeight + m_DragHeight; - return num + singleLineHeight * 3f; - } - - public void OnInspectorUpdate() - { - if (m_DataStore != null && m_DataStore.Repopulate() && m_TreeView != null) - m_TreeView.FullReload(); - else if (m_TreeView != null && m_TreeView.Update()) - m_TreeView.Repaint(); - } - - public void OnHierarchyChange() - { - if (m_DataStore != null && m_DataStore.Repopulate() && m_TreeView != null) - m_TreeView.FullReload(); - } - - public void OnSelectionChange() - { - OnSelectionChange(Selection.instanceIDs); - } - - public void OnSelectionChange(int[] instanceIDs) - { - if (m_TreeView != null) - m_TreeView.SetSelection(instanceIDs); - } - - public void OnGUI() - { - Profiler.BeginSample("SerializedPropertyTable.OnGUI"); - InitIfNeeded(); - var rect = GUILayoutUtility.GetRect(0f, Screen.width, 0f, Screen.height); - if (Event.current.type != EventType.Layout) - { - rect.x += m_DragWidth; - rect.width -= m_DragWidth * 2; - - rect.y += m_DragHeight; - - var r = rect; - rect.y += m_FilterHeight; - rect.height = rect.height - m_FilterHeight - m_DragHeight * 2; - - var rect2 = rect; - Profiler.BeginSample("TreeView.OnGUI"); - m_TreeView.OnGUI(rect2); - Profiler.EndSample(); - - m_TreeView.OnFilterGUI(r); - if (m_TreeView.IsFilteredDirty()) - m_TreeView.Reload(); - Profiler.EndSample(); - } - } - - public void OnDisable() - { - if (m_TreeView != null) - m_TreeView.SerializeState(m_SerializationUID); - } - - private static class Styles - { - public static readonly GUIStyle DragHandle = "RL DragHandle"; - } - - internal delegate SerializedPropertyTreeView.Column[] HeaderDelegate(out string[] propNames); - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTable.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTable.cs.meta deleted file mode 100644 index 618bb3e8..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTable.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dcac989aac674be479bf8b07308aff05 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTreeView.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTreeView.cs deleted file mode 100644 index c97d7a64..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTreeView.cs +++ /dev/null @@ -1,479 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEditor.IMGUI.Controls; -using UnityEngine; -using UnityEngine.Profiling; -using Object = UnityEngine.Object; - -namespace WeChatWASM.Analysis -{ - internal class SerializedPropertyTreeView : TreeView - { - private bool m_bFilterSelection; - - private int m_ChangedId; - - private readonly ColumnInternal[] m_ColumnsInternal; - - private readonly SerializedPropertyDataStore m_DataStore; - - private List m_Items; - - private int[] m_SelectionFilter; - - public SerializedPropertyTreeView(TreeViewState state, MultiColumnHeader multicolumnHeader, - SerializedPropertyDataStore dataStore) - : base(state, multicolumnHeader) - { - m_DataStore = dataStore; - var num = multiColumnHeader.state.columns.Length; - m_ColumnsInternal = new ColumnInternal[num]; - for (var i = 0; i < num; i++) - { - var column = Col(i); - if (column.propertyName != null) - m_ColumnsInternal[i].dependencyProps = new SerializedProperty[column.propertyName.Length]; - } - multiColumnHeader.sortingChanged += OnSortingChanged; - multiColumnHeader.visibleColumnsChanged += OnVisibleColumnChanged; - showAlternatingRowBackgrounds = true; - showBorder = true; - rowHeight = EditorGUIUtility.singleLineHeight; - } - - public void SerializeState(string uid) - { - SessionState.SetBool(uid + Styles.serializeFilterSelection, - m_bFilterSelection); - for (var i = 0; i < multiColumnHeader.state.columns.Length; i++) - { - var filter = Col(i).filter; - if (filter != null) - { - var value = filter.SerializeState(); - if (!string.IsNullOrEmpty(value)) - SessionState.SetString(uid + Styles.serializeFilter + i, value); - } - } - SessionState.SetString(uid + Styles.serializeTreeViewState, - JsonUtility.ToJson(state)); - SessionState.SetString(uid + Styles.serializeColumnHeaderState, - JsonUtility.ToJson(multiColumnHeader.state)); - } - - public void DeserializeState(string uid) - { - m_bFilterSelection = - SessionState.GetBool(uid + Styles.serializeFilterSelection, false); - for (var i = 0; i < multiColumnHeader.state.columns.Length; i++) - { - var filter = Col(i).filter; - if (filter != null) - { - var @string = SessionState.GetString(uid + Styles.serializeFilter + i, - null); - if (!string.IsNullOrEmpty(@string)) - filter.DeserializeState(@string); - } - } - var string2 = SessionState.GetString(uid + Styles.serializeTreeViewState, ""); - var string3 = SessionState.GetString(uid + Styles.serializeColumnHeaderState, - ""); - if (!string.IsNullOrEmpty(string2)) - JsonUtility.FromJsonOverwrite(string2, state); - if (!string.IsNullOrEmpty(string3)) - JsonUtility.FromJsonOverwrite(string3, multiColumnHeader.state); - } - - public bool IsFilteredDirty() - { - return m_ChangedId != 0 && (m_ChangedId != GUIUtility.keyboardControl || - !EditorGUIUtility.editingTextField); - } - - public bool Update() - { - var rows = GetRows(); - int num; - int num2; - GetFirstAndLastVisibleRows(out num, out num2); - var flag = false; - if (num2 != -1) - for (var i = num; i <= num2; i++) - flag = flag || ((SerializedPropertyItem)rows[i]).GetData().Update(); - return flag; - } - - public void FullReload() - { - m_Items = null; - Reload(); - } - - protected override TreeViewItem BuildRoot() - { - return new SerializedPropertyItem(-1, -1, null); - } - - protected override IList BuildRows(TreeViewItem root) - { - if (m_Items == null) - { - var elements = m_DataStore.GetElements(); - m_Items = new List(elements.Length); - for (var i = 0; i < elements.Length; i++) - { - var item2 = new SerializedPropertyItem(elements[i].ObjectId, 0, elements[i]); - m_Items.Add(item2); - } - } - IEnumerable enumerable = m_Items; - if (m_bFilterSelection) - { - if (m_SelectionFilter == null) - m_SelectionFilter = Selection.instanceIDs; - enumerable = from item in m_Items - where m_SelectionFilter.Contains(item.id) - select item; - } - else - { - m_SelectionFilter = null; - } - enumerable = Filter(enumerable); - var list = enumerable.ToList(); - if (multiColumnHeader.sortedColumnIndex >= 0) - Sort(list, multiColumnHeader.sortedColumnIndex); - m_ChangedId = 0; - //TreeViewUtility.SetParentAndChildrenForItems(list, root); - return list; - } - - protected override void RowGUI(RowGUIArgs args) - { - var item = - (SerializedPropertyItem)args.item; - for (var i = 0; i < args.GetNumVisibleColumns(); i++) - CellGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args); - } - - private void CellGUI(Rect cellRect, SerializedPropertyItem item, int columnIndex, - ref RowGUIArgs args) - { - Profiler.BeginSample("SerializedPropertyTreeView.CellGUI"); - CenterRectUsingSingleLineHeight(ref cellRect); - var data = item.GetData(); - var column = (Column)multiColumnHeader.GetColumn(columnIndex); - if (column.drawDelegate == DefaultDelegates.s_DrawName) - { - Profiler.BeginSample("SerializedPropertyTreeView.OnItemGUI.LabelField"); - DefaultGUI.Label(cellRect, data.Name, IsSelected(args.item.id), false); - Profiler.EndSample(); - } - else if (column.drawDelegate != null) - { - var properties = data.Properties; - var num = column.dependencyIndices == null ? 0 : column.dependencyIndices.Length; - for (var i = 0; i < num; i++) - m_ColumnsInternal[columnIndex].dependencyProps[i] = properties[column.dependencyIndices[i]]; - if (args.item.id == state.lastClickedID && HasFocus() && columnIndex == multiColumnHeader.state.visibleColumns[multiColumnHeader.state.visibleColumns[0] != 0 ? 0 : 1]) - GUI.SetNextControlName(Styles.focusHelper); - var serializedProperty = data.Properties[columnIndex]; - EditorGUI.BeginChangeCheck(); - Profiler.BeginSample("SerializedPropertyTreeView.OnItemGUI.drawDelegate"); - column.drawDelegate(cellRect, serializedProperty, m_ColumnsInternal[columnIndex].dependencyProps); - Profiler.EndSample(); - if (EditorGUI.EndChangeCheck()) - { - m_ChangedId = column.filter == null || !column.filter.Active() - ? m_ChangedId - : GUIUtility.keyboardControl; - data.Store(); - var selection = GetSelection(); - if (selection.Contains(data.ObjectId)) - { - var list = FindRows(selection); - Undo.RecordObjects((from r in list - select ((SerializedPropertyItem)r).GetData() - .SerializedObject.targetObject).ToArray(), - "Modify Multiple Properties"); - foreach (var current in list) - if (current.id != args.item.id) - { - var data2 = - ((SerializedPropertyItem)current).GetData(); - if (IsEditable(data2.SerializedObject.targetObject)) - { - if (column.copyDelegate != null) - column.copyDelegate(data2.Properties[columnIndex], serializedProperty); - else - DefaultDelegates.s_CopyDefault(data2.Properties[columnIndex], - serializedProperty); - data2.Store(); - } - } - } - } - Profiler.EndSample(); - } - } - - private static bool IsEditable(Object target) - { - return (target.hideFlags & HideFlags.NotEditable) == HideFlags.None; - } - - protected override void BeforeRowsGUI() - { - var rows = GetRows(); - int num; - int num2; - GetFirstAndLastVisibleRows(out num, out num2); - if (num2 != -1) - for (var i = num; i <= num2; i++) - ((SerializedPropertyItem)rows[i]).GetData().Update(); - var list = FindRows(GetSelection()); - using (var enumerator = list.GetEnumerator()) - { - while (enumerator.MoveNext()) - { - var serializedPropertyItem = - (SerializedPropertyItem)enumerator.Current; - serializedPropertyItem.GetData().Update(); - } - } - base.BeforeRowsGUI(); - } - - public void OnFilterGUI(Rect r) - { - EditorGUI.BeginChangeCheck(); - var width = r.width; - var num = 16f; - r.width = num; - m_bFilterSelection = EditorGUI.Toggle(r, m_bFilterSelection); - r.x += num; - r.width = GUI.skin.label.CalcSize(Styles.filterSelection).x; - EditorGUI.LabelField(r, Styles.filterSelection); - r.width = Mathf.Min(width - (r.x + r.width), 300f); - r.x = width - r.width + 25; - for (var i = 0; i < multiColumnHeader.state.columns.Length; i++) - { - if (IsColumnVisible(i)) - { - var column = Col(i); - if (column.filter != null && column.filter.GetType().Equals(typeof(SerializedPropertyFilters.Name))) - column.filter.OnGUI(r); - } - } - if (EditorGUI.EndChangeCheck()) - Reload(); - } - - protected override void SelectionChanged(IList selectedIds) - { - Selection.instanceIDs = selectedIds.ToArray(); - } - - protected override void KeyEvent() - { - if (Event.current.type == EventType.KeyDown) - if (Event.current.character == '\t') - { - GUI.FocusControl(Styles.focusHelper); - Event.current.Use(); - } - } - - private void OnVisibleColumnChanged(MultiColumnHeader header) - { - Reload(); - } - - private void OnSortingChanged(MultiColumnHeader multiColumnHeader) - { - var rows = GetRows(); - Sort(rows, multiColumnHeader.sortedColumnIndex); - } - - private void Sort(IList rows, int sortIdx) - { - var flag = multiColumnHeader.IsSortedAscending(sortIdx); - var comp = Col(sortIdx).compareDelegate; - var list = rows as List; - if (comp != null) - { - Comparison comparison; - Comparison comparison2; - if (comp == DefaultDelegates.s_CompareName) - { - comparison = (lhs, rhs) => EditorUtility.NaturalCompare( - ((SerializedPropertyItem)lhs).GetData().Name, - ((SerializedPropertyItem)rhs).GetData().Name); - comparison2 = (lhs, rhs) => -EditorUtility.NaturalCompare( - ((SerializedPropertyItem)lhs).GetData().Name, - ((SerializedPropertyItem)rhs).GetData().Name); - } - else - { - comparison = (lhs, rhs) => comp( - ((SerializedPropertyItem)lhs).GetData().Properties[sortIdx], - ((SerializedPropertyItem)rhs).GetData().Properties[sortIdx]); - comparison2 = (lhs, rhs) => -comp( - ((SerializedPropertyItem)lhs).GetData().Properties[sortIdx], - ((SerializedPropertyItem)rhs).GetData().Properties[sortIdx]); - } - list.Sort(!flag ? comparison2 : comparison); - } - } - - private IEnumerable Filter(IEnumerable rows) - { - var enumerable = rows; - var num = m_ColumnsInternal.Length; - for (var i = 0; i < num; i++) - if (IsColumnVisible(i)) - { - var c = Col(i); - var idx = i; - if (c.filter != null) - if (c.filter.Active()) - if (c.filter.GetType().Equals(typeof(SerializedPropertyFilters.Name))) - { - var f = (SerializedPropertyFilters.Name)c.filter; - enumerable = from item in enumerable - where f.Filter(((SerializedPropertyItem)item).GetData().Name) - select item; - } - else - { - enumerable = from item in enumerable - where c.filter.Filter(((SerializedPropertyItem)item) - .GetData() - .Properties[idx]) - select item; - } - } - return enumerable; - } - - private bool IsColumnVisible(int idx) - { - bool result; - for (var i = 0; i < multiColumnHeader.state.visibleColumns.Length; i++) - if (multiColumnHeader.state.visibleColumns[i] == idx) - { - result = true; - return result; - } - result = false; - return result; - } - - private Column Col(int idx) - { - return (Column)multiColumnHeader.state.columns[idx]; - } - - - internal class SerializedPropertyItem : TreeViewItem - { - private readonly SerializedPropertyDataStore.Data m_Data; - - public SerializedPropertyItem(int id, int depth, SerializedPropertyDataStore.Data ltd) - : base(id, depth, ltd == null ? "root" : ltd.Name) - { - m_Data = ltd; - } - - public SerializedPropertyDataStore.Data GetData() - { - return m_Data; - } - } - - internal class Column : MultiColumnHeaderState.Column - { - public delegate int CompareEntry(SerializedProperty lhs, SerializedProperty rhs); - - public delegate void CopyDelegate(SerializedProperty target, SerializedProperty source); - - public delegate void DrawEntry(Rect r, SerializedProperty prop, SerializedProperty[] dependencies); - - public CompareEntry compareDelegate = null; - - public CopyDelegate copyDelegate = null; - - public int[] dependencyIndices = null; - - public DrawEntry drawDelegate = null; - - public SerializedPropertyFilters.IFilter filter = null; - - public string propertyName = null; - } - - private struct ColumnInternal - { - public SerializedProperty[] dependencyProps; - } - - internal class DefaultDelegates - { - public static readonly Column.DrawEntry s_DrawDefault = delegate(Rect r, SerializedProperty prop, SerializedProperty[] dependencies) - { - Profiler.BeginSample("PropDrawDefault"); - EditorGUI.PropertyField(r, prop, GUIContent.none); - Profiler.EndSample(); - }; - - public static readonly Column.DrawEntry s_DrawCheckbox = delegate(Rect r, SerializedProperty prop, SerializedProperty[] dependencies) - { - Profiler.BeginSample("PropDrawCheckbox"); - var num = r.width / 2f - 8f; - r.x += num < 0f ? 0f : num; - EditorGUI.PropertyField(r, prop, GUIContent.none); - Profiler.EndSample(); - }; - - public static readonly Column.DrawEntry s_DrawName = delegate { }; - - public static readonly Column.CompareEntry s_CompareFloat = - (SerializedProperty lhs, SerializedProperty rhs) => lhs.floatValue.CompareTo(rhs.floatValue); - - public static readonly Column.CompareEntry s_CompareCheckbox = - (SerializedProperty lhs, SerializedProperty rhs) => lhs.boolValue.CompareTo(rhs.boolValue); - - public static readonly Column.CompareEntry s_CompareEnum = - (SerializedProperty lhs, SerializedProperty rhs) => lhs.enumValueIndex.CompareTo(rhs.enumValueIndex); - - public static readonly Column.CompareEntry s_CompareInt = - (SerializedProperty lhs, SerializedProperty rhs) => lhs.intValue.CompareTo(rhs.intValue); - - public static readonly Column.CompareEntry s_CompareColor = - delegate(SerializedProperty lhs, SerializedProperty rhs) - { - float num; - float num2; - float num3; - Color.RGBToHSV(lhs.colorValue, out num, out num2, out num3); - float value; - float num4; - float num5; - Color.RGBToHSV(rhs.colorValue, out value, out num4, out num5); - return num.CompareTo(value); - }; - - public static readonly Column.CompareEntry s_CompareName = - (SerializedProperty lhs, SerializedProperty rhs) => 0; - - public static readonly Column.CopyDelegate s_CopyDefault = - delegate(SerializedProperty target, SerializedProperty source) - { - target.serializedObject.CopyFromSerializedProperty(source); - }; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTreeView.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTreeView.cs.meta deleted file mode 100644 index 4c02c8fb..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/SerializedPropertyTreeView.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 93a5c5e05a8ac744593adecef346aba2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Styles.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Styles.cs deleted file mode 100644 index 006ce0c6..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Styles.cs +++ /dev/null @@ -1,42 +0,0 @@ -using UnityEngine; - -namespace WeChatWASM.Analysis -{ - internal static class Styles - { - public static readonly GUIStyle entryEven = "OL EntryBackEven"; - - public static readonly GUIStyle entryOdd = "OL EntryBackOdd"; - - public static readonly string focusHelper = "SerializedPropertyTreeViewFocusHelper"; - - public static readonly string serializeFilterSelection = "_FilterSelection"; - - public static readonly string serializeFilterDisable = "_FilterDisable"; - - public static readonly string serializeFilterInvert = "_FilterInvert"; - - public static readonly string serializeTreeViewState = "_TreeViewState"; - - public static readonly string serializeColumnHeaderState = "_ColumnHeaderState"; - - public static readonly string serializeFilter = "_Filter_"; - - public static readonly GUIContent filterSelection = - new GUIContent("Lock Selection|Limits the table contents to the active selection."); - //EditorGUIUtility.TextContent("Lock Selection|Limits the table contents to the active selection."); - - public static readonly GUIContent filterDisable = new GUIContent("Disable All|Disables all filters."); - //EditorGUIUtility.TextContent("Disable All|Disables all filters."); - - public static readonly GUIContent filterInvert = - new GUIContent("Invert Result|Inverts the filtered results."); - - public static readonly GUIStyle searchField = "SearchTextField"; - - public static readonly GUIStyle searchFieldCancelButton = "SearchCancelButton"; - - public static readonly GUIStyle searchFieldCancelButtonEmpty = "SearchCancelButtonEmpty"; - //EditorGUIUtility.TextContent("Invert Result|Inverts the filtered results."); - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Styles.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Styles.cs.meta deleted file mode 100644 index 974d5ee2..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/Styles.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5b841dfa9061ee246bc65f481fe18160 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/TextureWindow.cs b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/TextureWindow.cs deleted file mode 100644 index d70eec1b..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/TextureWindow.cs +++ /dev/null @@ -1,520 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.IO; -using System; -using UnityEngine.Profiling; -using System.Collections.Generic; -using UnityEditor.IMGUI.Controls; -using System.Linq; - -namespace WeChatWASM.Analysis -{ - public class TextureWindow : BaseWindow - { - private AssetDataTable m_table; - - //Vector2 assetListScrollPosition = Vector2.zero; - - public List textureInfos = new List(); - public List renderTextureInfos = new List(); - public List selectedTextureInfos = new List(); - - // 检查规则 - public Boolean checkMipMap = false; - public Boolean formatError = false; - public Boolean checkIsReadable = false; - public Boolean checkMaxSize = false; - - // checkbox - public Boolean disableReadable = true; - public Boolean disableMipmap = true; - public Boolean changeMaxSize = true; - public Boolean changeFormat = true; - public int selectedMaxSizeIdx = 0; - public string[] maxSizeOptions = new string[] { "自动减半", "32", "64", "128", "256", "512", "1024", "2048" }; - public int selectedFormat = 0; - public Dictionary formatMap = new Dictionary() { - { "Auto", TextureImporterFormat.Automatic }, - { "Alpha 8", TextureImporterFormat.Alpha8 }, - { "RGB 24 bit", TextureImporterFormat.RGB24 }, - { "RGBA 32 bit", TextureImporterFormat.RGBA32 }, - { "RGB 16 bit", TextureImporterFormat.RGB16 }, - { "R 16 bit", TextureImporterFormat.R16 }, - { "RGB Compressed DXT1", TextureImporterFormat.DXT1 }, - { "RGBA Compressed DXT5", TextureImporterFormat.DXT5 }, - { "RGB Crunched DXT1", TextureImporterFormat.DXT1Crunched }, - { "RGBA Crunched DXT5", TextureImporterFormat.DXT5Crunched }, - { "R 8", TextureImporterFormat.R8 } - }; - - - // dropdown - public string[] extOptions = new List().ToArray(); - public int extSelected = 0; - public string[] textureFormatOptions = new List().ToArray(); - public int textureFormatSelected = 0; - public string[] webglFormatOptions = new List().ToArray(); - public int webglFormatSelected = 0; - public string[] isReadableOptions = new string[] { "all", "true", "false" }; - public int isReadableSelected = 0; - public string[] mipmapEnableOptions = new string[] { "all", "true", "false" }; - public int mipmapEnableSelected = 0; - - public TextureWindow() : base() - { - if (m_table == null) - { - var datas = new List(); - var cols = GetOverViewColumn(); - m_table = new AssetDataTable(datas, cols, OnFilter, OnRowSelect, OnSelectAllChange); - } - } - - public class AssetDataTable : CommonTable - { - public AssetDataTable(List datas, - CommonTableColumn[] cs, - FilterMethod onfilter, - SelectMethod onselect = null, - Action toggleSelectAll = null) - : base(datas, cs, onfilter, onselect, toggleSelectAll) - { - } - } - - public CommonTableColumn[] GetOverViewColumn() - { - //init columns - var cols = new CommonTableColumn[] - { - new CommonTableColumn - { - headerContent = new GUIContent("name"), //header display name - canSort = true, // - minWidth = 170, - width = 170, - Compare = (a,b)=>-a.name.CompareTo(b.name), //sort method - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.name), - }, - new CommonTableColumn - { - headerContent = new GUIContent("webglFormat"),//header display name - canSort = true, - width = 150, - minWidth = 90, - Compare = (a, b)=>-a.webglFormat.CompareTo(b.webglFormat), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.webglFormat), - }, - new CommonTableColumn - { - headerContent = new GUIContent("memorySize"),//header display name - canSort = true, - width = 120, - minWidth = 120, - Compare = (a, b)=>-a._memorySize.CompareTo(b._memorySize), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.memorySize.ToString()), - }, - new CommonTableColumn - { - headerContent = new GUIContent("maxTextureSize"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a, b)=>-a.maxTextureSize.CompareTo(b.maxTextureSize), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.maxTextureSize.ToString()), - }, - new CommonTableColumn - { - headerContent = new GUIContent("width"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a, b)=>-a.width.CompareTo(b.width), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.width.ToString()), - }, - new CommonTableColumn - { - headerContent = new GUIContent("height"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a, b)=>-a.height.CompareTo(b.height), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.height.ToString()), - }, - new CommonTableColumn - { - headerContent = new GUIContent("extenstion"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a,b)=>-a.ext.CompareTo(b.ext),//sort method - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.ext), - }, - new CommonTableColumn - { - headerContent = new GUIContent("dimension"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a,b)=>-a.dimension.CompareTo(b.dimension),//sort method - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.dimension), - }, - new CommonTableColumn - { - headerContent = new GUIContent("textureType"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a,b)=>-a.textureType.CompareTo(b.textureType),//sort method - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.textureType), - }, - new CommonTableColumn - { - headerContent = new GUIContent("textureFormat"),//header display name - canSort = true, - width = 120, - minWidth = 120, - Compare = (a, b)=>-a.textureFormat.CompareTo(b.textureFormat), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.textureFormat), - }, - new CommonTableColumn - { - headerContent = new GUIContent("isReadable"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a, b)=>-a.isReadable.CompareTo(b.isReadable), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.isReadable.ToString()), - }, - new CommonTableColumn - { - headerContent = new GUIContent("mipmapEnabled"),//header display name - canSort = true, - width = 90, - minWidth = 90, - Compare = (a, b)=>-a.mipmapEnabled.CompareTo(b.mipmapEnabled), - DrawCell = (rect,data)=>EditorGUI.LabelField(rect,data.mipmapEnabled.ToString()), - }, - }; - return cols; - } - - private void OnRowSelect(List datas) - { - currentAssetPathList = datas.Select((info) => info.assetPath).ToArray(); - selectedTextureInfos = new List(datas); - var list = new List(); - foreach (var data in datas) - { - var texture = data.texture; - list.Add(texture); - } - Selection.objects = list.ToArray(); - } - - private void OnSelectAllChange(Boolean isCheckAll) - { - if (!isCheckAll) - { - selectedTextureInfos = new List(); - Selection.objects = null; - } - } - - private bool OnFilter(TextureInfo data, string std) - { - string name = std; - if (name.Length == 0) - { - return true; - } - return data.name.ToLower().IndexOf(name.ToLower()) > -1; - } - - public override void DrawOptionArea() - { - GUILayout.Space(40); - if (GUILayout.Button("搜索选中目录下资源", GUILayout.Width(160), GUILayout.Height(40))) - { - CollectAssets(); - } - - GUILayout.Label("搜索规则"); - checkMipMap = EditorGUILayout.ToggleLeft("已开启MipMap", checkMipMap); - formatError = EditorGUILayout.ToggleLeft("NPOT", formatError); - checkIsReadable = EditorGUILayout.ToggleLeft("isReadable", checkIsReadable); - checkMaxSize = EditorGUILayout.ToggleLeft("MaxSize大于512", checkMaxSize); - - GUILayout.Space(10); - - if (GUILayout.Button("修复选中资源", GUILayout.Width(160), GUILayout.Height(40))) - { - if (selectedTextureInfos.Count > 0) - { - OptimizeTexture.Optimize(selectedTextureInfos); - CollectAssets(false); - } - } - if (GUILayout.Button("还原选中资源", GUILayout.Width(160), GUILayout.Height(40))) - { - OptimizeTexture.Recover(selectedTextureInfos); - CollectAssets(false); - } - GUILayout.Label("修复规则"); - disableReadable = EditorGUILayout.ToggleLeft("禁用isReadable", disableReadable); - disableMipmap = EditorGUILayout.ToggleLeft("禁用MipMap", disableMipmap); - changeMaxSize = EditorGUILayout.ToggleLeft("优化MaxSize", changeMaxSize); - changeFormat = EditorGUILayout.ToggleLeft("改变纹理压缩格式", changeFormat); - if (changeMaxSize) - { - selectedMaxSizeIdx = EditorGUILayout.Popup("MaxSize", selectedMaxSizeIdx, maxSizeOptions); - } - if (changeFormat) - { - selectedFormat = EditorGUILayout.Popup("Format", selectedFormat, new List(formatMap.Keys).ToArray()); - } - - //GUILayout.FlexibleSpace(); - GUILayout.Space(10); - GUILayout.Label("列表筛选项"); - - string ext = ""; - string webglFormat = ""; - string textureFormat = ""; - string isReadable = ""; - string mipmapEnable = ""; - - if (extOptions.Length > 0) - { - var selected = 0; - selected = EditorGUILayout.Popup("extension", extSelected, extOptions); - if (selected != extSelected) - { - needUpdateMainContent = true; - } - extSelected = selected; - ext = extOptions[extSelected]; - } - if (webglFormatOptions.Length > 0) - { - var selected = 0; - selected = EditorGUILayout.Popup("webglformat", webglFormatSelected, webglFormatOptions); - if (selected != webglFormatSelected) - { - needUpdateMainContent = true; - } - webglFormatSelected = selected; - webglFormat = webglFormatOptions[webglFormatSelected]; - } - if (textureFormatOptions.Length > 0) - { - var selected = 0; - selected = EditorGUILayout.Popup("textureFormat", textureFormatSelected, textureFormatOptions); - if (selected != textureFormatSelected) - { - needUpdateMainContent = true; - } - textureFormatSelected = selected; - textureFormat = textureFormatOptions[textureFormatSelected]; - } - if (isReadableOptions.Length > 0) - { - var selected = 0; - selected = EditorGUILayout.Popup("isReadable", isReadableSelected, isReadableOptions); - if (selected != isReadableSelected) - { - needUpdateMainContent = true; - } - isReadableSelected = selected; - isReadable = isReadableOptions[isReadableSelected]; - } - if (mipmapEnableOptions.Length > 0) - { - var selected = 0; - selected = EditorGUILayout.Popup("mipmapEnable", mipmapEnableSelected, mipmapEnableOptions); - if (selected != mipmapEnableSelected) - { - needUpdateMainContent = true; - } - mipmapEnableSelected = selected; - mipmapEnable = mipmapEnableOptions[mipmapEnableSelected]; - } - - FilterAsset(ext, webglFormat, textureFormat, isReadable, mipmapEnable); - - GUILayout.Space(10); - DrawOverview(); - - GUILayout.FlexibleSpace(); - } - - public void DrawOverview() - { - GUILayout.Label("总览"); - EditorGUILayout.LabelField("资源个数", renderTextureInfos.Count.ToString()); - EditorGUILayout.LabelField("资源总内存", EditorUtility.FormatBytes(renderTextureInfos.Aggregate((long)0, (account, current) => account += current.originalMemorySize))); - } - - public void CollectAssets(Boolean needRefreshCurrentFolder = true) - { - if (needRefreshCurrentFolder) - { - this.currentFolder = GetCurrentFolder(); - } - var guids = AssetDatabase.FindAssets("t:texture", new[] { this.currentFolder }); - textureInfos = new List(); - var exts = new List(); - var webglFormat = new List(); - var count = guids.Length; - var current = 0; - - foreach (string guid in guids) - { - current++; - var texture = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid)); - TextureImporter textureImporter; - if (OptimizeTexture.CheckNeedOptimization(texture, out textureImporter)) - { - if (textureImporter) - { - EditorUtility.DisplayCancelableProgressBar("search texture", "searching " + current, (float)current / count); - exts.Add(Path.GetExtension(AssetDatabase.GetAssetPath(texture)).ToString()); - webglFormat.Add(textureImporter.GetAutomaticFormat("WebGL").ToString()); - textureInfos.Add(new TextureInfo(textureImporter, texture)); - } - } - } - - EditorUtility.ClearProgressBar(); - renderTextureInfos = new List(textureInfos); - extOptions = (string[])exts.Distinct().Prepend("all").ToArray(); - webglFormatOptions = (string[])webglFormat.Distinct().Prepend("all").ToArray(); - needUpdateMainContent = true; - selectedTextureInfos = new List(); - Selection.objects = null; - } - - public Boolean FilterAsset(string ext, string webglFormat, string textureFormat, string isReadable, string mipmapEnable) - { - var needFilteExt = !string.IsNullOrEmpty(ext) && ext != "all"; - var needFilteWebglFormat = !string.IsNullOrEmpty(webglFormat) && webglFormat != "all"; - var needFilteTextureFormat = !string.IsNullOrEmpty(textureFormat) && textureFormat != "all"; - var needFilteIsReadable = !string.IsNullOrEmpty(isReadable) && isReadable != "all"; - var needfilteMipmapEnable = !string.IsNullOrEmpty(mipmapEnable) && mipmapEnable != "all"; - renderTextureInfos = textureInfos.Where(info => - { - var extValid = true; - var webglFormatValid = true; - var textureFormatValid = true; - var isReadableValid = true; - var mipmapValid = true; - if (needFilteExt) - { - extValid = info.ext.Equals(ext, StringComparison.InvariantCultureIgnoreCase); - } - if (needFilteWebglFormat) - { - webglFormatValid = info.webglFormat.Equals(webglFormat, StringComparison.InvariantCultureIgnoreCase); - } - if (needFilteTextureFormat) - { - textureFormatValid = info.textureFormat.Equals(textureFormat, StringComparison.InvariantCultureIgnoreCase); - } - if (needFilteIsReadable) - { - isReadableValid = info.isReadable.ToString().Equals(isReadable, StringComparison.InvariantCultureIgnoreCase); - } - if (needfilteMipmapEnable) - { - mipmapValid = info.mipmapEnabled.ToString().Equals(mipmapEnable, StringComparison.InvariantCultureIgnoreCase); - } - - return extValid && webglFormatValid && textureFormatValid && isReadableValid && mipmapValid; - }).ToList(); - return needFilteExt || needFilteWebglFormat || needFilteTextureFormat || needFilteIsReadable || needfilteMipmapEnable; - } - - public override void RefreshTable() - { - if (needUpdateMainContent) - { - needUpdateMainContent = false; - var cols = GetOverViewColumn(); - m_table = new AssetDataTable(renderTextureInfos, cols, OnFilter, OnRowSelect, OnSelectAllChange); - } - m_table.OnGUI(); - } - } - - public class TextureInfo : BaseInfo - { - private TextureImporter _info; - private Texture _texture; - - public TextureInfo() - { - - } - - public Texture texture - { - get { return _texture; } - } - - public TextureInfo(TextureImporter info, Texture texture) - { - var _info = info.GetPlatformTextureSettings("WebGL"); - this._info = info; - this._texture = texture; - this.mipmapEnabled = info.mipmapEnabled; - //this.maxTextureSize = info.maxTextureSize; - this.maxTextureSize = _info.maxTextureSize; - this.textureFormat = info.textureCompression.ToString(); - if (_info.format == TextureImporterFormat.Automatic) - { - this._webglFormat = info.GetAutomaticFormat("WebGL"); - } - else - { - this._webglFormat = _info.format; - } - this.webglFormat = this._webglFormat.ToString(); - this.textureType = info.textureType.ToString(); - this.sRGBTexture = info.sRGBTexture; - this.isReadable = info.isReadable; - this.compressionQuality = info.compressionQuality; - this.assetPath = info.assetPath; - this.width = texture.width; - this.height = texture.height; - this.originalMemorySize = Profiler.GetRuntimeMemorySizeLong(texture); - this.memorySize = EditorUtility.FormatBytes(this.originalMemorySize); - this._memorySize = this.originalMemorySize; - this.name = texture.name; - this.dimension = texture.dimension.ToString(); - this.ext = Path.GetExtension(AssetDatabase.GetAssetPath(texture)).ToString(); - } - } - - [Serializable] - public class BaseInfo - { - public bool mipmapEnabled; - public int maxTextureSize; - public string textureFormat; - public string textureType; - public bool sRGBTexture; - public bool isReadable; - public int compressionQuality; - public string assetPath; - public int width; - public int height; - public string memorySize; - public long _memorySize; - public string name; - public TextureImporterFormat _webglFormat; - public string webglFormat; - public string dimension; - public string ext; - public long originalMemorySize; - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/TextureWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/TextureWindow.cs.meta deleted file mode 100644 index c8302e19..00000000 --- a/Assets/WX-WASM-SDK/Editor/MinigameAssetAnalysis/TextureWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f56be9693b9d775419c521676c9d04f4 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node.meta b/Assets/WX-WASM-SDK/Editor/Node.meta deleted file mode 100644 index c193a893..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1a1c0768ec9934e188d938226c248f56 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/_docompress.js b/Assets/WX-WASM-SDK/Editor/Node/_docompress.js deleted file mode 100644 index 360c3638..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/_docompress.js +++ /dev/null @@ -1,271 +0,0 @@ -const fs = require('fs'); -const Conf = require('./conf'); -const { spawn } = require('child_process'); -const os = require('os'); -//最多同时调用4个子进程,如果觉得卡死了电脑可以把这个改小,但是生成速度就会变慢 -const MaxThreadCount = 4; -// 判断是M1芯片 -const isM1 = os.cpus().some((v)=>v.model.toLowerCase().indexOf('apple')>-1); -const potList = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; -//模拟信号量 -const Semaphore = { - _count:0, - _waitList:[], - waitOne(){ - return new Promise((resolve)=>{ - if(this._count < MaxThreadCount){ - this._count++; - resolve(); - }else{ - this._waitList.push(resolve); - } - }) - }, - release(){ - const resolve = this._waitList.shift(); - if(!resolve){ - this._count--; - if(this._count<0){ - this._count = 0; - } - }else{ - resolve(); - } - } -}; - -const Mod = { - startTime:0, - async start(isFull){ - Conf.isAstcOnly = !isFull; - Mod.startTime = new Date(); - console.warn("格式转换开始!",new Date().toLocaleString()); - await this.startTextureTask(); - }, - - async startTextureTask(){ - console.log('total textureList:', Conf.textureList.length); - for(let i=0;i-1){ - if(!fs.existsSync(`${Conf.dst}/Assets/Textures/pvr/${width}/`)){ - fs.mkdirSync(`${Conf.dst}/Assets/Textures/pvr/${width}/`,{ recursive: true }); - } - await this.pvrtc({ - src, - dstPath:`${Conf.dst}/Assets/Textures/pvr/${width}/${path}` - }); - } - if(!fs.existsSync(`${Conf.dst}/Assets/Textures/etc2/${width}/`)){ - fs.mkdirSync(`${Conf.dst}/Assets/Textures/etc2/${width}/`,{ recursive: true }); - } - await this.etc2({ - src, - dstPath:`${Conf.dst}/Assets/Textures/etc2/${width}/${path}`, - callback:async (isExist)=>{ - !isExist && await this.minPng({src}); - } - }); - - } - - } - }, - async astc({src,dstPath}){ - try{ - await fs.promises.access(dstPath+".txt"); - return; - }catch (e){} - - await Semaphore.waitOne(); - const startTime = new Date(); - let exe = 'astcenc-sse4.1.exe'; - if(os.type() === 'Darwin'){ - if(isM1){ - exe = 'astcenc-neon'; - }else{ - exe = 'astcenc-avx2'; - } - } - const cm = spawn(`${Conf.dataPath}/WX-WASM-SDK/Editor/${exe}`, ['-cs', src, dstPath+".astc",'8x8', '-medium']); - - cm.stdout.on('data', (data) => { - // console.log(`${src} astc stdout: ${data}`); - }); - - cm.stderr.on('data', (data) => { - console.error(`${src} astc stderr: ${data}`); - }); - - cm.on('close', (code) => { - console.log(`【astc】${src.substring(src.lastIndexOf('/')+1)} 耗时:${new Date() - startTime}ms`); - fs.rename(dstPath+".astc",dstPath+".txt",(err)=>{ - if(err){ - console.error(err,"图片:" + src + " 生成astc压缩纹理失败!"); - } - }); - Semaphore.release(); - }); - }, - async etc2({src,dstPath,callback}){ - try{ - await fs.promises.access(dstPath+".txt"); - callback && callback(true); - return; - }catch (e){} - - await Semaphore.waitOne(); - const startTime = new Date(); - const cm = spawn(`${Conf.dataPath}/WX-WASM-SDK/Editor/PVRTexToolCLI${os.type() === 'Darwin' ? '' : '.exe'}`, ['-i', src, '-o', dstPath, '-f', 'ETC2_RGBA,UBN,sRGB']); - - cm.stdout.on('data', (data) => { - // console.log(`${src} etc2 stdout: ${data}`); - }); - - cm.stderr.on('data', (data) => { - // console.error(`${src} etc2 stderr: ${data}`); - }); - - cm.on('close', (code) => { - console.log(`【etc2】${src.substring(src.lastIndexOf('/')+1)} 耗时:${new Date() - startTime}ms`); - const finalDst = dstPath + ".txt"; - - fs.rename(dstPath + ".pvr", finalDst,(err)=>{ - if(err){ - console.error("图片:" + src + " 生成etc2压缩纹理失败!"); - }else{ - fs.readFile(finalDst,(e,buffer)=>{ - fs.writeFile(finalDst,buffer.slice(52),(e)=>{ - if(e){ - console.error("图片:" + src + " 生成etc2压缩纹理失败!"); - } - }); - }); - } - }); - - callback && callback(); - Semaphore.release(); - }); - }, - async dxt5({src,dstPath,callback}){ - try{ - await fs.promises.access(dstPath+".txt"); - callback && callback(); - return; - }catch (e){} - - await Semaphore.waitOne(); - const startTime = new Date(); - const cm = spawn(`${Conf.dataPath}/WX-WASM-SDK/Editor/PVRTexToolCLI${os.type() === 'Darwin' ? '' : '.exe'}`, ['-i', src, '-o', dstPath+".dds", '-f', 'BC3,UBN,sRGB']); - - cm.stdout.on('data', (data) => { - // console.log(`${src} pvrtc stdout: ${data}`); - }); - - cm.stderr.on('data', (data) => { - // console.error(`${src} pvrtc stderr: ${data}`); - }); - - cm.on('close', (code) => { - console.log(`【DXT5】${src.substring(src.lastIndexOf('/')+1)} 耗时:${new Date() - startTime}ms`); - const finalDst = dstPath + ".txt"; - - fs.rename(dstPath+".dds", finalDst,(err)=>{ - if(err){ - console.error("图片:" + src + " 生dxt5压缩纹理失败!"); - } - }); - callback && callback(); - Semaphore.release(); - }); - }, - async pvrtc({src,dstPath,callback}){ - try{ - await fs.promises.access(dstPath+".txt"); - callback && callback(); - return; - }catch (e){} - - await Semaphore.waitOne(); - const startTime = new Date(); - const cm = spawn(`${Conf.dataPath}/WX-WASM-SDK/Editor/PVRTexToolCLI${os.type() === 'Darwin' ? '' : '.exe'}`, ['-i', src, '-o', dstPath+".pvr", '-f', 'PVRTC1_4,UBN,sRGB']); - - cm.stdout.on('data', (data) => { - // console.log(`${src} pvrtc stdout: ${data}`); - }); - - cm.stderr.on('data', (data) => { - // console.error(`${src} pvrtc stderr: ${data}`); - }); - - cm.on('close', (code) => { - console.log(`【pvrtc】${src.substring(src.lastIndexOf('/')+1)} 耗时:${new Date() - startTime}ms`); - const finalDst = dstPath + ".txt"; - - fs.rename(dstPath+".pvr", finalDst,(err)=>{ - if(err){ - console.error("图片:" + src + " 生pvrtc压缩纹理失败!"); - } - }); - callback && callback(); - Semaphore.release(); - }); - }, - async minPng({src}){ - await Semaphore.waitOne(); - const startTime = new Date(); - - const cm = spawn(`${Conf.dataPath}/WX-WASM-SDK/Editor/pngquant${os.type() === 'Darwin' ? '' : '.exe'}`, [src, '-o', src, '-f']); - - cm.stdout.on('data', (data) => { - // console.log(`${src} minPng stdout: ${data}`); - }); - - cm.stderr.on('data', (data) => { - // console.error(`${src} minPng stderr: ${data}`); - }); - - cm.on('close', (code) => { - console.log(`【minPng】${src.substring(src.lastIndexOf('/')+1)} 耗时:${new Date() - startTime}ms`); - - Semaphore.release(); - }); - } -}; - - - -process.on('exit',()=>{ - console.warn(new Date().toLocaleString(),`格式转换结束!!!总耗时:${(new Date() - Mod.startTime)/1000}秒。如果有提示转换失败的可以再次执行本条命令。`) -}); - - -module.exports = { - start:function(isFull){ - Mod.start(isFull); - } -}; diff --git a/Assets/WX-WASM-SDK/Editor/Node/_docompress.js.meta b/Assets/WX-WASM-SDK/Editor/Node/_docompress.js.meta deleted file mode 100644 index 9bd474b4..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/_docompress.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1b220604542c34893ab7ea633d9b550b -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/compress_all.js b/Assets/WX-WASM-SDK/Editor/Node/compress_all.js deleted file mode 100644 index 54aa9598..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/compress_all.js +++ /dev/null @@ -1,3 +0,0 @@ -const compressor = require('./_docompress.js'); - -compressor.start(true); diff --git a/Assets/WX-WASM-SDK/Editor/Node/compress_all.js.meta b/Assets/WX-WASM-SDK/Editor/Node/compress_all.js.meta deleted file mode 100644 index 29baa01e..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/compress_all.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3a05ba21881a149268211f8ea1d7c2fd -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/compress_astc_only.js b/Assets/WX-WASM-SDK/Editor/Node/compress_astc_only.js deleted file mode 100644 index 67a07375..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/compress_astc_only.js +++ /dev/null @@ -1,3 +0,0 @@ -const compressor = require('./_docompress.js'); - -compressor.start(false); diff --git a/Assets/WX-WASM-SDK/Editor/Node/compress_astc_only.js.meta b/Assets/WX-WASM-SDK/Editor/Node/compress_astc_only.js.meta deleted file mode 100644 index 9df47662..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/compress_astc_only.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f8df5396ed3cc40158fb3d1d10cd7568 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/compressor.js b/Assets/WX-WASM-SDK/Editor/Node/compressor.js deleted file mode 100644 index 8a328ab8..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/compressor.js +++ /dev/null @@ -1,6 +0,0 @@ -console.warn(` - 如仅仅是测试,可以使用compress_astc_only.js, 能节省压缩时间, - 如果是正式上线,就需要使用compress_all.js,生成全部纹理格式。 -`); - - diff --git a/Assets/WX-WASM-SDK/Editor/Node/compressor.js.meta b/Assets/WX-WASM-SDK/Editor/Node/compressor.js.meta deleted file mode 100644 index 1c636904..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/compressor.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8a571215513454dc7a35ceece8e06a26 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/conf.js b/Assets/WX-WASM-SDK/Editor/Node/conf.js deleted file mode 100755 index 01dbedb0..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/conf.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {"dst":"/Users/liangyizhou/work/mini-game/carTest","dataPath":"/Users/liangyizhou/work/u3d_project/Car/Assets","useDXT5":false,"textureList":[{"path":"sactx-512x512-Uncompressed-splash-2dd73517.a2ff633b","width":512,"height":512,"id":0},{"path":"Background.4dd4e9fa","width":32,"height":32,"id":1},{"path":"Knob.2dc4b9eb","width":64,"height":64,"id":2},{"path":"texture8.5d4ff114","width":16,"height":128,"id":3},{"path":"Player Icon.36880b65","width":128,"height":128,"id":4},{"path":"texture3.509e9bf1","width":256,"height":256,"id":5},{"path":"ground.e095ad77","width":128,"height":128,"id":6},{"path":"GreenGrass.343223e4","width":256,"height":256,"id":7},{"path":"YellowGrass_n.81124875","width":256,"height":256,"id":8},{"path":"Trees_atlas2.c81dd7b7","width":256,"height":64,"id":9},{"path":"Flag.d99e277e","width":512,"height":512,"id":10},{"path":"Tachometer.abe23eef","width":256,"height":256,"id":11},{"path":"texture1.71173524","width":128,"height":128,"id":12},{"path":"sactx-512x512-Uncompressed-splash-2dd73517.a2ff633b","width":512,"height":512,"id":13},{"path":"map2.f2f9b511","width":128,"height":128,"id":14},{"path":"Background.4dd4e9fa","width":32,"height":32,"id":15},{"path":"Knob.2dc4b9eb","width":64,"height":64,"id":16},{"path":"map7.ae7f3d30","width":512,"height":256,"id":17},{"path":"map1.834b28dc","width":128,"height":128,"id":18},{"path":"texture3.e0f09c55","width":256,"height":256,"id":19},{"path":"mat12.e6422e9b","width":512,"height":512,"id":20},{"path":"nightsky_left.ed4e6f79","width":512,"height":512,"id":21},{"path":"texture11.f7509bd3","width":256,"height":256,"id":22},{"path":"BlueLightGlow.7637b97a","width":128,"height":256,"id":23},{"path":"texture5.2ce39713","width":128,"height":64,"id":24},{"path":"texture2.08e8ef08","width":256,"height":256,"id":25},{"path":"Effect.12834072","width":512,"height":256,"id":26},{"path":"Body.45025ffd","width":512,"height":512,"id":27},{"path":"map4.48fe3ee6","width":128,"height":256,"id":28},{"path":"sactx-512x512-Uncompressed-splash-2dd73517.a2ff633b","width":512,"height":512,"id":29},{"path":"Background.4dd4e9fa","width":32,"height":32,"id":30},{"path":"Body.385c3f33","width":512,"height":512,"id":31},{"path":"Knob.2dc4b9eb","width":64,"height":64,"id":32},{"path":"Player Icon.36880b65","width":128,"height":128,"id":33},{"path":"texture11.0c1ba1c0","width":64,"height":64,"id":34},{"path":"Nitro.1d6c1bf3","width":256,"height":256,"id":35},{"path":"YellowGrass.ea05edd0","width":256,"height":256,"id":36},{"path":"ShiftGUI.e08504d8","width":128,"height":32,"id":37},{"path":"Dirt1.cc012c65","width":512,"height":512,"id":38},{"path":"wirewall.a3af889f","width":512,"height":512,"id":39},{"path":"leftsnow1.b74f680b","width":512,"height":512,"id":40},{"path":"sactx-512x512-Uncompressed-splash-2dd73517.a2ff633b","width":512,"height":512,"id":41},{"path":"Background.4dd4e9fa","width":32,"height":32,"id":42},{"path":"texture16.95b2c6a0","width":256,"height":256,"id":43},{"path":"InputFieldBackground.390c1940","width":32,"height":32,"id":44},{"path":"Knob.2dc4b9eb","width":64,"height":64,"id":45},{"path":"texture6.9e5fa4aa","width":128,"height":128,"id":46},{"path":"MiniMap-5.c5b88226","width":120,"height":128,"id":47},{"path":"Trees_atlas2.c81dd7b7","width":256,"height":64,"id":48},{"path":"Flag.d99e277e","width":512,"height":512,"id":49},{"path":"Tachometer.abe23eef","width":256,"height":256,"id":50},{"path":"texture1.71173524","width":128,"height":128,"id":51},{"path":"mat12.e6422e9b","width":512,"height":512,"id":52},{"path":"BlueLightGlow.7637b97a","width":128,"height":256,"id":53},{"path":"texture2.08e8ef08","width":256,"height":256,"id":54},{"path":"Effect.12834072","width":512,"height":256,"id":55},{"path":"Body.45025ffd","width":512,"height":512,"id":56},{"path":"Body.385c3f33","width":512,"height":512,"id":57},{"path":"Nitro.1d6c1bf3","width":256,"height":256,"id":58},{"path":"ShiftGUI.e08504d8","width":128,"height":32,"id":59},{"path":"Body.9429400c","width":512,"height":512,"id":60},{"path":"wall.d0fe2f94","width":64,"height":64,"id":61},{"path":"texture12.097f5652","width":512,"height":256,"id":62},{"path":"texture2.f23950a3","width":128,"height":32,"id":63},{"path":"Body.1b4af64c","width":512,"height":512,"id":64},{"path":"texture6.dc7dbee0","width":128,"height":128,"id":65},{"path":"texture14.2e5f9bad","width":256,"height":256,"id":66},{"path":"Body.1fd1fbbb","width":512,"height":512,"id":67},{"path":"texture3.19b5a57d","width":256,"height":256,"id":68},{"path":"SplatAlpha 0.c19e4a38","width":2048,"height":2048,"id":69},{"path":"Body.5804d309","width":512,"height":512,"id":70},{"path":"Needle.5eae6593","width":256,"height":256,"id":71},{"path":"SnowParticle.e9995ce6","width":32,"height":32,"id":72},{"path":"texture7.2ce39713","width":128,"height":64,"id":73},{"path":"Star.aeccd01f","width":128,"height":128,"id":74},{"path":"snow.6ee2d396","width":128,"height":72,"id":75},{"path":"texture1.96ff535d","width":64,"height":64,"id":76},{"path":"Player Icon.36880b65","width":128,"height":128,"id":77},{"path":"Body.9429400c","width":512,"height":512,"id":78},{"path":"YellowGrass_n.81124875","width":256,"height":256,"id":79},{"path":"wall.d0fe2f94","width":64,"height":64,"id":80},{"path":"Body.d59a0fc7","width":512,"height":512,"id":81},{"path":"Falloff.299a7d11","width":256,"height":8,"id":82},{"path":"texture8.11dd1862","width":128,"height":32,"id":83},{"path":"Nitro.72e63a9f","width":128,"height":44,"id":84},{"path":"Body.1b4af64c","width":512,"height":512,"id":85},{"path":"Flag.d99e277e","width":512,"height":512,"id":86},{"path":"texture6.dc7dbee0","width":128,"height":128,"id":87},{"path":"texture7.903865d9","width":128,"height":64,"id":88},{"path":"SplatAlpha 0.7d45350a","width":2048,"height":2048,"id":89},{"path":"texture17.38b7f09d","width":256,"height":256,"id":90},{"path":"Player Icon.36880b65","width":128,"height":128,"id":91},{"path":"GreenGrass.343223e4","width":256,"height":256,"id":92},{"path":"Trees_atlas2.c81dd7b7","width":256,"height":64,"id":93},{"path":"rightsnow1.e8ee3cba","width":512,"height":512,"id":94},{"path":"SnowDrop.cab8c87a","width":128,"height":128,"id":95},{"path":"Body.1fd1fbbb","width":512,"height":512,"id":96},{"path":"coin_icon.c4375472","width":128,"height":128,"id":97},{"path":"camera.ecc4e9af","width":128,"height":128,"id":98},{"path":"Flag.d99e277e","width":512,"height":512,"id":99},{"path":"texture13.f6bd1122","width":256,"height":256,"id":100},{"path":"Tachometer.abe23eef","width":256,"height":256,"id":101},{"path":"smoke.812aba42","width":256,"height":256,"id":102},{"path":"texture1.71173524","width":128,"height":128,"id":103},{"path":"Wheel-2.4b835431","width":128,"height":128,"id":104},{"path":"map2.f2f9b511","width":128,"height":128,"id":105},{"path":"RainDrop.0f2446c7","width":128,"height":128,"id":106},{"path":"Body.5804d309","width":512,"height":512,"id":107},{"path":"Needle.5eae6593","width":256,"height":256,"id":108},{"path":"Star.aeccd01f","width":128,"height":128,"id":109},{"path":"map7.ae7f3d30","width":512,"height":256,"id":110},{"path":"texture6.a460cca1","width":128,"height":128,"id":111},{"path":"map1.834b28dc","width":128,"height":128,"id":112},{"path":"texture3.e0f09c55","width":256,"height":256,"id":113},{"path":"topsnow1.37d1a797","width":512,"height":512,"id":114},{"path":"Road_blank256HV.e0f09c55","width":256,"height":256,"id":115},{"path":"Road.a1c0c676","width":512,"height":256,"id":116},{"path":"Body.d59a0fc7","width":512,"height":512,"id":117},{"path":"texture3.87e8b9cd","width":128,"height":128,"id":118},{"path":"texture2.e0f09c55","width":256,"height":256,"id":119},{"path":"Ground10_2.3dd80b5b","width":256,"height":256,"id":120},{"path":"pause.1451720a","width":128,"height":128,"id":121},{"path":"Falloff.299a7d11","width":256,"height":8,"id":122},{"path":"Nitro.72e63a9f","width":128,"height":44,"id":123},{"path":"mat12.e6422e9b","width":512,"height":512,"id":124},{"path":"BlueLightGlow.7637b97a","width":128,"height":256,"id":125},{"path":"texture5.e0f09c55","width":256,"height":256,"id":126},{"path":"Handbrake.e96c7034","width":128,"height":128,"id":127},{"path":"texture2.08e8ef08","width":256,"height":256,"id":128},{"path":"Road Diffuse.d5342df7","width":512,"height":256,"id":129},{"path":"Effect.12834072","width":512,"height":256,"id":130},{"path":"darkgrass.0e48c834","width":512,"height":512,"id":131},{"path":"Brake.71fd7588","width":200,"height":160,"id":132},{"path":"nightsky_top.e3be7f63","width":512,"height":512,"id":133},{"path":"Body.45025ffd","width":512,"height":512,"id":134},{"path":"map8.fc9e573f","width":256,"height":256,"id":135},{"path":"map4.48fe3ee6","width":128,"height":256,"id":136},{"path":"coin_icon.c4375472","width":128,"height":128,"id":137},{"path":"camera.ecc4e9af","width":128,"height":128,"id":138},{"path":"TexturesCom_SoilBeach0123_1_S.365e12d8","width":256,"height":256,"id":139},{"path":"smoke.812aba42","width":256,"height":256,"id":140},{"path":"Tachometer.abe23eef","width":256,"height":256,"id":141},{"path":"Body.ca6fff1a","width":512,"height":512,"id":142},{"path":"texture1.71173524","width":128,"height":128,"id":143},{"path":"map6.f49d6a26","width":256,"height":256,"id":144},{"path":"Wheel-2.4b835431","width":128,"height":128,"id":145},{"path":"wall.027f4d71","width":256,"height":256,"id":146},{"path":"Body.385c3f33","width":512,"height":512,"id":147},{"path":"Skidmarks.b79242a4","width":64,"height":64,"id":148},{"path":"Nitro.1d6c1bf3","width":256,"height":256,"id":149},{"path":"texture5.509e9bf1","width":256,"height":256,"id":150},{"path":"Specular.0f9adf9d","width":512,"height":256,"id":151},{"path":"texture10.903865d9","width":128,"height":64,"id":152},{"path":"ShiftGUI.e08504d8","width":128,"height":32,"id":153},{"path":"BrakeWarning.706d5903","width":128,"height":128,"id":154},{"path":"time.2c51cec9","width":128,"height":128,"id":155},{"path":"texture2.1b8e3262","width":128,"height":128,"id":156},{"path":"texture2.e0f09c55","width":256,"height":256,"id":157},{"path":"pause.1451720a","width":128,"height":128,"id":158},{"path":"texture3.b978c1cd","width":128,"height":128,"id":159},{"path":"Ground10_1.50a95072","width":256,"height":256,"id":160},{"path":"texture5.e0f09c55","width":256,"height":256,"id":161},{"path":"wirewall.a3af889f","width":512,"height":512,"id":162},{"path":"texture5.9e5fa4aa","width":128,"height":128,"id":163},{"path":"Body.e7ca3663","width":512,"height":512,"id":164},{"path":"texture3.83b0e6cc","width":128,"height":128,"id":165},{"path":"texture3.e0f09c55","width":256,"height":256,"id":166},{"path":"nightsky_front.c4ff9895","width":512,"height":512,"id":167},{"path":"Handbrake.e96c7034","width":128,"height":128,"id":168},{"path":"wall.d0fe2f94","width":64,"height":64,"id":169},{"path":"map3.ab8871de","width":128,"height":128,"id":170},{"path":"Brake.71fd7588","width":200,"height":160,"id":171},{"path":"Body.9429400c","width":512,"height":512,"id":172},{"path":"wall.d0fe2f94","width":64,"height":64,"id":173},{"path":"mat12.e6422e9b","width":512,"height":512,"id":174},{"path":"clay_snow1.4bc8acc4","width":512,"height":512,"id":175},{"path":"Wrong Way.7fc4683a","width":128,"height":128,"id":176},{"path":"BlueLightGlow.7637b97a","width":128,"height":256,"id":177},{"path":"Trees_atlas1.4f2d1ea0","width":256,"height":256,"id":178},{"path":"texture2.08e8ef08","width":256,"height":256,"id":179},{"path":"Body.ca6fff1a","width":512,"height":512,"id":180},{"path":"Skidmarks.b79242a4","width":64,"height":64,"id":181},{"path":"map10.37e345a8","width":128,"height":128,"id":182},{"path":"Body.1b4af64c","width":512,"height":512,"id":183},{"path":"wall.3b94a59b","width":256,"height":256,"id":184},{"path":"BrakeWarning.706d5903","width":128,"height":128,"id":185},{"path":"texture6.dc7dbee0","width":128,"height":128,"id":186},{"path":"StartLine.1dcfd9af","width":128,"height":128,"id":187},{"path":"Effect.12834072","width":512,"height":256,"id":188},{"path":"texture11.b978c1cd","width":128,"height":128,"id":189},{"path":"CarShadow.6181acd0","width":128,"height":256,"id":190},{"path":"Wheel-1.65a90b08","width":128,"height":128,"id":191},{"path":"texture6.45087028","width":256,"height":256,"id":192},{"path":"time.2c51cec9","width":128,"height":128,"id":193},{"path":"texture2.1b8e3262","width":128,"height":128,"id":194},{"path":"texture4.f275d5c1","width":256,"height":256,"id":195},{"path":"sactx-512x512-Uncompressed-splash-2dd73517.a2ff633b","width":512,"height":512,"id":196},{"path":"Background.4dd4e9fa","width":32,"height":32,"id":197},{"path":"Body.1fd1fbbb","width":512,"height":512,"id":198},{"path":"texture3.b978c1cd","width":128,"height":128,"id":199},{"path":"Knob.2dc4b9eb","width":64,"height":64,"id":200},{"path":"backsnow1.b50c879a","width":512,"height":512,"id":201},{"path":"Player Icon.36880b65","width":128,"height":128,"id":202},{"path":"Body.45025ffd","width":512,"height":512,"id":203},{"path":"MiniMap-4.271be80f","width":128,"height":124,"id":204},{"path":"YellowGrass_n.81124875","width":256,"height":256,"id":205},{"path":"Trees_atlas2.c81dd7b7","width":256,"height":64,"id":206},{"path":"Body.5804d309","width":512,"height":512,"id":207},{"path":"Body.e7ca3663","width":512,"height":512,"id":208},{"path":"Body.385c3f33","width":512,"height":512,"id":209},{"path":"texture3.83b0e6cc","width":128,"height":128,"id":210},{"path":"frontsnow1.d0ad7d17","width":512,"height":512,"id":211},{"path":"map5.e0a2644e","width":128,"height":64,"id":212},{"path":"Needle.5eae6593","width":256,"height":256,"id":213},{"path":"Wrong Way.7fc4683a","width":128,"height":128,"id":214},{"path":"Star.aeccd01f","width":128,"height":128,"id":215},{"path":"Nitro.1d6c1bf3","width":256,"height":256,"id":216},{"path":"Asphalt_Normal.0160dcac","width":256,"height":256,"id":217},{"path":"Flag.d99e277e","width":512,"height":512,"id":218},{"path":"Bow_Warehousewall.06aa79d1","width":128,"height":128,"id":219},{"path":"Trees_atlas1.4f2d1ea0","width":256,"height":256,"id":220},{"path":"texture7.9e5fa4aa","width":128,"height":128,"id":221},{"path":"smoke2.33b23a55","width":256,"height":256,"id":222},{"path":"YellowGrass.ea05edd0","width":256,"height":256,"id":223},{"path":"ShiftGUI.e08504d8","width":128,"height":32,"id":224},{"path":"Road.a8ec2f0e","width":256,"height":512,"id":225},{"path":"wall.3b94a59b","width":256,"height":256,"id":226},{"path":"texture2.a9bffa06","width":128,"height":128,"id":227},{"path":"Tachometer.abe23eef","width":256,"height":256,"id":228},{"path":"texture1.71173524","width":128,"height":128,"id":229},{"path":"texture10.e0f09c55","width":256,"height":256,"id":230},{"path":"map2.f2f9b511","width":128,"height":128,"id":231},{"path":"StartLine.1dcfd9af","width":128,"height":128,"id":232},{"path":"Body.d59a0fc7","width":512,"height":512,"id":233},{"path":"darkgrass2.da800ea7","width":512,"height":512,"id":234},{"path":"texture3.87e8b9cd","width":128,"height":128,"id":235},{"path":"map7.ae7f3d30","width":512,"height":256,"id":236},{"path":"Accel.8c9591ba","width":128,"height":256,"id":237},{"path":"Falloff.299a7d11","width":256,"height":8,"id":238},{"path":"Nitro.72e63a9f","width":128,"height":44,"id":239},{"path":"map1.834b28dc","width":128,"height":128,"id":240},{"path":"texture3.e0f09c55","width":256,"height":256,"id":241},{"path":"map8.fc9e573f","width":256,"height":256,"id":242},{"path":"texture8.2ce39713","width":128,"height":64,"id":243},{"path":"biffoffwin_law.703e7c26","width":128,"height":128,"id":244},{"path":"Road-Specular.201474d7","width":512,"height":256,"id":245},{"path":"Body.31d909b7","width":512,"height":512,"id":246},{"path":"Road_blank256HV.e0f09c55","width":256,"height":256,"id":247},{"path":"CarShadow.6181acd0","width":128,"height":256,"id":248},{"path":"Wheel-1.65a90b08","width":128,"height":128,"id":249},{"path":"texture9.f887d23e","width":256,"height":256,"id":250},{"path":"texture4.d90bcaff","width":128,"height":128,"id":251},{"path":"GreenGrass_n.ef931b87","width":256,"height":256,"id":252},{"path":"Sound.836f6462","width":128,"height":128,"id":253},{"path":"mat12.e6422e9b","width":512,"height":512,"id":254},{"path":"Road.88e02066","width":512,"height":512,"id":255},{"path":"coin_icon.c4375472","width":128,"height":128,"id":256},{"path":"camera.ecc4e9af","width":128,"height":128,"id":257},{"path":"nightsky_back.307b6771","width":512,"height":512,"id":258},{"path":"Body.fbca4576","width":512,"height":512,"id":259},{"path":"smoke.812aba42","width":256,"height":256,"id":260},{"path":"texture8.a9149d0f","width":256,"height":256,"id":261},{"path":"texture5.8d233fbc","width":128,"height":128,"id":262},{"path":"Grass2.20452713","width":256,"height":256,"id":263},{"path":"texture4.dc7dbee0","width":128,"height":128,"id":264},{"path":"Rocks_n.29eefbf4","width":256,"height":256,"id":265},{"path":"frontw3.57d44322","width":512,"height":512,"id":266},{"path":"texture18.f7509bd3","width":256,"height":256,"id":267},{"path":"texture1.33012635","width":256,"height":256,"id":268},{"path":"BlueLightGlow.7637b97a","width":128,"height":256,"id":269},{"path":"Music.98af3c44","width":128,"height":128,"id":270},{"path":"texture5.383d55a3","width":256,"height":256,"id":271},{"path":"texture2.08e8ef08","width":256,"height":256,"id":272},{"path":"smoke2.33b23a55","width":256,"height":256,"id":273},{"path":"dsfront.dfa3d404","width":512,"height":512,"id":274},{"path":"Accel.8c9591ba","width":128,"height":256,"id":275},{"path":"Effect.12834072","width":512,"height":256,"id":276},{"path":"texture1.dc7dbee0","width":128,"height":128,"id":277},{"path":"map6.f49d6a26","width":256,"height":256,"id":278},{"path":"Rocks.3a6f0b6b","width":256,"height":256,"id":279},{"path":"Body.eb44d468","width":512,"height":512,"id":280},{"path":"Sound.836f6462","width":128,"height":128,"id":282},{"path":"texture6.509e9bf1","width":256,"height":256,"id":281},{"path":"MiniMap-2.0bbeedd4","width":124,"height":128,"id":283},{"path":"Specular.282abd48","width":256,"height":512,"id":284},{"path":"Wheel-2.4b835431","width":128,"height":128,"id":285},{"path":"texture6.a052ef27","width":128,"height":128,"id":286},{"path":"texture2.e0f09c55","width":256,"height":256,"id":287},{"path":"pause.1451720a","width":128,"height":128,"id":288},{"path":"rain.ba9ec8da","width":128,"height":72,"id":289},{"path":"Body.fbca4576","width":512,"height":512,"id":290},{"path":"Body.45025ffd","width":512,"height":512,"id":291},{"path":"map4.48fe3ee6","width":128,"height":256,"id":292},{"path":"Grass2.20452713","width":256,"height":256,"id":293},{"path":"texture4.dc7dbee0","width":128,"height":128,"id":294},{"path":"wall.d0fe2f94","width":64,"height":64,"id":295},{"path":"Music.98af3c44","width":128,"height":128,"id":296},{"path":"dsback.648621c0","width":512,"height":512,"id":297},{"path":"Ground10_1.50a95072","width":256,"height":256,"id":298},{"path":"texture8.3b3d0199","width":64,"height":64,"id":299},{"path":"ramp.097f5652","width":512,"height":256,"id":300},{"path":"texture5.e0f09c55","width":256,"height":256,"id":301},{"path":"Body.385c3f33","width":512,"height":512,"id":302},{"path":"Handbrake.e96c7034","width":128,"height":128,"id":303},{"path":"wall.d0fe2f94","width":64,"height":64,"id":304},{"path":"map3.ab8871de","width":128,"height":128,"id":305},{"path":"ground.a9149d0f","width":256,"height":256,"id":306},{"path":"Brake.71fd7588","width":200,"height":160,"id":307},{"path":"texture4.06d23e88","width":256,"height":256,"id":308},{"path":"Nitro.1d6c1bf3","width":256,"height":256,"id":309},{"path":"nightsky_right.04ae63b3","width":512,"height":512,"id":310},{"path":"YellowGrass.ea05edd0","width":256,"height":256,"id":311},{"path":"ShiftGUI.e08504d8","width":128,"height":32,"id":312},{"path":"Body.ca6fff1a","width":512,"height":512,"id":313},{"path":"Body.9429400c","width":512,"height":512,"id":314},{"path":"wall.027f4d71","width":256,"height":256,"id":315},{"path":"Skidmarks.b79242a4","width":64,"height":64,"id":316},{"path":"map10.37e345a8","width":128,"height":128,"id":317},{"path":"Body.eb44d468","width":512,"height":512,"id":318},{"path":"texture7.6d154406","width":128,"height":128,"id":319},{"path":"texture1.99be5bfd","width":128,"height":128,"id":320},{"path":"wirewall.a3af889f","width":512,"height":512,"id":321},{"path":"texture16.097f5652","width":512,"height":256,"id":322},{"path":"Body.d72f38f2","width":512,"height":512,"id":323},{"path":"Body.9429400c","width":512,"height":512,"id":324},{"path":"wall.d0fe2f94","width":64,"height":64,"id":325},{"path":"dsleft.cf3fb0ca","width":512,"height":512,"id":326},{"path":"BrakeWarning.706d5903","width":128,"height":128,"id":327},{"path":"texture11.b978c1cd","width":128,"height":128,"id":328},{"path":"texture7.a7f74476","width":256,"height":256,"id":329},{"path":"Body.1b4af64c","width":512,"height":512,"id":330},{"path":"texture6.45087028","width":256,"height":256,"id":331},{"path":"texture6.dc7dbee0","width":128,"height":128,"id":332},{"path":"dstop.43171fd9","width":512,"height":512,"id":333},{"path":"Body.1fd1fbbb","width":512,"height":512,"id":334},{"path":"time.2c51cec9","width":128,"height":128,"id":335},{"path":"texture2.1b8e3262","width":128,"height":128,"id":336},{"path":"texture4.f275d5c1","width":256,"height":256,"id":337},{"path":"texture3.b978c1cd","width":128,"height":128,"id":338},{"path":"Body.5804d309","width":512,"height":512,"id":339},{"path":"Needle.5eae6593","width":256,"height":256,"id":340},{"path":"Star.aeccd01f","width":128,"height":128,"id":341},{"path":"Body.e7ca3663","width":512,"height":512,"id":342},{"path":"texture8.08e8ef08","width":256,"height":256,"id":343},{"path":"Bow_Warehousewall.06aa79d1","width":128,"height":128,"id":344},{"path":"Body.d59a0fc7","width":512,"height":512,"id":345},{"path":"Road-Specular.e419d7ee","width":512,"height":512,"id":346},{"path":"texture3.83b0e6cc","width":128,"height":128,"id":347},{"path":"texture4.c3bfc227","width":128,"height":32,"id":348},{"path":"map5.e0a2644e","width":128,"height":64,"id":349},{"path":"Wrong Way.7fc4683a","width":128,"height":128,"id":350},{"path":"Trees_atlas1.4f2d1ea0","width":256,"height":256,"id":351},{"path":"texture7.9e5fa4aa","width":128,"height":128,"id":352},{"path":"texture2.a9bffa06","width":128,"height":128,"id":353},{"path":"TexturesCom_Cliffs0213_1_seamless_N.16c295a4","width":256,"height":256,"id":354},{"path":"Body .bc8a5c9b","width":512,"height":512,"id":355},{"path":"wall.d0fe2f94","width":64,"height":64,"id":356},{"path":"texture10.e0f09c55","width":256,"height":256,"id":357},{"path":"texture3.87e8b9cd","width":128,"height":128,"id":358},{"path":"texture13.0135627f","width":256,"height":128,"id":359},{"path":"StartLine.1dcfd9af","width":128,"height":128,"id":360},{"path":"texture11.bfb368d0","width":256,"height":256,"id":361},{"path":"CarShadow.6181acd0","width":128,"height":256,"id":362},{"path":"texture4.c2e629d6","width":128,"height":128,"id":363},{"path":"Wheel-1.65a90b08","width":128,"height":128,"id":364},{"path":"Body.1b4af64c","width":512,"height":512,"id":365},{"path":"GreenGrass_n.ef931b87","width":256,"height":256,"id":366},{"path":"texture6.dc7dbee0","width":128,"height":128,"id":367},{"path":"texture9.87e8b9cd","width":128,"height":128,"id":368},{"path":"texture3.06aa79d1","width":128,"height":128,"id":369},{"path":"SplatAlpha 0.4c52e515","width":2048,"height":2048,"id":370},{"path":"texture8.a9149d0f","width":256,"height":256,"id":371},{"path":"texture9.f887d23e","width":256,"height":256,"id":372},{"path":"Rocks_n.29eefbf4","width":256,"height":256,"id":373},{"path":"texture1.33012635","width":256,"height":256,"id":374},{"path":"texture5.383d55a3","width":256,"height":256,"id":375},{"path":"Body.d72f38f2","width":512,"height":512,"id":376},{"path":"GrassTex-1.510ec6aa","width":256,"height":256,"id":377},{"path":"smoke2.33b23a55","width":256,"height":256,"id":378},{"path":"Accel.8c9591ba","width":128,"height":256,"id":379},{"path":"texture5.5696f286","width":256,"height":256,"id":380},{"path":"texture1.dc7dbee0","width":128,"height":128,"id":381},{"path":"Rocks.3a6f0b6b","width":256,"height":256,"id":382},{"path":"Sound.836f6462","width":128,"height":128,"id":383},{"path":"texture15.8868d10d","width":128,"height":128,"id":384},{"path":"dsright.a2a5bbc4","width":512,"height":512,"id":385},{"path":"Body.fbca4576","width":512,"height":512,"id":386},{"path":"texture4.dc7dbee0","width":128,"height":128,"id":387},{"path":"wall.d0fe2f94","width":64,"height":64,"id":388},{"path":"Music.98af3c44","width":128,"height":128,"id":389},{"path":"wall.d0fe2f94","width":64,"height":64,"id":390},{"path":"Body.eb44d468","width":512,"height":512,"id":391},{"path":"texture7.6d154406","width":128,"height":128,"id":392},{"path":"texture11.dc7dbee0","width":128,"height":128,"id":393},{"path":"texture17.f7509bd3","width":256,"height":256,"id":394},{"path":"texture1.e095ad77","width":128,"height":128,"id":395},{"path":"texture3.8243d2a7","width":64,"height":64,"id":396},{"path":"Body.d72f38f2","width":512,"height":512,"id":397},{"path":"SplatAlpha 0.d4b55d73","width":2048,"height":2048,"id":398},{"path":"topred2.44675833","width":512,"height":512,"id":399},{"path":"Body.1fd1fbbb","width":512,"height":512,"id":400},{"path":"Body.5804d309","width":512,"height":512,"id":401},{"path":"Needle.5eae6593","width":256,"height":256,"id":402},{"path":"Star.aeccd01f","width":128,"height":128,"id":403},{"path":"texture12.a98ede9d","width":128,"height":128,"id":404},{"path":"SplatAlpha 1.96f55db4","width":2048,"height":2048,"id":405},{"path":"texture11.509e9bf1","width":256,"height":256,"id":406},{"path":"Ground10_2.3dd80b5b","width":256,"height":256,"id":407},{"path":"Falloff.299a7d11","width":256,"height":8,"id":408},{"path":"Nitro.72e63a9f","width":128,"height":44,"id":409},{"path":"map8.fc9e573f","width":256,"height":256,"id":410},{"path":"biffoffwin_law.703e7c26","width":128,"height":128,"id":411},{"path":"backw3.cf169b1c","width":512,"height":512,"id":412},{"path":"coin_icon.c4375472","width":128,"height":128,"id":413},{"path":"camera.ecc4e9af","width":128,"height":128,"id":414},{"path":"texture9.dc7dbee0","width":128,"height":128,"id":415},{"path":"smoke.812aba42","width":256,"height":256,"id":416},{"path":"map6.f49d6a26","width":256,"height":256,"id":417},{"path":"ramp.097f5652","width":512,"height":256,"id":418},{"path":"Wheel-2.4b835431","width":128,"height":128,"id":419},{"path":"texture6.a052ef27","width":128,"height":128,"id":420},{"path":"texture2.e0f09c55","width":256,"height":256,"id":421},{"path":"pause.1451720a","width":128,"height":128,"id":422},{"path":"mat15.ca472e10","width":512,"height":512,"id":423},{"path":"leftw3.1858eef9","width":512,"height":512,"id":424},{"path":"Ground10_1.50a95072","width":256,"height":256,"id":425},{"path":"texture8.3b3d0199","width":64,"height":64,"id":426},{"path":"texture5.e0f09c55","width":256,"height":256,"id":427},{"path":"Handbrake.e96c7034","width":128,"height":128,"id":428},{"path":"wall.d0fe2f94","width":64,"height":64,"id":429},{"path":"map3.ab8871de","width":128,"height":128,"id":430},{"path":"texture1.30523d76","width":256,"height":256,"id":431},{"path":"Body2.a8fb1ee0","width":512,"height":512,"id":432},{"path":"Brake.71fd7588","width":200,"height":160,"id":433},{"path":"Body.ca6fff1a","width":512,"height":512,"id":434},{"path":"Skidmarks.b79242a4","width":64,"height":64,"id":435},{"path":"map10.37e345a8","width":128,"height":128,"id":436},{"path":"BrakeWarning.706d5903","width":128,"height":128,"id":437},{"path":"texture11.b978c1cd","width":128,"height":128,"id":438},{"path":"texture7.a7f74476","width":256,"height":256,"id":439},{"path":"texture6.45087028","width":256,"height":256,"id":440},{"path":"time.2c51cec9","width":128,"height":128,"id":441},{"path":"texture2.1b8e3262","width":128,"height":128,"id":442},{"path":"texture4.f275d5c1","width":256,"height":256,"id":443},{"path":"texture3.b978c1cd","width":128,"height":128,"id":444},{"path":"Body.e7ca3663","width":512,"height":512,"id":445},{"path":"texture3.83b0e6cc","width":128,"height":128,"id":446},{"path":"clay_snow1.4bc8acc4","width":512,"height":512,"id":447},{"path":"map5.e0a2644e","width":128,"height":64,"id":448},{"path":"Wrong Way.7fc4683a","width":128,"height":128,"id":449},{"path":"Trees_atlas1.4f2d1ea0","width":256,"height":256,"id":450},{"path":"Rotor.56687661","width":256,"height":256,"id":451},{"path":"texture2.a9bffa06","width":128,"height":128,"id":452},{"path":"texture10.e0f09c55","width":256,"height":256,"id":453},{"path":"StartLine.1dcfd9af","width":128,"height":128,"id":454},{"path":"CarShadow.6181acd0","width":128,"height":256,"id":455},{"path":"texture4.c2e629d6","width":128,"height":128,"id":456},{"path":"texture10.097f5652","width":512,"height":256,"id":457},{"path":"Wheel-1.65a90b08","width":128,"height":128,"id":458},{"path":"texture4.38a74461","width":64,"height":64,"id":459},{"path":"texture9.87e8b9cd","width":128,"height":128,"id":460},{"path":"texture3.06aa79d1","width":128,"height":128,"id":461},{"path":"texture8.a9149d0f","width":256,"height":256,"id":462},{"path":"rightw3.36da9538","width":512,"height":512,"id":463},{"path":"Rocks_n.29eefbf4","width":256,"height":256,"id":464},{"path":"texture1.33012635","width":256,"height":256,"id":465},{"path":"texture5.383d55a3","width":256,"height":256,"id":466},{"path":"rightred2.6889799e","width":512,"height":512,"id":467},{"path":"topw3.d4753190","width":512,"height":512,"id":468},{"path":"Body.d59a0fc7","width":512,"height":512,"id":469},{"path":"texture10.33012635","width":256,"height":256,"id":470},{"path":"Ground10_2.3dd80b5b","width":256,"height":256,"id":471},{"path":"Falloff.299a7d11","width":256,"height":8,"id":472},{"path":"smoke2.33b23a55","width":256,"height":256,"id":473},{"path":"darkgrass2.da800ea7","width":512,"height":512,"id":474},{"path":"Accel.8c9591ba","width":128,"height":256,"id":475},{"path":"texture5.5696f286","width":256,"height":256,"id":476},{"path":"texture1.dc7dbee0","width":128,"height":128,"id":477},{"path":"Rocks.3a6f0b6b","width":256,"height":256,"id":478},{"path":"Sound.836f6462","width":128,"height":128,"id":479},{"path":"aas.e47c9fc6","width":128,"height":64,"id":480},{"path":"PalmBranch.91a35f2e","width":128,"height":256,"id":481},{"path":"Body.fbca4576","width":512,"height":512,"id":482},{"path":"Nitro.72e63a9f","width":128,"height":44,"id":483},{"path":"Grass2.20452713","width":256,"height":256,"id":484},{"path":"texture4.dc7dbee0","width":128,"height":128,"id":485},{"path":"wall.d0fe2f94","width":64,"height":64,"id":486},{"path":"Music.98af3c44","width":128,"height":128,"id":487},{"path":"texture5.b978c1cd","width":128,"height":128,"id":488},{"path":"wall.d0fe2f94","width":64,"height":64,"id":489},{"path":"texture7.2ce39713","width":128,"height":64,"id":490},{"path":"Body.eb44d468","width":512,"height":512,"id":491},{"path":"texture7.6d154406","width":128,"height":128,"id":492},{"path":"texture11.dc7dbee0","width":128,"height":128,"id":493},{"path":"Body.d72f38f2","width":512,"height":512,"id":494},{"path":"leftred2.98f45f95","width":512,"height":512,"id":495},{"path":"coin_icon.c4375472","width":128,"height":128,"id":496},{"path":"camera.ecc4e9af","width":128,"height":128,"id":497},{"path":"smoke.812aba42","width":256,"height":256,"id":498},{"path":"Wheel-2.4b835431","width":128,"height":128,"id":499},{"path":"texture6.a052ef27","width":128,"height":128,"id":500},{"path":"texture2.e0f09c55","width":256,"height":256,"id":501},{"path":"pause.1451720a","width":128,"height":128,"id":502},{"path":"Ground10_1.50a95072","width":256,"height":256,"id":503},{"path":"texture8.3b3d0199","width":64,"height":64,"id":504},{"path":"texture5.e0f09c55","width":256,"height":256,"id":505},{"path":"Handbrake.e96c7034","width":128,"height":128,"id":506},{"path":"wall.d0fe2f94","width":64,"height":64,"id":507},{"path":"SplatAlpha 1.11936402","width":1024,"height":1024,"id":508},{"path":"SplatAlpha 0.d8836031","width":1024,"height":1024,"id":509},{"path":"Brake.71fd7588","width":200,"height":160,"id":510},{"path":"texture6.2ce39713","width":128,"height":64,"id":511},{"path":"Body.ca6fff1a","width":512,"height":512,"id":512},{"path":"PalmBark.5f5f7d0f","width":256,"height":256,"id":513},{"path":"backred2.e4f1ded9","width":512,"height":512,"id":514},{"path":"wall.027f4d71","width":256,"height":256,"id":515},{"path":"Skidmarks.b79242a4","width":64,"height":64,"id":516},{"path":"texture7.5a268447","width":256,"height":128,"id":517},{"path":"BrakeWarning.706d5903","width":128,"height":128,"id":518},{"path":"texture7.a7f74476","width":256,"height":256,"id":519},{"path":"time.2c51cec9","width":128,"height":128,"id":520},{"path":"texture2.1b8e3262","width":128,"height":128,"id":521},{"path":"texture3.b978c1cd","width":128,"height":128,"id":522},{"path":"Body.e7ca3663","width":512,"height":512,"id":523},{"path":"texture3.83b0e6cc","width":128,"height":128,"id":524},{"path":"Wrong Way.7fc4683a","width":128,"height":128,"id":525},{"path":"StartLine.1dcfd9af","width":128,"height":128,"id":526},{"path":"texture15.f7509bd3","width":256,"height":256,"id":527},{"path":"Road.a7aa4695","width":512,"height":256,"id":528},{"path":"CarShadow.6181acd0","width":128,"height":256,"id":529},{"path":"texture4.c2e629d6","width":128,"height":128,"id":530},{"path":"texture10.097f5652","width":512,"height":256,"id":531},{"path":"Wheel-1.65a90b08","width":128,"height":128,"id":532},{"path":"darkgrass.6c9fca84","width":256,"height":256,"id":533},{"path":"texture8.8868d10d","width":128,"height":128,"id":534},{"path":"texture9.87e8b9cd","width":128,"height":128,"id":535},{"path":"texture3.06aa79d1","width":128,"height":128,"id":536},{"path":"texture2.501431cd","width":64,"height":64,"id":537},{"path":"texture1.33012635","width":256,"height":256,"id":538},{"path":"TexturesCom_Cliffs0213_1_seamless_S (1).cbfeeec1","width":256,"height":256,"id":539},{"path":"smoke2.33b23a55","width":256,"height":256,"id":540},{"path":"Accel.8c9591ba","width":128,"height":256,"id":541},{"path":"texture5.5696f286","width":256,"height":256,"id":542},{"path":"texture14.e095ad77","width":128,"height":128,"id":543},{"path":"Sound.836f6462","width":128,"height":128,"id":544},{"path":"Body.fbca4576","width":512,"height":512,"id":545},{"path":"Grass2.20452713","width":256,"height":256,"id":546},{"path":"texture4.dc7dbee0","width":128,"height":128,"id":547},{"path":"Music.98af3c44","width":128,"height":128,"id":548},{"path":"wall.d0fe2f94","width":64,"height":64,"id":549},{"path":"Body.eb44d468","width":512,"height":512,"id":550},{"path":"texture11.dc7dbee0","width":128,"height":128,"id":551},{"path":"texture13.b978c1cd","width":128,"height":128,"id":552},{"path":"TexturesCom_N.1ab5abff","width":256,"height":256,"id":553},{"path":"Body.d72f38f2","width":512,"height":512,"id":554},{"path":"frontred2.e30d128a","width":512,"height":512,"id":555},{"path":"UISprite.85625d8c","width":32,"height":32,"id":556},{"path":"emptyname.5f5ca47a","width":512,"height":312,"id":557},{"path":"sactx-512x512-Uncompressed-splash-2dd73517.a2ff633b","width":512,"height":512,"id":558},{"path":"sactx-256x512-Uncompressed-Button-b078e427.9c75e2fd","width":256,"height":512,"id":559},{"path":"UISprite.85625d8c","width":32,"height":32,"id":560},{"path":"Background.4dd4e9fa","width":32,"height":32,"id":561},{"path":"Knob.2dc4b9eb","width":64,"height":64,"id":562},{"path":"Body.ca6fff1a","width":512,"height":512,"id":563},{"path":"Mat 7.e4ba8f5d","width":256,"height":256,"id":564},{"path":"Body.385c3f33","width":512,"height":512,"id":565},{"path":"Body.eb44d468","width":512,"height":512,"id":566},{"path":"Body.1fd1fbbb","width":512,"height":512,"id":567},{"path":"Mat 9.3ce113a0","width":128,"height":128,"id":568},{"path":"Body.e7ca3663","width":512,"height":512,"id":569},{"path":"ActiveButton.0d279494","width":128,"height":128,"id":570},{"path":"Falloff.299a7d11","width":256,"height":8,"id":571},{"path":"gear.48a0ce19","width":128,"height":128,"id":572},{"path":"Mat 16.77feb973","width":512,"height":512,"id":573},{"path":"Mat 12.ff590957","width":512,"height":32,"id":574},{"path":"Mat 8.5e31e8ed","width":128,"height":128,"id":575},{"path":"BottomMenu-1.bd6855de","width":80,"height":84,"id":576},{"path":"smoke.ff0d02bd","width":128,"height":128,"id":577},{"path":"CarShadow.6181acd0","width":128,"height":256,"id":578},{"path":"close.046a7c99","width":128,"height":128,"id":579},{"path":"leftav9.206cfbc5","width":512,"height":512,"id":580},{"path":"Level-3.65d47c4b","width":512,"height":256,"id":581},{"path":"smoke2.33b23a55","width":256,"height":256,"id":582},{"path":"Body.45025ffd","width":512,"height":512,"id":583},{"path":"Level-5.3060183c","width":512,"height":256,"id":584},{"path":"Mat 1.bc0a85a2","width":256,"height":256,"id":585},{"path":"Body.5804d309","width":512,"height":512,"id":586},{"path":"Accel.7c9bb576","width":128,"height":128,"id":587},{"path":"Arrow.fac905b5","width":128,"height":128,"id":588},{"path":"frontav9.428c2be0","width":512,"height":512,"id":589},{"path":"Mat 15.4a0c041c","width":512,"height":512,"id":590},{"path":"youtube.efc954b0","width":128,"height":128,"id":591},{"path":"Level-2.20ea488f","width":512,"height":256,"id":592},{"path":"Mat 13.85f54b1b","width":256,"height":128,"id":593},{"path":"coin_icon.c4375472","width":128,"height":128,"id":594},{"path":"Body.1b4af64c","width":512,"height":512,"id":595},{"path":"Level-4.4d4b4db5","width":512,"height":256,"id":596},{"path":"Star.aeccd01f","width":128,"height":128,"id":597},{"path":"Mat 11.faf3313a","width":512,"height":256,"id":598},{"path":"rightav9.09020793","width":512,"height":512,"id":599},{"path":"Unity.9ad29968","width":128,"height":128,"id":600},{"path":"Mat 4.9fd80105","width":512,"height":512,"id":601},{"path":"Mat 14.b85e3137","width":512,"height":512,"id":602},{"path":"Random.221d11e6","width":128,"height":128,"id":603},{"path":"Body.d59a0fc7","width":512,"height":512,"id":604},{"path":"Body.9429400c","width":512,"height":512,"id":605},{"path":"Level-1.30c1098d","width":512,"height":256,"id":606},{"path":"Body.d72f38f2","width":512,"height":512,"id":607},{"path":"Mat 10.5a1cae41","width":128,"height":128,"id":608},{"path":"Mat 5.f275d5c1","width":256,"height":256,"id":609},{"path":"Body.fbca4576","width":512,"height":512,"id":610},{"path":"Mat 3.420d21c0","width":256,"height":256,"id":611},{"path":"Locked2.82545a78","width":128,"height":128,"id":612},{"path":"BlueLightGlow.7637b97a","width":128,"height":256,"id":613},{"path":"Mat 6.81d1e34f","width":512,"height":512,"id":614},{"path":"backav9.71594de2","width":512,"height":512,"id":615},{"path":"wheel.556bb590","width":128,"height":128,"id":616},{"path":"Mat 2.eeacd58a","width":256,"height":512,"id":617},{"path":"topav9.b97d2fa1","width":512,"height":512,"id":618},{"path":"Wheel-2.4b835431","width":128,"height":128,"id":619}]} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/Node/conf.js.meta b/Assets/WX-WASM-SDK/Editor/Node/conf.js.meta deleted file mode 100755 index e39b9eeb..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/conf.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9d7cd0d0ded094b7ba7d2ece84a4b04b -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/dump_wasm_symbol.mjs b/Assets/WX-WASM-SDK/Editor/Node/dump_wasm_symbol.mjs deleted file mode 100644 index 8f8d3ecb..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/dump_wasm_symbol.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import binaryen from "binaryen"; -import process from "process"; -import fs from "fs"; - -if (process.argv.length < 3) { - console.error("cannot find wasmcode, Usage: node dump_wasm_symbo.mjs "); - process.exit(-1); -} -let dir = process.argv[2]; -if (!dir.endsWith("/")) { - dir += "/"; -} -let bin = fs.readFileSync(dir + "webgl/Build/webgl.wasm"); -let mod = binaryen.readBinary(bin); - -let symbols = {}; -for (let i = 0; i < mod.getNumFunctions(); ++i) { - let ref = mod.getFunctionByIndex(i); - let func = binaryen.getFunctionInfo(ref); - symbols[i] = func.name; -} - -fs.writeFileSync(dir + "minigame/webgl.wasm.symbols.unityweb", JSON.stringify(symbols)); diff --git a/Assets/WX-WASM-SDK/Editor/Node/dump_wasm_symbol.mjs.meta b/Assets/WX-WASM-SDK/Editor/Node/dump_wasm_symbol.mjs.meta deleted file mode 100644 index 1e6c3190..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/dump_wasm_symbol.mjs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: e5abb6c95bc17485f832ec3d792e39c6 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/node_modules.meta b/Assets/WX-WASM-SDK/Editor/Node/node_modules.meta deleted file mode 100644 index e6524a28..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/node_modules.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 484c112f9b33d491aa170a6b087105b9 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/package-lock.json b/Assets/WX-WASM-SDK/Editor/Node/package-lock.json deleted file mode 100644 index cc05b5f5..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "node", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "node", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "binaryen": "^103.0.0" - } - }, - "node_modules/binaryen": { - "version": "103.0.0", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-103.0.0.tgz", - "integrity": "sha512-dejnXckPWetpBYc021d1hnbM8tECz7cjACKhJWEQEtiqTarYMqLLzH20AthjMgblnySkcRUzEMXbeWPI7UYTQw==", - "bin": { - "wasm-opt": "bin/wasm-opt", - "wasm2js": "bin/wasm2js" - } - } - }, - "dependencies": { - "binaryen": { - "version": "103.0.0", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-103.0.0.tgz", - "integrity": "sha512-dejnXckPWetpBYc021d1hnbM8tECz7cjACKhJWEQEtiqTarYMqLLzH20AthjMgblnySkcRUzEMXbeWPI7UYTQw==" - } - } -} diff --git a/Assets/WX-WASM-SDK/Editor/Node/package-lock.json.meta b/Assets/WX-WASM-SDK/Editor/Node/package-lock.json.meta deleted file mode 100644 index b4175470..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/package-lock.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a12734edb0eab4b4ebe6b38203e8e3ff -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/Node/package.json b/Assets/WX-WASM-SDK/Editor/Node/package.json deleted file mode 100644 index d3849520..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "unity-wasm", - "version": "1.0.0", - "description": "", - "author": "", - "license": "ISC", - "dependencies": { - "binaryen": "^103.0.0" - } -} diff --git a/Assets/WX-WASM-SDK/Editor/Node/package.json.meta b/Assets/WX-WASM-SDK/Editor/Node/package.json.meta deleted file mode 100644 index 5597bc45..00000000 --- a/Assets/WX-WASM-SDK/Editor/Node/package.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b7da9cba2e99b4eaf9c4813ef99dd093 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI b/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI deleted file mode 100755 index 250a4ace..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI.exe.meta b/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI.exe.meta deleted file mode 100644 index 873748dd..00000000 --- a/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI.exe.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b24e50552812c4744bee4993ab8c8100 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI.meta b/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI.meta deleted file mode 100644 index ced28211..00000000 --- a/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: bcb8bb06aa1a44d7cbca104dd2861127 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/PicCompressor.cs b/Assets/WX-WASM-SDK/Editor/PicCompressor.cs deleted file mode 100644 index 3aef4c47..00000000 --- a/Assets/WX-WASM-SDK/Editor/PicCompressor.cs +++ /dev/null @@ -1,139 +0,0 @@ -using UnityEngine; -using System.IO; -using System.Threading; - -namespace WeChatWASM -{ - - - public class PicTask - { - /// - /// 0: png, 1:astc, 2:etc2,3:pvrtc - /// - public int type; - /// - /// 图片路径 - /// - public string src; - public string dst; - public int width; - public int height; - } - - /// - /// 基于ImageMagick的图片处理 - /// - /// - public static class PicCompressor - { - - static string ASTCPath; - static string PVRTCPath; - static string PNGPath; - static string DXT5Path; - static Semaphore sempore = new Semaphore(8, 8); //最多设置8个进程 - - - - public static string GetASTCPath() - { - if (Application.platform == RuntimePlatform.WindowsEditor) - { - return Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/astcenc-sse4.1.exe"); - } - if (UnityEngine.SystemInfo.processorType.ToLower().Contains("apple")) { - return Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/astcenc-neon"); - } - return Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/astcenc-avx2"); - } - - public static string GetPVRTCPath() - { - return Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/PVRTexToolCLI" + (Application.platform == RuntimePlatform.WindowsEditor ? ".exe" : "")); - } - - - public static string GetDXT5Path() - { - return Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/PVRTexToolCLI" + (Application.platform == RuntimePlatform.WindowsEditor ? ".exe" : "")); - } - - public static string GetPNGPath() - { - return Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/pngquant" + (Application.platform == RuntimePlatform.WindowsEditor ? ".exe" : "")); - } - - - - - public static void TestASTC() - { - - var p = new System.Diagnostics.Process(); - p.StartInfo.FileName = GetASTCPath(); - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardInput = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.RedirectStandardError = true; - p.StartInfo.CreateNoWindow = true; - p.StartInfo.Arguments = " -help"; - - - p.Start(); - - - - string strOuput = p.StandardOutput.ReadToEnd(); - Debug.Log(strOuput); - p.WaitForExit(); - p.Close(); - - } - - public static void TestMinPNG() - { - - var p = new System.Diagnostics.Process(); - p.StartInfo.FileName = GetPNGPath(); - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardInput = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.RedirectStandardError = true; - p.StartInfo.CreateNoWindow = true; - p.StartInfo.Arguments = " -help"; - - - p.Start(); - - - /* - string strOuput = p.StandardOutput.ReadToEnd(); - Debug.Log(strOuput); - p.WaitForExit(); - p.Close(); - */ - - } - - public static void TestPVRTC() - { - - var p = new System.Diagnostics.Process(); - p.StartInfo.FileName = GetPVRTCPath(); - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardInput = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.RedirectStandardError = true; - p.StartInfo.CreateNoWindow = true; - p.StartInfo.Arguments = " -help"; - - - p.Start(); - - } - - - - } -} diff --git a/Assets/WX-WASM-SDK/Editor/PicCompressor.cs.meta b/Assets/WX-WASM-SDK/Editor/PicCompressor.cs.meta deleted file mode 100644 index fef5baec..00000000 --- a/Assets/WX-WASM-SDK/Editor/PicCompressor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 754294920db552147b647fac612b55d2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/ReplaceRules.cs b/Assets/WX-WASM-SDK/Editor/ReplaceRules.cs deleted file mode 100644 index 48f04188..00000000 --- a/Assets/WX-WASM-SDK/Editor/ReplaceRules.cs +++ /dev/null @@ -1,439 +0,0 @@ -using UnityEngine; -using System.Collections; - -namespace WeChatWASM -{ - public class Rule - { - public string old; - public string newStr; - } - - public class ReplaceRules - { - public static Rule[] rules = { - new Rule() - { - old=@"function *doRun\(\) *{", - newStr="function doRun() {GameGlobal.manager.TimeLogger.timeStart(\"callMain耗时\");" - }, - new Rule() - { - old=@"calledMain *= *true", - newStr="if(ABORT===true)return;calledMain = true;if(Module.calledMainCb){Module.calledMainCb()}" - }, - new Rule() - { - old="self\\[\"performance\"\\]\\[\"now\"\\]", - newStr="wx.getPerformance().now" - } - ,new Rule() - { - old="self\\[\"performance\"\\]", - newStr="wx.getPerformance && wx.getPerformance()" - },new Rule() - { - old="var IDBFS", - newStr="var IDBFS = GameGlobal.unityNamespace.IDBFS" - }, - new Rule() - { - old=@"return WebAssembly\.instantiate *\(binary *, *info\)", - newStr="if(Module[\"wasmBin\"]){return WebAssembly.instantiate(Module[\"wasmBin\"], info);}return WebAssembly.instantiate(Module[\"wasmPath\"], info)" - }, - new Rule() - { - old="var FS *=", - newStr="var FS = GameGlobal.unityNamespace.FS=" - }, - // ----MemoryProfiler Begin-----// - new Rule() - { - old="(new Error).stack.toString()", - newStr="\"\"" - }, - new Rule() - { - old="if *\\(location.search.toLowerCase", - newStr="return; if(location.search.toLowerCase" - }, - new Rule() - { - old="if *\\(this.hookStackAlloc", - newStr="return;if(this.hookStackAlloc" - }, - // ----MemoryProfiler End-----// -#if !UNITY_2021 - new Rule() - { - old=@"t\.clientX *- *canvasRect\.left", - newStr="(t.clientX - canvasRect.left) * window._ScaleRate * (canvas.width / window.innerWidth / devicePixelRatio)" - },new Rule() - { - old=@"t\.clientY *- *canvasRect\.top", - newStr="(t.clientY - canvasRect.top) * window._ScaleRate * (canvas.height / window.innerHeight / devicePixelRatio)" - },new Rule() - { - old=@"t\.clientX *- *targetRect\.left", - newStr="(t.clientX - targetRect.left) * window._ScaleRate * (canvas.width / window.innerWidth / devicePixelRatio)" - },new Rule() - { - old=@"t\.clientY *- *targetRect\.top", - newStr="(t.clientY - targetRect.top) * window._ScaleRate * (canvas.height / window.innerHeight / devicePixelRatio)" - }, -#endif - new Rule() - { - old=@"document\.URL", - newStr="GameGlobal.unityNamespace.DATA_CDN || \"https://game.weixin.qq.com\"" - },new Rule() - { - old=@"canvas\.style\.setProperty *\(", - newStr="if(canvas.style.setProperty)canvas.style.setProperty(" - },new Rule() - { - old=@"canvas\.style\.removeProperty *\(", - newStr="if(canvas.style.removeProperty)canvas.style.removeProperty(" - },new Rule() - { - old="if *\\(!\\(Module\\[\"wasmMemory\"\\]", - newStr="if(!Module.IsWxGame && !(Module[\"wasmMemory\"]" - }, - new Rule() - { - old=@"function *getBinary *\( *\) *{", - newStr="function getBinary() {return;" - },new Rule() - { - old="addRunDependency\\(\"wasm-instantiate\"\\)", - newStr="addRunDependency(\"wasm-instantiate\");addRunDependency(\"wasm-preloadAssets\");GameGlobal.manager.TimeLogger.timeStart(\"wasm编译耗时\");" - },new Rule() - { - old="removeRunDependency\\(\"wasm-instantiate\"\\)", - newStr="if(Module.wasmInstantiated){Module.wasmInstantiated();removeRunDependency(\"wasm-instantiate\")}" - }, - new Rule() - { - old="var runDependencies", - newStr="var runDependencies = GameGlobal.unityNamespace.runDependencies" - }, - new Rule() - { - old=@"function *addRunDependency *\(id\) *{", - newStr="function addRunDependency(id) {console.log(\"addRunDependency: \", id);" - }, - new Rule() - { - old=@"function *removeRunDependency *\(id\) *{", - newStr="function removeRunDependency(id) {console.log(\"removeRunDependency: \", id);" - }, - new Rule() - { - old=": *_JS_Sound_Create_Channel", - newStr=":window.WXWASMSDK._JS_Sound_Create_Channel" - }, - new Rule() - { - old=": *_JS_Sound_GetLength", - newStr=":window.WXWASMSDK._JS_Sound_GetLength" - },new Rule() - { - old=": *_JS_Sound_GetLoadState", - newStr=":window.WXWASMSDK._JS_Sound_GetLoadState" - },new Rule() - { - old=": *_JS_Sound_Init", - newStr=":window.WXWASMSDK._JS_Sound_Init" - },new Rule() - { - old=": *_JS_Sound_Load", - newStr=":window.WXWASMSDK._JS_Sound_Load" - },new Rule() - { - old=": *_JS_Sound_Load_PCM", - newStr=":window.WXWASMSDK._JS_Sound_Load_PCM" - },new Rule() - { - old=": *_JS_Sound_Play", - newStr=":window.WXWASMSDK._JS_Sound_Play" - },new Rule() - { - old=": *_JS_Sound_ReleaseInstance", - newStr=":window.WXWASMSDK._JS_Sound_ReleaseInstance" - }, new Rule() - { - old=": *_JS_Sound_ResumeIfNeeded", - newStr=":window.WXWASMSDK._JS_Sound_ResumeIfNeeded" - },new Rule() - { - old=": *_JS_Sound_Set3D", - newStr=":window.WXWASMSDK._JS_Sound_Set3D" - },new Rule() - { - old=": *_JS_Sound_SetListenerOrientation", - newStr=":window.WXWASMSDK._JS_Sound_SetListenerOrientation" - },new Rule() - { - old=": *_JS_Sound_SetListenerPosition", - newStr=":window.WXWASMSDK._JS_Sound_SetListenerPosition" - }, - new Rule() - { - old=": *_JS_Sound_SetLoop", - newStr=":window.WXWASMSDK._JS_Sound_SetLoop" - },new Rule() - { - old=": *_JS_Sound_SetLoopPoints", - newStr=":window.WXWASMSDK._JS_Sound_SetLoopPoints" - },new Rule() - { - old=": *_JS_Sound_SetPaused", - newStr=":window.WXWASMSDK._JS_Sound_SetPaused" - },new Rule() - { - old=": *_JS_Sound_SetPitch", - newStr=":window.WXWASMSDK._JS_Sound_SetPitch" - },new Rule() - { - old=": *_JS_Sound_SetPosition", - newStr=":window.WXWASMSDK._JS_Sound_SetPosition" - },new Rule() - { - old=": *_JS_Sound_SetVolume", - newStr=":window.WXWASMSDK._JS_Sound_SetVolume" - },new Rule(){ - old=": *_JS_Sound_Stop", - newStr=":window.WXWASMSDK._JS_Sound_Stop" - },new Rule() - { - old="assert\\(typeof Module\\[\"pthreadMainPrefixURL\"\\]", - newStr="// assert(typeof Module[\"pthreadMainPrefixURL\"]" - },new Rule() - { - old=@"var *Browser *=", - - newStr="var Browser = GameGlobal.unityNamespace.Browser =" - },new Rule() - { - old="safeSetInterval: *\\( *function *\\(func, *timeout\\) *{[\\s\\S]*?Module\\[\"noExitRuntime\"\\] *= *true;", - newStr="safeSetInterval: (function(func, timeout) {Module[\"noExitRuntime\"] = true;if (!GameGlobal.unityNamespace.isLoopRunnerEnable) return;" - },new Rule() - { - old=@"_emscripten_set_main_loop_timing\(1, *1\)", - newStr="_emscripten_set_main_loop_timing(1, 1);if (!GameGlobal.unityNamespace.isLoopRunnerEnable) return;" - },new Rule(){ - old="\"parent\": *Module\\b", - newStr="\"parent\": Module,wx:{ignore_opt_glue_apis:[\"_glGenTextures\",\"_glBindTexture\",\"_glDeleteTextures\",\"_glFramebufferTexture2D\",\"_glIsTexture\",\"_glCompressedTexImage2D\",\"_glGetString\"]}" - },new Rule(){ - old = "GL.createContext\\(([^)]+)\\);", - newStr="GL.createContext($1);WXWASMSDK.canvasContext && WXWASMSDK.canvasContext._triggerCallback();" - },new Rule(){ - old = "throw\"abort", - newStr = "if(Module.IsWxGame)window.WXWASMSDK.WXUncaughtException(true);else throw\"abort" - }, - new Rule(){ - old = "err\\(\"Looks like", - newStr = "console.warn(\"Looks like" - }, - new Rule(){ - old = "case 4:console.error", - newStr = "case 4:if(str.startsWith('An abnormal situation')){if(GameGlobal.logAbNormalOnce!=undefined)return;GameGlobal.logAbNormalOnce=1;}if(str.indexOf('is corrupted! Remove it and launch unity again!')>-1){return;}console.error" - }, - new Rule(){ - old = @"console.error\(", - newStr = "err(" - }, - new Rule(){ - old = "Module\\[\"ccall\"\\] *=", - newStr = " Module['GL'] = GL; Module['ccall'] =" - }, - new Rule(){ - old = "var exts *= *GLctx\\.getSupportedExtensions\\(\\)( *\\|\\| *\\[\\])?;", - newStr = "var exts = GLctx.getSupportedExtensions() || [];GameGlobal.USED_TEXTURE_COMPRESSION && exts.push('WEBGL_compressed_texture_etc1');" - }, - new Rule(){ - old = "Browser.mainLoop.runIter", - newStr = "if(GameGlobal.manager.isVisible) Browser.mainLoop.runIter" - }, - new Rule(){ - old = "function _glTexStorage2D\\(x0, *x1, *x2, *x3, *x4\\) *{", - newStr = "function _glTexStorage2D(x0, x1, x2, x3, x4) {window._lastTexStorage2DParams = [x0, x1, x2, x3, x4];if(x2 == 36196){return;}" - }, -#if UNITY_2020 - new Rule() - { - old="FileSystem_Initialize\\(\\) *{", - newStr="FileSystem_Initialize(){if (!Module.indexedDB) return;" - }, - new Rule() - { - old="_JS_FileSystem_Sync\\(\\) *{", - newStr="_JS_FileSystem_Sync(){if (!Module.indexedDB) return;" - }, - new Rule() - { - old="Module.SystemInfo", - newStr="UnityLoader.SystemInfo" - }, - new Rule() - { - old=@"GetStreamingAssetsURL\(buffer, *bufferSize\) *{", - newStr="GetStreamingAssetsURL(buffer,bufferSize){if(Module.IsWxGame) Module.streamingAssetsUrl=Module.resolveBuildUrl(\"StreamingAssets\");" - }, - -#endif -#if UNITY_2021 - new Rule() - { - old="if *\\(buffer.buffer *=== *HEAP8.buffer", - newStr="if (!Module.IsWxGame && buffer.buffer === HEAP8.buffer" - }, - new Rule() - { - old="return ext.getSupportedProfiles\\(", - newStr="return Module.IsWxGame ? false:ext.getSupportedProfiles(" - }, - new Rule() - { - old="function UTF8ToString", - newStr="function Pointer_stringify(ptr){return UTF8ToString(ptr)}function UTF8ToString" - }, - new Rule() - { - old=@"var result *= *WebAssembly\.instantiate *\(binary *, *info\)", - newStr="if(Module[\"wasmBin\"]){return WebAssembly.instantiate(Module[\"wasmBin\"], info);}return WebAssembly.instantiate(Module[\"wasmPath\"], info)" - }, - - new Rule() - { - old="if *\\(readAsync", - newStr="if (readAsync && !Module.IsWxGame" - }, - new Rule() - { - old="return ver", - newStr="if(Module.IsWxGame)return gl;return ver" - }, - new Rule() - { - old="Module.SystemInfo", - newStr="UnityLoader.SystemInfo" - }, - new Rule() - { - old="FileSystem_Initialize\\(\\) *{", - newStr="FileSystem_Initialize(){if (!Module.indexedDB) return;" - }, - new Rule() - { - old="return JSEvents.lastGamepadState", - newStr="return Module.IsWxGame ? 0 : JSEvents.lastGamepadState" - }, - new Rule() - { - old=@"function *_emscripten_get_num_gamepads *\( *\) *{", - newStr="function _emscripten_get_num_gamepads(){ if(Module.IsWxGame)return 0;" - }, - new Rule() - { - old="fs.sync\\(false\\)", - newStr="if(Module.IsWxGame)return;fs.sync(false)" - }, - new Rule() - { - old=@"function *getBinary *\(file *\) *{", - newStr="function getBinary(file) {return;" - }, - new Rule() - { - old=@"GetStreamingAssetsURL\(buffer, *bufferSize\) *{", - newStr="GetStreamingAssetsURL(buffer,bufferSize){if(Module.IsWxGame) Module.streamingAssetsUrl=Module.resolveBuildUrl(\"StreamingAssets\");" - }, - new Rule() - { - - old="abort\\(\"randomDevice\"\\)", - newStr="if(Module.IsWxGame)return Math.random()*256|0;abort(\"randomDevice\")" - }, - new Rule() - { - old=@"function *getRandomDevice *\( *\) *{", - newStr="function getRandomDevice(){ if(Module.IsWxGame)return function () {return Math.random() * 256 | 0};" - }, - new Rule() - { - old="!Module\\[\"canvas\"\\].id", - newStr="!Module.IsWxGame && !Module[\"canvas\"].id" - }, - new Rule() - { - old="typeof allocator === \"number\"", - newStr="true" - }, - new Rule() - { - old="typeof slab !== \"number\"", - newStr="true" - }, - new Rule() - { - old="var message=\"abort", - newStr="if(Module.IsWxGame)window.WXWASMSDK.WXUncaughtException(true);var message=\"abort" - }, - new Rule() - { - old="what=\"abort", - newStr="if(Module.IsWxGame)window.WXWASMSDK.WXUncaughtException(true);what=\"abort" - }, -#endif -#if UNITY_2021_3_OR_NEWER - new Rule() - { - old="new AbortController(\\(\\)|\\b);?", - newStr="new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest();if(GameGlobal.TEXTURE_PARALLEL_BUNDLE){GameGlobal.ParalleLDownloadTexture(_url)}" - }, - new Rule() - { - old="fetchImpl\\(", - newStr="fetchImpl = abortController.openAndSend;fetchImpl(" - }, - new Rule() - { - old="requestOptions.init.body *= *new Blob\\(\\[ *postData *\\]\\)", - newStr="requestOptions.init.body = postData" - }, - new Rule(){ - old = "function HandleError\\(err, *code\\) *{", - newStr = "function HandleError(err, code){ abortController.retryCount = abortController.retryCount || 0; if (typeof abortController !='undefined' && abortController.paramsCache.method === 'GET' && /\\b(settings|catalog)\\.json\\b/.test(abortController.paramsCache.url) && abortController.retryCount<2) {return setTimeout(function () {_reTryRequest(requestId, arg, onresponse)}, 1000);}" - }, - new Rule() - { - old="function _JS_WebRequest_Send", - newStr="function _reTryRequest(requestId,arg,onresponse,needRetry){var abortController = wr.abortControllers[requestId];abortController.retryCount = abortController.retryCount || 0;abortController.retryCount++;var xml=new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest();xml.open('GET',abortController.paramsCache.url,true);xml.responseType=abortController.responseType;xml.onload=function(){if(abortController.status>=400&&needRetry){setTimeout(function(){_reTryRequest(requestId,arg,onresponse)},1000);return false;}else{if(onresponse){var kWebRequestOK=0;var byteArray=new Uint8Array(xml.response);if(byteArray.length!=0){var buffer=_malloc(byteArray.length);HEAPU8.set(byteArray,buffer);dynCall('viiiiii',onresponse,[arg,xml.status,buffer,byteArray.length,0,kWebRequestOK])}else{dynCall('viiiiii',onresponse,[arg,xml.status,0,0,0,kWebRequestOK])}}}};xml.send(abortController.postData);xml.onerror=abortController.onerror;xml.ontimeout=abortController.ontimeout;xml.onabort=abortController.onabort;console.error('load url error:' + abortController.paramsCache.url);GameGlobal.logmanager.warn('load url error:'+abortController.paramsCache.url);GameGlobal.realtimeLogManager.error('load url error:'+abortController.paramsCache.url);} function _JS_WebRequest_Send" - } -#else - new Rule() - { - old = "function _JS_WebRequest_SetResponseHandler", - newStr = "function _reTryRequest(request,arg,onresponse,needRetry){var http=wr.requestInstances[request];http.retryCount = http.retryCount || 0;http.retryCount++;var xml=new XMLHttpRequest();xml.open('GET',http.paramsCache.url,true);xml.responseType=http.responseType;xml.onload=function(){if(http.status>=400&&needRetry){setTimeout(function(){_reTryRequest(request,arg,onresponse)},1000);return false;}else{if(onresponse){var kWebRequestOK=0;var byteArray=new Uint8Array(xml.response);if(byteArray.length!=0){var buffer=_malloc(byteArray.length);HEAPU8.set(byteArray,buffer);dynCall('viiiiii',onresponse,[arg,xml.status,buffer,byteArray.length,0,kWebRequestOK])}else{dynCall('viiiiii',onresponse,[arg,xml.status,0,0,0,kWebRequestOK])}}}};xml.send(http.postData);xml.onerror=http.onerror;xml.ontimeout=http.ontimeout;xml.onabort=http.onabort;console.error('load url error:' + http.paramsCache.url);GameGlobal.logmanager.warn('load url error:'+http.paramsCache.url);GameGlobal.realtimeLogManager.error('load url error:'+http.paramsCache.url);} function _JS_WebRequest_SetResponseHandler" - }, - new Rule(){ - old = "function HandleError\\(err, *code\\) *{", - newStr = "function HandleError(err, code){ http.retryCount = http.retryCount || 0; if (typeof http !='undefined' && http.paramsCache.method === 'GET' && /\\b(settings|catalog)\\.json\\b/.test(http.paramsCache.url) && http.retryCount<2) {return setTimeout(function () {_reTryRequest(request, arg, onresponse)}, 1000);}" - }, - new Rule(){ - old = "function http_onload\\(e\\) *{", - newStr = "function http_onload(e){if(http.status>=400&&http.paramsCache.method==='GET'&&/\\b(settings|catalog)\\.json\\b/.test(http.paramsCache.url)){return _reTryRequest(request,arg,onresponse,true)}" - }, - new Rule() - { - old="http\\.open\\( *_method *, *_url *, *true *\\);", - newStr="if(GameGlobal.TEXTURE_PARALLEL_BUNDLE){GameGlobal.ParalleLDownloadTexture(_url)}var http = new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest();http.open(_method, _url, true);" - } -#endif - }; - } - -} - - diff --git a/Assets/WX-WASM-SDK/Editor/ReplaceRules.cs.meta b/Assets/WX-WASM-SDK/Editor/ReplaceRules.cs.meta deleted file mode 100644 index a629f21b..00000000 --- a/Assets/WX-WASM-SDK/Editor/ReplaceRules.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7d4d943d555e9d649bf3a8d38bbb8468 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor.meta deleted file mode 100644 index fbd81ae9..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9bfdfa6d07f874eb48f3a20fe09b179d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release.meta deleted file mode 100644 index 72224840..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 39930b96569c1493f8bfab64c4e1643f -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/AssetsTools.NET.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/AssetsTools.NET.dll deleted file mode 100644 index bb47b850..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/AssetsTools.NET.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/AssetsTools.NET.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/AssetsTools.NET.dll.meta deleted file mode 100644 index f9f8763c..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/AssetsTools.NET.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 223111426b53a4573b5c2a670c3bfe37 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Mdb.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Mdb.dll deleted file mode 100644 index 6927d738..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Mdb.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Mdb.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Mdb.dll.meta deleted file mode 100644 index df48b2e1..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Mdb.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 2090b7dc8553349e9bccd6c134fd9ab5 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Rocks.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Rocks.dll deleted file mode 100644 index 63081650..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Rocks.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Rocks.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Rocks.dll.meta deleted file mode 100644 index 89025bfb..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.Rocks.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 1eac7a8fa06404390b20a6114156c30a -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.dll deleted file mode 100644 index 1774f624..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.dll.meta deleted file mode 100644 index f9cd4b5f..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/Mono.Cecil.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 595965503343d48e28189108b69672e0 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.dll deleted file mode 100644 index c34e1940..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.dll.meta deleted file mode 100644 index 53d7328a..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: c5a9fda64938c40e0b15033702dde422 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.xml b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.xml deleted file mode 100644 index b1a8f1e4..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.xml +++ /dev/null @@ -1,64413 +0,0 @@ - - - - SixLabors.ImageSharp - - - - - Extension methods over Image{TPixel} - - - - - For a given file path find the best encoder to use via its extension. - - The source image. - The target file path to save the image to. - The file path is null. - No encoder available for provided path. - The matching . - - - - Accepts a to implement a double-dispatch pattern in order to - apply pixel-specific operations on non-generic instances - - The source image. - The image visitor. - - - - Accepts a to implement a double-dispatch pattern in order to - apply pixel-specific operations on non-generic instances - - The source image. - The image visitor. - The token to monitor for cancellation requests. - A representing the asynchronous operation. - - - - Gets the configuration for the image. - - The source image. - Returns the configuration. - - - - Gets the configuration for the image frame. - - The source image. - Returns the configuration. - - - - Gets the configuration. - - The source image - Returns the bounds of the image - - - - Gets the representation of the pixels as a containing the backing pixel data of the image - stored in row major order, as a list of contiguous blocks in the source image's pixel format. - - The source image. - The type of the pixel. - The . - - Certain Image Processors may invalidate the returned and all it's buffers, - therefore it's not recommended to mutate the image while holding a reference to it's . - - - - - Gets the representation of the pixels as a containing the backing pixel data of the image - stored in row major order, as a list of contiguous blocks in the source image's pixel format. - - The source image. - The type of the pixel. - The . - - Certain Image Processors may invalidate the returned and all it's buffers, - therefore it's not recommended to mutate the image while holding a reference to it's . - - - - - Gets the representation of the pixels as a of contiguous memory - at row beginning from the the first pixel on that row. - - The type of the pixel. - The source. - The row. - The - - - - Gets the representation of the pixels as of of contiguous memory - at row beginning from the the first pixel on that row. - - The type of the pixel. - The source. - The row. - The - - - - Gets the assigned to 'source'. - - The source image. - Returns the configuration. - - - - Unlike traditional Mono/.NET, code on the iPhone is statically compiled ahead of time instead of being - compiled on demand by a JIT compiler. This means there are a few limitations with respect to generics, - these are caused because not every possible generic instantiation can be determined up front at compile time. - The Aot Compiler is designed to overcome the limitations of this compiler. - None of the methods in this class should ever be called, the code only has to exist at compile-time to be picked up by the AoT compiler. - (Very similar to the LinkerIncludes.cs technique used in Xamarin.Android projects.) - - - - - This is the method that seeds the AoT compiler. - None of these seed methods needs to actually be called to seed the compiler. - The calls just need to be present when the code is compiled, and each implementation will be built. - - - This method doesn't actually do anything but serves an important purpose... - If you are running ImageSharp on iOS and try to call SaveAsGif, it will throw an exception: - "Attempting to JIT compile method... OctreeFrameQuantizer.ConstructPalette... while running in aot-only mode." - The reason this happens is the SaveAsGif method makes heavy use of generics, which are too confusing for the AoT - compiler used on Xamarin.iOS. It spins up the JIT compiler to try and figure it out, but that is an illegal op on - iOS so it bombs out. - If you are getting the above error, you need to call this method, which will pre-seed the AoT compiler with the - necessary methods to complete the SaveAsGif call. That's it, otherwise you should NEVER need this method!!! - - - - - Seeds the compiler using the given pixel format. - - The pixel format. - - - - This method pre-seeds the for a given pixel format in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The encoder. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The decoder. - - - - This method pre-seeds the all in the AoT compiler. - - - There is no structure that implements ISwizzler. - - The pixel format. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The processor type - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The processor type - - - - This method pre-seeds the all in the AoT compiler. - - - There is no structure that implements ISwizzler. - - The pixel format. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The processor type - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The processor type - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The quantizer type - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The dither. - - - - This method pre-seeds the all in the AoT compiler. - - The pixel format. - - - - This method pre-seeds the in the AoT compiler. - - The pixel format. - The buffer. - - - - Defines the contract for objects that can provide access to configuration. - - - - - Gets the configuration which allows altering default behaviour or extending the library. - - - - - A visitor to implement a double-dispatch pattern in order to apply pixel-specific operations - on non-generic instances. - - - - - Provides a pixel-specific implementation for a given operation. - - The image. - The pixel type. - - - - A visitor to implement a double-dispatch pattern in order to apply pixel-specific operations - on non-generic instances. - - - - - Provides a pixel-specific implementation for a given operation. - - The image. - The token to monitor for cancellation requests. - The pixel type. - A representing the asynchronous operation. - - - - Encapsulates the basic properties and methods required to manipulate images. - - - - - Gets the pixel buffer. - - - - - Encapsulates the basic properties and methods required to manipulate images. - - The type of the pixel. - - - - Gets the pixel buffer. - - - - - Defines the contract for an action that operates on a row interval. - - - - - Invokes the method passing the row interval. - - The row interval. - - - - Defines the contract for an action that operates on a row interval with a temporary buffer. - - The type of buffer elements. - - - - Invokes the method passing the row interval and a buffer. - - The row interval. - The contiguous region of memory. - - - - Defines the contract for an action that operates on a row. - - - - - Invokes the method passing the row y coordinate. - - The row y coordinate. - - - - Defines the contract for an action that operates on a row with a temporary buffer. - - The type of buffer elements. - - - - Invokes the method passing the row and a buffer. - - The row y coordinate. - The contiguous region of memory. - - - - Defines execution settings for methods in . - - - - - Default value for . - - - - - Initializes a new instance of the struct. - - The value used for initializing when using TPL. - The value for . - The . - - - - Initializes a new instance of the struct. - - The value used for initializing when using TPL. - The . - - - - Gets the . - - - - - Gets the value used for initializing when using TPL. - - - - - Gets the minimum number of pixels being processed by a single task when parallelizing operations with TPL. - Launching tasks for pixel regions below this limit is not worth the overhead. - Initialized with by default, - the optimum value is operation specific. (The cheaper the operation, the larger the value is.) - - - - - Creates a new instance of - having multiplied by - - The value to multiply with. - The modified . - - - - Get the default for a - - The . - The . - - - - Utility methods for batched processing of pixel row intervals. - Parallel execution is optimized for image processing based on values defined - or . - Using this class is preferred over direct usage of utility methods. - - - Utility methods for batched processing of pixel row intervals. - Parallel execution is optimized for image processing based on values defined - or . - Using this class is preferred over direct usage of utility methods. - - - - - Iterate through the rows of a rectangle in optimized batches. - - The type of row operation to perform. - The to get the parallel settings from. - The . - The operation defining the iteration logic on a single row. - - - - Iterate through the rows of a rectangle in optimized batches. - - The type of row operation to perform. - The . - The . - The operation defining the iteration logic on a single row. - - - - Iterate through the rows of a rectangle in optimized batches. - instantiating a temporary buffer for each invocation. - - The type of row operation to perform. - The type of buffer elements. - The to get the parallel settings from. - The . - The operation defining the iteration logic on a single row. - - - - Iterate through the rows of a rectangle in optimized batches. - instantiating a temporary buffer for each invocation. - - The type of row operation to perform. - The type of buffer elements. - The . - The . - The operation defining the iteration logic on a single row. - - - - Iterate through the rows of a rectangle in optimized batches defined by -s. - - The type of row operation to perform. - The to get the parallel settings from. - The . - The operation defining the iteration logic on a single . - - - - Iterate through the rows of a rectangle in optimized batches defined by -s. - - The type of row operation to perform. - The . - The . - The operation defining the iteration logic on a single . - - - - Iterate through the rows of a rectangle in optimized batches defined by -s - instantiating a temporary buffer for each invocation. - - The type of row operation to perform. - The type of buffer elements. - The to get the parallel settings from. - The . - The operation defining the iteration logic on a single . - - - - Iterate through the rows of a rectangle in optimized batches defined by -s - instantiating a temporary buffer for each invocation. - - The type of row operation to perform. - The type of buffer elements. - The . - The . - The operation defining the iteration logic on a single . - - - - This is necessary to avoid being excluded from compilation in environments that do AOT builds, such as Unity's IL2CPP and Xamarin. - The only thing that matters is the class name. - There is no need to use or inherit from the PreserveAttribute class in each environment. - - - - - Contains constructors and implicit conversion methods. - - - Represents a color value that is convertible to any type. - - - The internal representation and layout of this structure is hidden by intention. - It's not serializable, and it should not be considered as part of a contract. - Unlike System.Drawing.Color, has to be converted to a specific pixel value - to query the color components. - - - Contains static named color values. - - - - Contains the definition of . - - - Contains the definition of . - - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Initializes a new instance of the struct. - - The containing the color information. - - - - Converts a to . - - The . - The . - - - - Converts an to . - - The . - The . - - - - Checks whether two structures are equal. - - The left hand operand. - The right hand operand. - - True if the parameter is equal to the parameter; - otherwise, false. - - - - - Checks whether two structures are not equal. - - The left hand operand. - The right hand operand. - - True if the parameter is not equal to the parameter; - otherwise, false. - - - - - Creates a from RGBA bytes. - - The red component (0-255). - The green component (0-255). - The blue component (0-255). - The alpha component (0-255). - The . - - - - Creates a from RGB bytes. - - The red component (0-255). - The green component (0-255). - The blue component (0-255). - The . - - - - Creates a from the given . - - The pixel to convert from. - The pixel format. - The . - - - - Creates a new instance of the struct - from the given hexadecimal string. - - - The hexadecimal representation of the combined color components arranged - in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. - - - The . - - - - - Attempts to creates a new instance of the struct - from the given hexadecimal string. - - - The hexadecimal representation of the combined color components arranged - in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. - - When this method returns, contains the equivalent of the hexadecimal input. - - The . - - - - - Creates a new instance of the struct - from the given input string. - - - The name of the color or the hexadecimal representation of the combined color components arranged - in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. - - - The . - - - - - Attempts to creates a new instance of the struct - from the given input string. - - - The name of the color or the hexadecimal representation of the combined color components arranged - in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. - - When this method returns, contains the equivalent of the hexadecimal input. - - The . - - - - - Alters the alpha channel of the color, returning a new instance. - - The new value of alpha [0..1]. - The color having it's alpha channel altered. - - - - Gets the hexadecimal representation of the color instance in rrggbbaa form. - - A hexadecimal string representation of the value. - - - - - - - Converts the color instance to a specified type. - - The pixel type to convert to. - The pixel value. - - - - Bulk converts a span of to a span of a specified type. - - The pixel type to convert to. - The configuration. - The source color span. - The destination pixel span. - - - - - - - - - - - - - Represents a matching the W3C definition that has an hex value of #F0F8FF. - - - - - Represents a matching the W3C definition that has an hex value of #FAEBD7. - - - - - Represents a matching the W3C definition that has an hex value of #00FFFF. - - - - - Represents a matching the W3C definition that has an hex value of #7FFFD4. - - - - - Represents a matching the W3C definition that has an hex value of #F0FFFF. - - - - - Represents a matching the W3C definition that has an hex value of #F5F5DC. - - - - - Represents a matching the W3C definition that has an hex value of #FFE4C4. - - - - - Represents a matching the W3C definition that has an hex value of #000000. - - - - - Represents a matching the W3C definition that has an hex value of #FFEBCD. - - - - - Represents a matching the W3C definition that has an hex value of #0000FF. - - - - - Represents a matching the W3C definition that has an hex value of #8A2BE2. - - - - - Represents a matching the W3C definition that has an hex value of #A52A2A. - - - - - Represents a matching the W3C definition that has an hex value of #DEB887. - - - - - Represents a matching the W3C definition that has an hex value of #5F9EA0. - - - - - Represents a matching the W3C definition that has an hex value of #7FFF00. - - - - - Represents a matching the W3C definition that has an hex value of #D2691E. - - - - - Represents a matching the W3C definition that has an hex value of #FF7F50. - - - - - Represents a matching the W3C definition that has an hex value of #6495ED. - - - - - Represents a matching the W3C definition that has an hex value of #FFF8DC. - - - - - Represents a matching the W3C definition that has an hex value of #DC143C. - - - - - Represents a matching the W3C definition that has an hex value of #00FFFF. - - - - - Represents a matching the W3C definition that has an hex value of #00008B. - - - - - Represents a matching the W3C definition that has an hex value of #008B8B. - - - - - Represents a matching the W3C definition that has an hex value of #B8860B. - - - - - Represents a matching the W3C definition that has an hex value of #A9A9A9. - - - - - Represents a matching the W3C definition that has an hex value of #006400. - - - - - Represents a matching the W3C definition that has an hex value of #A9A9A9. - - - - - Represents a matching the W3C definition that has an hex value of #BDB76B. - - - - - Represents a matching the W3C definition that has an hex value of #8B008B. - - - - - Represents a matching the W3C definition that has an hex value of #556B2F. - - - - - Represents a matching the W3C definition that has an hex value of #FF8C00. - - - - - Represents a matching the W3C definition that has an hex value of #9932CC. - - - - - Represents a matching the W3C definition that has an hex value of #8B0000. - - - - - Represents a matching the W3C definition that has an hex value of #E9967A. - - - - - Represents a matching the W3C definition that has an hex value of #8FBC8F. - - - - - Represents a matching the W3C definition that has an hex value of #483D8B. - - - - - Represents a matching the W3C definition that has an hex value of #2F4F4F. - - - - - Represents a matching the W3C definition that has an hex value of #2F4F4F. - - - - - Represents a matching the W3C definition that has an hex value of #00CED1. - - - - - Represents a matching the W3C definition that has an hex value of #9400D3. - - - - - Represents a matching the W3C definition that has an hex value of #FF1493. - - - - - Represents a matching the W3C definition that has an hex value of #00BFFF. - - - - - Represents a matching the W3C definition that has an hex value of #696969. - - - - - Represents a matching the W3C definition that has an hex value of #696969. - - - - - Represents a matching the W3C definition that has an hex value of #1E90FF. - - - - - Represents a matching the W3C definition that has an hex value of #B22222. - - - - - Represents a matching the W3C definition that has an hex value of #FFFAF0. - - - - - Represents a matching the W3C definition that has an hex value of #228B22. - - - - - Represents a matching the W3C definition that has an hex value of #FF00FF. - - - - - Represents a matching the W3C definition that has an hex value of #DCDCDC. - - - - - Represents a matching the W3C definition that has an hex value of #F8F8FF. - - - - - Represents a matching the W3C definition that has an hex value of #FFD700. - - - - - Represents a matching the W3C definition that has an hex value of #DAA520. - - - - - Represents a matching the W3C definition that has an hex value of #808080. - - - - - Represents a matching the W3C definition that has an hex value of #008000. - - - - - Represents a matching the W3C definition that has an hex value of #ADFF2F. - - - - - Represents a matching the W3C definition that has an hex value of #808080. - - - - - Represents a matching the W3C definition that has an hex value of #F0FFF0. - - - - - Represents a matching the W3C definition that has an hex value of #FF69B4. - - - - - Represents a matching the W3C definition that has an hex value of #CD5C5C. - - - - - Represents a matching the W3C definition that has an hex value of #4B0082. - - - - - Represents a matching the W3C definition that has an hex value of #FFFFF0. - - - - - Represents a matching the W3C definition that has an hex value of #F0E68C. - - - - - Represents a matching the W3C definition that has an hex value of #E6E6FA. - - - - - Represents a matching the W3C definition that has an hex value of #FFF0F5. - - - - - Represents a matching the W3C definition that has an hex value of #7CFC00. - - - - - Represents a matching the W3C definition that has an hex value of #FFFACD. - - - - - Represents a matching the W3C definition that has an hex value of #ADD8E6. - - - - - Represents a matching the W3C definition that has an hex value of #F08080. - - - - - Represents a matching the W3C definition that has an hex value of #E0FFFF. - - - - - Represents a matching the W3C definition that has an hex value of #FAFAD2. - - - - - Represents a matching the W3C definition that has an hex value of #D3D3D3. - - - - - Represents a matching the W3C definition that has an hex value of #90EE90. - - - - - Represents a matching the W3C definition that has an hex value of #D3D3D3. - - - - - Represents a matching the W3C definition that has an hex value of #FFB6C1. - - - - - Represents a matching the W3C definition that has an hex value of #FFA07A. - - - - - Represents a matching the W3C definition that has an hex value of #20B2AA. - - - - - Represents a matching the W3C definition that has an hex value of #87CEFA. - - - - - Represents a matching the W3C definition that has an hex value of #778899. - - - - - Represents a matching the W3C definition that has an hex value of #778899. - - - - - Represents a matching the W3C definition that has an hex value of #B0C4DE. - - - - - Represents a matching the W3C definition that has an hex value of #FFFFE0. - - - - - Represents a matching the W3C definition that has an hex value of #00FF00. - - - - - Represents a matching the W3C definition that has an hex value of #32CD32. - - - - - Represents a matching the W3C definition that has an hex value of #FAF0E6. - - - - - Represents a matching the W3C definition that has an hex value of #FF00FF. - - - - - Represents a matching the W3C definition that has an hex value of #800000. - - - - - Represents a matching the W3C definition that has an hex value of #66CDAA. - - - - - Represents a matching the W3C definition that has an hex value of #0000CD. - - - - - Represents a matching the W3C definition that has an hex value of #BA55D3. - - - - - Represents a matching the W3C definition that has an hex value of #9370DB. - - - - - Represents a matching the W3C definition that has an hex value of #3CB371. - - - - - Represents a matching the W3C definition that has an hex value of #7B68EE. - - - - - Represents a matching the W3C definition that has an hex value of #00FA9A. - - - - - Represents a matching the W3C definition that has an hex value of #48D1CC. - - - - - Represents a matching the W3C definition that has an hex value of #C71585. - - - - - Represents a matching the W3C definition that has an hex value of #191970. - - - - - Represents a matching the W3C definition that has an hex value of #F5FFFA. - - - - - Represents a matching the W3C definition that has an hex value of #FFE4E1. - - - - - Represents a matching the W3C definition that has an hex value of #FFE4B5. - - - - - Represents a matching the W3C definition that has an hex value of #FFDEAD. - - - - - Represents a matching the W3C definition that has an hex value of #000080. - - - - - Represents a matching the W3C definition that has an hex value of #FDF5E6. - - - - - Represents a matching the W3C definition that has an hex value of #808000. - - - - - Represents a matching the W3C definition that has an hex value of #6B8E23. - - - - - Represents a matching the W3C definition that has an hex value of #FFA500. - - - - - Represents a matching the W3C definition that has an hex value of #FF4500. - - - - - Represents a matching the W3C definition that has an hex value of #DA70D6. - - - - - Represents a matching the W3C definition that has an hex value of #EEE8AA. - - - - - Represents a matching the W3C definition that has an hex value of #98FB98. - - - - - Represents a matching the W3C definition that has an hex value of #AFEEEE. - - - - - Represents a matching the W3C definition that has an hex value of #DB7093. - - - - - Represents a matching the W3C definition that has an hex value of #FFEFD5. - - - - - Represents a matching the W3C definition that has an hex value of #FFDAB9. - - - - - Represents a matching the W3C definition that has an hex value of #CD853F. - - - - - Represents a matching the W3C definition that has an hex value of #FFC0CB. - - - - - Represents a matching the W3C definition that has an hex value of #DDA0DD. - - - - - Represents a matching the W3C definition that has an hex value of #B0E0E6. - - - - - Represents a matching the W3C definition that has an hex value of #800080. - - - - - Represents a matching the W3C definition that has an hex value of #663399. - - - - - Represents a matching the W3C definition that has an hex value of #FF0000. - - - - - Represents a matching the W3C definition that has an hex value of #BC8F8F. - - - - - Represents a matching the W3C definition that has an hex value of #4169E1. - - - - - Represents a matching the W3C definition that has an hex value of #8B4513. - - - - - Represents a matching the W3C definition that has an hex value of #FA8072. - - - - - Represents a matching the W3C definition that has an hex value of #F4A460. - - - - - Represents a matching the W3C definition that has an hex value of #2E8B57. - - - - - Represents a matching the W3C definition that has an hex value of #FFF5EE. - - - - - Represents a matching the W3C definition that has an hex value of #A0522D. - - - - - Represents a matching the W3C definition that has an hex value of #C0C0C0. - - - - - Represents a matching the W3C definition that has an hex value of #87CEEB. - - - - - Represents a matching the W3C definition that has an hex value of #6A5ACD. - - - - - Represents a matching the W3C definition that has an hex value of #708090. - - - - - Represents a matching the W3C definition that has an hex value of #708090. - - - - - Represents a matching the W3C definition that has an hex value of #FFFAFA. - - - - - Represents a matching the W3C definition that has an hex value of #00FF7F. - - - - - Represents a matching the W3C definition that has an hex value of #4682B4. - - - - - Represents a matching the W3C definition that has an hex value of #D2B48C. - - - - - Represents a matching the W3C definition that has an hex value of #008080. - - - - - Represents a matching the W3C definition that has an hex value of #D8BFD8. - - - - - Represents a matching the W3C definition that has an hex value of #FF6347. - - - - - Represents a matching the W3C definition that has an hex value of #00000000. - - - - - Represents a matching the W3C definition that has an hex value of #40E0D0. - - - - - Represents a matching the W3C definition that has an hex value of #EE82EE. - - - - - Represents a matching the W3C definition that has an hex value of #F5DEB3. - - - - - Represents a matching the W3C definition that has an hex value of #FFFFFF. - - - - - Represents a matching the W3C definition that has an hex value of #F5F5F5. - - - - - Represents a matching the W3C definition that has an hex value of #FFFF00. - - - - - Represents a matching the W3C definition that has an hex value of #9ACD32. - - - - - Gets a collection of named, web safe colors as defined in the CSS Color Module Level 4. - - - - - Gets a collection of colors as defined in the original second edition of Werner’s Nomenclature of Colours 1821. - The hex codes were collected and defined by Nicholas Rougeux . - - - - - Represents a CIE L*a*b* 1976 color. - - - - - - D50 standard illuminant. - Used when reference white is not specified explicitly. - - - - - Gets the lightness dimension. - A value usually ranging between 0 (black), 100 (diffuse white) or higher (specular white). - - - - - Gets the a color component. - A value usually ranging from -100 to 100. Negative is green, positive magenta. - - - - - Gets the b color component. - A value usually ranging from -100 to 100. Negative is blue, positive is yellow - - - - - Gets the reference white point of this color - - - - - Initializes a new instance of the struct. - - The lightness dimension. - The a (green - magenta) component. - The b (blue - yellow) component. - Uses as white point. - - - - Initializes a new instance of the struct. - - The lightness dimension. - The a (green - magenta) component. - The b (blue - yellow) component. - The reference white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, a, b components. - Uses as white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, a, b components. - The reference white point. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Represents the CIE L*C*h°, cylindrical form of the CIE L*a*b* 1976 color. - - - - - - D50 standard illuminant. - Used when reference white is not specified explicitly. - - - - - Gets the lightness dimension. - A value ranging between 0 (black), 100 (diffuse white) or higher (specular white). - - - - - Gets the a chroma component. - A value ranging from 0 to 200. - - - - - Gets the h° hue component in degrees. - A value ranging from 0 to 360. - - - - - Gets the reference white point of this color - - - - - Initializes a new instance of the struct. - - The lightness dimension. - The chroma, relative saturation. - The hue in degrees. - Uses as white point. - - - - Initializes a new instance of the struct. - - The lightness dimension. - The chroma, relative saturation. - The hue in degrees. - The reference white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, c, h components. - Uses as white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, c, h components. - The reference white point. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Computes the saturation of the color (chroma normalized by lightness) - - - A value ranging from 0 to 100. - - The - - - - Represents the CIE L*C*h°, cylindrical form of the CIE L*u*v* 1976 color. - - - - - - D50 standard illuminant. - Used when reference white is not specified explicitly. - - - - - Gets the lightness dimension. - A value ranging between 0 (black), 100 (diffuse white) or higher (specular white). - - - - - Gets the a chroma component. - A value ranging from 0 to 200. - - - - - Gets the h° hue component in degrees. - A value ranging from 0 to 360. - - - - - Gets the reference white point of this color - - - - - Initializes a new instance of the struct. - - The lightness dimension. - The chroma, relative saturation. - The hue in degrees. - Uses as white point. - - - - Initializes a new instance of the struct. - - The lightness dimension. - The chroma, relative saturation. - The hue in degrees. - The reference white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, c, h components. - Uses as white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, c, h components. - The reference white point. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Computes the saturation of the color (chroma normalized by lightness) - - - A value ranging from 0 to 100. - - The - - - - The CIE 1976 (L*, u*, v*) color space, commonly known by its abbreviation CIELUV, is a color space adopted by the International - Commission on Illumination (CIE) in 1976, as a simple-to-compute transformation of the 1931 CIE XYZ color space, but which - attempted perceptual uniformity - - - - - - D65 standard illuminant. - Used when reference white is not specified explicitly. - - - - - Gets the lightness dimension - A value usually ranging between 0 and 100. - - - - - Gets the blue-yellow chromaticity coordinate of the given whitepoint. - A value usually ranging between -100 and 100. - - - - - Gets the red-green chromaticity coordinate of the given whitepoint. - A value usually ranging between -100 and 100. - - - - - Gets the reference white point of this color - - - - - Initializes a new instance of the struct. - - The lightness dimension. - The blue-yellow chromaticity coordinate of the given whitepoint. - The red-green chromaticity coordinate of the given whitepoint. - Uses as white point. - - - - Initializes a new instance of the struct. - - The lightness dimension. - The blue-yellow chromaticity coordinate of the given whitepoint. - The red-green chromaticity coordinate of the given whitepoint. - The reference white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, u, v components. - Uses as white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, u, v components. - The reference white point. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Represents an CIE xyY 1931 color - - - - - - Gets the X chrominance component. - A value usually ranging between 0 and 1. - - - - - Gets the Y chrominance component. - A value usually ranging between 0 and 1. - - - - - Gets the Y luminance component. - A value usually ranging between 0 and 1. - - - - - Initializes a new instance of the struct. - - The x chroma component. - The y chroma component. - The y luminance component. - - - - Initializes a new instance of the struct. - - The vector representing the x, y, Y components. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Represents an CIE XYZ 1931 color - - - - - - Gets the X component. A mix (a linear combination) of cone response curves chosen to be nonnegative. - A value usually ranging between 0 and 1. - - - - - Gets the Y luminance component. - A value usually ranging between 0 and 1. - - - - - Gets the Z component. Quasi-equal to blue stimulation, or the S cone response. - A value usually ranging between 0 and 1. - - - - - Initializes a new instance of the struct. - - X is a mix (a linear combination) of cone response curves chosen to be nonnegative - The y luminance component. - Z is quasi-equal to blue stimulation, or the S cone of the human eye. - - - - Initializes a new instance of the struct. - - The vector representing the x, y, z components. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Returns a new representing this instance. - - The . - - - - - - - - - - - - - - - - Represents an CMYK (cyan, magenta, yellow, keyline) color. - - - - - Gets the cyan color component. - A value ranging between 0 and 1. - - - - - Gets the magenta color component. - A value ranging between 0 and 1. - - - - - Gets the yellow color component. - A value ranging between 0 and 1. - - - - - Gets the keyline black color component. - A value ranging between 0 and 1. - - - - - Initializes a new instance of the struct. - - The cyan component. - The magenta component. - The yellow component. - The keyline black component. - - - - Initializes a new instance of the struct. - - The vector representing the c, m, y, k components. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Implements gamma companding. - - - - - - - - - Expands a companded channel to its linear equivalent with respect to the energy. - - The channel value. - The gamma value. - The representing the linear channel value. - - - - Compresses an uncompanded channel (linear) to its nonlinear equivalent. - - The channel value. - The gamma value. - The representing the nonlinear channel value. - - - - Implements L* companding. - - - For more info see: - - - - - - - Expands a companded channel to its linear equivalent with respect to the energy. - - The channel value. - The representing the linear channel value. - - - - Compresses an uncompanded channel (linear) to its nonlinear equivalent. - - The channel value - The representing the nonlinear channel value. - - - - Implements Rec. 2020 companding function. - - - - - - - - Expands a companded channel to its linear equivalent with respect to the energy. - - The channel value. - The representing the linear channel value. - - - - Compresses an uncompanded channel (linear) to its nonlinear equivalent. - - The channel value. - The representing the nonlinear channel value. - - - - Implements the Rec. 709 companding function. - - - http://en.wikipedia.org/wiki/Rec._709 - - - - - Expands a companded channel to its linear equivalent with respect to the energy. - - The channel value. - The representing the linear channel value. - - - - Compresses an uncompanded channel (linear) to its nonlinear equivalent. - - The channel value. - The representing the nonlinear channel value. - - - - Implements sRGB companding. - - - For more info see: - - - - - - - Expands the companded vectors to their linear equivalents with respect to the energy. - - The span of vectors. - - - - Compresses the uncompanded vectors to their nonlinear equivalents with respect to the energy. - - The span of vectors. - - - - Expands a companded vector to its linear equivalent with respect to the energy. - - The vector. - - - - Compresses an uncompanded vector (linear) to its nonlinear equivalent. - - The vector. - - - - Expands a companded channel to its linear equivalent with respect to the energy. - - The channel value. - The representing the linear channel value. - - - - Compresses an uncompanded channel (linear) to its nonlinear equivalent. - - The channel value. - The representing the nonlinear channel value. - - - - Constants use for Cie conversion calculations - - - - - - 216F / 24389F - - - - - 24389F / 27F - - - - - Performs chromatic adaptation on the various color spaces. - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Provides methods to allow the conversion of color values between different color spaces. - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - Allows conversion to . - - - - - Performs chromatic adaptation of given color. - Target white point is . - - The color to adapt - The source white point. - The adapted color - - - - Performs chromatic adaptation of given color. - Target white point is . - - The color to adapt - The source white point. - The target white point. - The adapted color - - - - Adapts color from the source white point to white point set in . - - The color to adapt - The adapted color - - - - Adapts color from the source white point to white point set in . - - The color to adapt - The adapted color - - - - Adapts color from the source white point to white point set in . - - The color to adapt - The adapted color - - - - Adapts color from the source white point to white point set in . - - The color to adapt - The adapted color - - - - Adapts color from the source white point to white point set in . - - The color to adapt - The adapted color - - - - Adapts a color from the source working space to working space set in . - - The color to adapt - The adapted color - - - - Adapts an color from the source working space to working space set in . - - The color to adapt - The adapted color - - - - The converter for converting between CieLch to CieLab. - - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - The converter for converting between CieLab to CieLch. - - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - The converter for converting between CieLab to CieLchuv. - - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Gets the correct converter for the given rgb working space. - - The source working space - The - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors, - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The configuration options. - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors. - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Converts a into a - - The color to convert. - The - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors. - The span to the destination colors. - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Performs the bulk conversion from into . - - The span to the source colors - The span to the destination colors - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Converts a into a . - - The color to convert. - The - - - - Configuration options for the class. - - - - - Gets or sets the white point used for chromatic adaptation in conversions from/to XYZ color space. - When default, no adaptation will be performed. - Defaults to: . - - - - - Gets or sets the white point used *when creating* Luv/LChuv colors. (Luv/LChuv colors on the input already contain the white point information) - Defaults to: . - - - - - Gets or sets the white point used *when creating* Lab/LChab colors. (Lab/LChab colors on the input already contain the white point information) - Defaults to: . - - - - - Gets or sets the white point used *when creating* HunterLab colors. (HunterLab colors on the input already contain the white point information) - Defaults to: . - - - - - Gets or sets the target working space used *when creating* RGB colors. (RGB colors on the input already contain the working space information) - Defaults to: . - - - - - Gets or sets the chromatic adaptation method used. When null, no adaptation will be performed. - - - - - Gets or sets transformation matrix used in conversion to and from . - - - - - Represents the coordinates of CIEXY chromaticity space. - - - - - Gets the chromaticity X-coordinate. - - - Ranges usually from 0 to 1. - - - - - Gets the chromaticity Y-coordinate - - - Ranges usually from 0 to 1. - - - - - Initializes a new instance of the struct. - - Chromaticity coordinate x (usually from 0 to 1) - Chromaticity coordinate y (usually from 0 to 1) - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Converts from to . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Converts from to . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Converts from to . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Converts from to . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Converts from to . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Converts from to . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Calculates the blue-yellow chromacity based on the given whitepoint. - - The whitepoint - The - - - - Calculates the red-green chromacity based on the given whitepoint. - - The whitepoint - The - - - - Color converter between CIE XYZ and CIE xyY. - for formulas. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - The base class for converting between and color spaces. - - - - - Returns the Ka coefficient that depends upon the whitepoint illuminant. - - The whitepoint - The - - - - Returns the Kb coefficient that depends upon the whitepoint illuminant. - - The whitepoint - The - - - - Color converter between and - - - - - Default transformation matrix used, when no other is set. (Bradford) - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - Definition of the cone response domain (see ), - if not set will be used. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Converts from to . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The target reference lab white point - - - - Gets the target reference whitepoint. When not set, is used. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Converts from to . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The target reference luv white point - - - - Gets the target reference whitepoint. When not set, is used. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Calculates the blue-yellow chromacity based on the given whitepoint. - - The whitepoint - The - - - - Calculates the red-green chromacity based on the given whitepoint. - - The whitepoint - The - - - - Color converter between and - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The hunter Lab white point. - - - - Gets the target reference white. When not set, is used. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Color converter between and - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The target working space. - - - - Gets the target working space. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result. - - - - Color converter between and . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result. - - - - Color converter between HSL and Rgb - See for formulas. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Gets the color component from the given values. - - The first value. - The second value. - The third value. - - The . - - - - - Moves the specific value within the acceptable range for - conversion. - Used for converting colors to this type. - - The value to shift. - - The . - - - - - Color converter between HSV and Rgb - See for formulas. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Color converter between and - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Provides base methods for converting between and color spaces. - - - - - Returns the correct matrix to convert between the Rgb and CieXyz color space. - - The Rgb working space. - The based on the chromaticity and working space. - - - - Color converter between and - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The target working space. - - - - Gets the source working space - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result - - - - Color converter between and . - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result. - - - - Color converter between Rgb and LinearRgb. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result. - - - - Color converter between and - See for formulas. - - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result. - - - - Performs the conversion from the input to an instance of type. - - The input color instance. - The converted result. - - - - Chromatic adaptation. - A linear transformation of a source color (XS, YS, ZS) into a destination color (XD, YD, ZD) by a linear transformation [M] - which is dependent on the source reference white (XWS, YWS, ZWS) and the destination reference white (XWD, YWD, ZWD). - - - - - Performs a linear transformation of a source color in to the destination color. - - Doesn't crop the resulting color space coordinates (e. g. allows negative values for XYZ coordinates). - The source color. - The source white point. - The destination white point. - The - - - - Performs a bulk linear transformation of a source color in to the destination color. - - Doesn't crop the resulting color space coordinates (e. g. allows negative values for XYZ coordinates). - The span to the source colors. - The span to the destination colors. - The source white point. - The destination white point. - - - - Matrices used for transformation from to , defining the cone response domain. - Used in - - - Matrix data obtained from: - Two New von Kries Based Chromatic Adaptation Transforms Found by Numerical Optimization - S. Bianco, R. Schettini - DISCo, Department of Informatics, Systems and Communication, University of Milan-Bicocca, viale Sarca 336, 20126 Milan, Italy - https://web.stanford.edu/~sujason/ColorBalancing/Papers/Two%20New%20von%20Kries%20Based%20Chromatic%20Adaptation.pdf - - - - - Von Kries chromatic adaptation transform matrix (Hunt-Pointer-Estevez adjusted for D65) - - - - - Von Kries chromatic adaptation transform matrix (Hunt-Pointer-Estevez for equal energy) - - - - - XYZ scaling chromatic adaptation transform matrix - - - - - Bradford chromatic adaptation transform matrix (used in CMCCAT97) - - - - - Spectral sharpening and the Bradford transform - - - - - CMCCAT2000 (fitted from all available color data sets) - - - - - CAT02 (optimized for minimizing CIELAB differences) - - - - - Represents the chromaticity coordinates of RGB primaries. - One of the specifiers of . - - - - - Initializes a new instance of the struct. - - The chromaticity coordinates of the red channel. - The chromaticity coordinates of the green channel. - The chromaticity coordinates of the blue channel. - - - - Gets the chromaticity coordinates of the red channel. - - - - - Gets the chromaticity coordinates of the green channel. - - - - - Gets the chromaticity coordinates of the blue channel. - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - Implementation of the von Kries chromatic adaptation model. - - - Transformation described here: - http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - The transformation matrix used for the conversion (definition of the cone response domain). - - - - - - Initializes a new instance of the class. - - The color converter - - - - - - - - - - The gamma working space. - - - - - Initializes a new instance of the class. - - The gamma value. - The reference white point. - The chromaticity of the rgb primaries. - - - - Gets the gamma value. - - - - - - - - - - - - - - - - - L* working space. - - - - - Initializes a new instance of the class. - - The reference white point. - The chromaticity of the rgb primaries. - - - - - - - - - - Rec. 2020 (ITU-R Recommendation BT.2020F) working space. - - - - - Initializes a new instance of the class. - - The reference white point. - The chromaticity of the rgb primaries. - - - - - - - - - - Rec. 709 (ITU-R Recommendation BT.709) working space. - - - - - Initializes a new instance of the class. - - The reference white point. - The chromaticity of the rgb primaries. - - - - - - - - - - Base class for all implementations of . - - - - - Initializes a new instance of the class. - - The reference white point. - The chromaticity of the rgb primaries. - - - - Gets the reference white point - - - - - Gets the chromaticity of the rgb primaries. - - - - - Expands a companded channel to its linear equivalent with respect to the energy. - - - For more info see: - - - The channel value. - The representing the linear channel value. - - - - Compresses an uncompanded channel (linear) to its nonlinear equivalent (depends on the RGB color system). - - - For more info see: - - - The channel value. - The representing the nonlinear channel value. - - - - - - - - - - The sRgb working space. - - - - - Initializes a new instance of the class. - - The reference white point. - The chromaticity of the rgb primaries. - - - - - - - - - - Represents a Hsl (hue, saturation, lightness) color. - - - - - Gets the hue component. - A value ranging between 0 and 360. - - - - - Gets the saturation component. - A value ranging between 0 and 1. - - - - - Gets the lightness component. - A value ranging between 0 and 1. - - - - - Initializes a new instance of the struct. - - The h hue component. - The s saturation component. - The l value (lightness) component. - - - - Initializes a new instance of the struct. - - The vector representing the h, s, l components. - - - - Compares two objects for equality. - - - The on the left side of the operand. - - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Represents a HSV (hue, saturation, value) color. Also known as HSB (hue, saturation, brightness). - - - - - Gets the hue component. - A value ranging between 0 and 360. - - - - - Gets the saturation component. - A value ranging between 0 and 1. - - - - - Gets the value (brightness) component. - A value ranging between 0 and 1. - - - - - Initializes a new instance of the struct. - - The h hue component. - The s saturation component. - The v value (brightness) component. - - - - Initializes a new instance of the struct. - - The vector representing the h, s, v components. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Represents an Hunter LAB color. - . - - - - - D50 standard illuminant. - Used when reference white is not specified explicitly. - - - - - Gets the lightness dimension. - A value usually ranging between 0 (black), 100 (diffuse white) or higher (specular white). - - - - - Gets the a color component. - A value usually ranging from -100 to 100. Negative is green, positive magenta. - - - - - Gets the b color component. - A value usually ranging from -100 to 100. Negative is blue, positive is yellow - - - - - Gets the reference white point of this color. - - - - - Initializes a new instance of the struct. - - The lightness dimension. - The a (green - magenta) component. - The b (blue - yellow) component. - Uses as white point. - - - - Initializes a new instance of the struct. - - The lightness dimension. - The a (green - magenta) component. - The b (blue - yellow) component. - The reference white point. - - - - Initializes a new instance of the struct. - - The vector representing the l, a, b components. - Uses as white point. - - - - Initializes a new instance of the struct. - - The vector representing the l a b components. - The reference white point. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - The well known standard illuminants. - Standard illuminants provide a basis for comparing images or colors recorded under different lighting - - - Coefficients taken from: http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html -
- Descriptions taken from: http://en.wikipedia.org/wiki/Standard_illuminant -
-
- - - Incandescent / Tungsten - - - - - Direct sunlight at noon (obsoleteF) - - - - - Average / North sky Daylight (obsoleteF) - - - - - Horizon Light. ICC profile PCS - - - - - Mid-morning / Mid-afternoon Daylight - - - - - Noon Daylight: TelevisionF, sRGB color space - - - - - North sky Daylight - - - - - Equal energy - - - - - Cool White Fluorescent - - - - - D65 simulatorF, Daylight simulator - - - - - Philips TL84F, Ultralume 40 - - - - - Represents an linear Rgb color with specified working space - - - - - The default LinearRgb working space. - - - - - Gets the red component. - A value usually ranging between 0 and 1. - - - - - Gets the green component. - A value usually ranging between 0 and 1. - - - - - Gets the blue component. - A value usually ranging between 0 and 1. - - - - - Gets the LinearRgb color space - - - - - Initializes a new instance of the struct. - - The red component ranging between 0 and 1. - The green component ranging between 0 and 1. - The blue component ranging between 0 and 1. - - - - Initializes a new instance of the struct. - - The red component ranging between 0 and 1. - The green component ranging between 0 and 1. - The blue component ranging between 0 and 1. - The rgb working space. - - - - Initializes a new instance of the struct. - - The vector representing the r, g, b components. - - - - Initializes a new instance of the struct. - - The vector representing the r, g, b components. - The LinearRgb working space. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Returns a new representing this instance. - - The . - - - - - - - - - - - - - - - - LMS is a color space represented by the response of the three types of cones of the human eye, - named after their responsivity (sensitivity) at long, medium and short wavelengths. - - - - - - Gets the L long component. - A value usually ranging between -1 and 1. - - - - - Gets the M medium component. - A value usually ranging between -1 and 1. - - - - - Gets the S short component. - A value usually ranging between -1 and 1. - - - - - Initializes a new instance of the struct. - - L represents the responsivity at long wavelengths. - M represents the responsivity at medium wavelengths. - S represents the responsivity at short wavelengths. - - - - Initializes a new instance of the struct. - - The vector representing the l, m, s components. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Returns a new representing this instance. - - The . - - - - - - - - - - - - - - - - Represents an RGB color with specified working space. - - - - - The default rgb working space. - - - - - Gets the red component. - A value usually ranging between 0 and 1. - - - - - Gets the green component. - A value usually ranging between 0 and 1. - - - - - Gets the blue component. - A value usually ranging between 0 and 1. - - - - - Gets the Rgb color space - - - - - Initializes a new instance of the struct. - - The red component ranging between 0 and 1. - The green component ranging between 0 and 1. - The blue component ranging between 0 and 1. - - - - Initializes a new instance of the struct. - - The red component ranging between 0 and 1. - The green component ranging between 0 and 1. - The blue component ranging between 0 and 1. - The rgb working space. - - - - Initializes a new instance of the struct. - - The vector representing the r, g, b components. - - - - Initializes a new instance of the struct. - - The vector representing the r, g, b components. - The rgb working space. - - - - Allows the implicit conversion of an instance of to a - . - - The instance of to convert. - An instance of . - - - - Allows the implicit conversion of an instance of to a - . - - The instance of to convert. - An instance of . - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Returns a new representing this instance. - - The . - - - - - - - - - - - - - - - - Chromaticity coordinates based on: - - - - - sRgb working space. - - - Uses proper companding function, according to: - - - - - - Simplified sRgb working space (uses gamma companding instead of ). - See also . - - - - - Rec. 709 (ITU-R Recommendation BT.709) working space. - - - - - Rec. 2020 (ITU-R Recommendation BT.2020F) working space. - - - - - ECI Rgb v2 working space. - - - - - Adobe Rgb (1998) working space. - - - - - Apple sRgb working space. - - - - - Best Rgb working space. - - - - - Beta Rgb working space. - - - - - Bruce Rgb working space. - - - - - CIE Rgb working space. - - - - - ColorMatch Rgb working space. - - - - - Don Rgb 4 working space. - - - - - Ekta Space PS5 working space. - - - - - NTSC Rgb working space. - - - - - PAL/SECAM Rgb working space. - - - - - ProPhoto Rgb working space. - - - - - SMPTE-C Rgb working space. - - - - - Wide Gamut Rgb working space. - - - - - Represents an YCbCr (luminance, blue chroma, red chroma) color as defined in the ITU-T T.871 specification for the JFIF use with Jpeg. - - - - - - - Gets the Y luminance component. - A value ranging between 0 and 255. - - - - - Gets the Cb chroma component. - A value ranging between 0 and 255. - - - - - Gets the Cr chroma component. - A value ranging between 0 and 255. - - - - - Initializes a new instance of the struct. - - The y luminance component. - The cb chroma component. - The cr chroma component. - - - - Initializes a new instance of the struct. - - The vector representing the y, cb, cr components. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - The byte order of the data stream. - - - - - The big-endian byte order (Motorola). - Most-significant byte comes first, and ends with the least-significant byte. - - - - - The little-endian byte order (Intel). - Least-significant byte comes first and ends with the most-significant byte. - - - - - Common constants used throughout the project - - - - - The epsilon value for comparing floating point numbers. - - - - - The epsilon squared value for comparing floating point numbers. - - - - - The exception that is thrown when the library tries to load - an image, which has format or content that is invalid or unsupported by ImageSharp. - - - - - Initializes a new instance of the class with the name of the - parameter that causes this exception. - - The error message that explains the reason for this exception. - - - - Initializes a new instance of the class with a specified - error message and the exception that is the cause of this exception. - - The error message that explains the reason for this exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) - if no inner exception is specified. - - - - The exception that is thrown when an error occurs when applying a process to an image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the name of the - parameter that causes this exception. - - The error message that explains the reason for this exception. - - - - Initializes a new instance of the class with a specified - error message and the exception that is the cause of this exception. - - The error message that explains the reason for this exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) - if no inner exception is specified. - - - - The exception that is thrown when the library tries to load - an image which contains invalid content. - - - - - Initializes a new instance of the class with the name of the - parameter that causes this exception. - - The error message that explains the reason for this exception. - - - - Initializes a new instance of the class with the name of the - parameter that causes this exception. - - The error message that explains the reason for this exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) - if no inner exception is specified. - - - - The exception that is thrown when the library tries to load - an image which has an unknown format. - - - - - Initializes a new instance of the class with the name of the - parameter that causes this exception. - - The error message that explains the reason for this exception. - - - - Contains extension methods for - - - - - Creates a object based on , - having set to - - - - - Extension methods for the type. - - - - - Gets a string from the provided buffer data. - - The encoding. - The buffer. - The string. - - - - Encapsulates a series of time saving extension methods to the interface. - - - - - Generates a sequence of integral numbers within a specified range. - - - The start index, inclusive. - - - A method that has one parameter and returns a calculating the end index. - - - The incremental step. - - - The that contains a range of sequential integral numbers. - - - - - Generates a sequence of integral numbers within a specified range. - - The start index, inclusive. - - A method that has one parameter and returns a calculating the end index. - - The incremental step. - - The that contains a range of sequential integral numbers. - - - - - Extension methods for the type. - - - - - Writes data from a stream from the provided buffer. - - The stream. - The buffer. - The offset within the buffer to begin writing. - The number of bytes to write to the stream. - - - - Reads data from a stream into the provided buffer. - - The stream. - The buffer. - The offset within the buffer where the bytes are read into. - The number of bytes, if available, to read. - The actual number of bytes read. - - - - Skips the number of bytes in the given stream. - - The stream. - A byte offset relative to the origin parameter. - - - - Provides optimized static methods for common mathematical functions specific - to color processing. - - - - - Vector for converting pixel to gray value as specified by - ITU-R Recommendation BT.709. - - - - - Convert a pixel value to grayscale using ITU-R Recommendation BT.709. - - The vector to get the luminance from. - - The number of luminance levels (256 for 8 bit, 65536 for 16 bit grayscale images). - - - - - Gets the luminance from the rgb components using the formula - as specified by ITU-R Recommendation BT.709. - - The red component. - The green component. - The blue component. - The . - - - - Gets the luminance from the rgb components using the formula as - specified by ITU-R Recommendation BT.709. - - The red component. - The green component. - The blue component. - The . - - - - Gets the luminance from the rgb components using the formula as specified - by ITU-R Recommendation BT.709. - - The red component. - The green component. - The blue component. - The . - - - - Scales a value from a 16 bit to an - 8 bit equivalent. - - The 8 bit component value. - The - - - - Scales a value from an 8 bit to - an 16 bit equivalent. - - The 8 bit component value. - The - - - - Returns how many bits are required to store the specified number of colors. - Performs a Log2() on the value. - - The number of colors. - - The - - - - - Returns how many colors will be created by the specified number of bits. - - The bit depth. - The - - - - Transforms a vector by the given color matrix. - - The source vector. - The transformation color matrix. - - - - Bulk variant of . - - The span of vectors - The transformation color matrix. - - - - Common utility methods for working with enums. - - - - - Converts the numeric representation of the enumerated constants to an equivalent enumerated object. - - The type of enum - The value to parse - The default value to return. - The . - - - - Returns a value indicating whether the given enum has a flag of the given value. - - The type of enum. - The value. - The flag. - The . - - - - Parses a hexadecimal string into a byte array without allocations. Throws on non-hexadecimal character. - Adapted from https://source.dot.net/#System.Private.CoreLib/Convert.cs,c9e4fbeaca708991. - - The hexadecimal string to parse. - The destination for the parsed bytes. Must be at least .Length / 2 bytes long. - The number of bytes written to . - - - - Internal utilities intended to be only used in tests. - - - - - This constant is useful to verify the target framework ImageSharp has been built against. - Only intended to be used in tests! - - - - - Contains methods for converting values between unit scales. - - - - - The number of centimeters in a meter. - 1 cm is equal to exactly 0.01 meters. - - - - - The number of centimeters in an inch. - 1 inch is equal to exactly 2.54 centimeters. - - - - - The number of inches in a meter. - 1 inch is equal to exactly 0.0254 meters. - - - - - The default resolution unit value. - - - - - Scales the value from centimeters to meters. - - The value to scale. - The . - - - - Scales the value from meters to centimeters. - - The value to scale. - The . - - - - Scales the value from meters to inches. - - The value to scale. - The . - - - - Scales the value from inches to meters. - - The value to scale. - The . - - - - Scales the value from centimeters to inches. - - The value to scale. - The . - - - - Scales the value from inches to centimeters. - - The value to scale. - The . - - - - Converts an to a . - - The EXIF profile containing the value. - The - - - - Gets the exif profile resolution values. - - The resolution unit. - The horizontal resolution value. - The vertical resolution value. - - - - - Global inlining options. Helps temporarily disable inlining for better profiler output. - - - - - regardless of the build conditions. - - - - - Provides optimized static methods for trigonometric, logarithmic, - and other common mathematical functions. - - - - - Determine the Greatest CommonDivisor (GCD) of two numbers. - - - - - Determine the Least Common Multiple (LCM) of two numbers. - See https://en.wikipedia.org/wiki/Least_common_multiple#Reduction_by_the_greatest_common_divisor. - - - - - Calculates % 2 - - - - - Calculates % 4 - - - - - Calculates % 8 - - - - - Fast (x mod m) calculator, with the restriction that - should be power of 2. - - - - - Returns the absolute value of a 32-bit signed integer. - Uses bit shifting to speed up the operation compared to . - - - A number that is greater than , but less than - or equal to - - The - - - - Returns a specified number raised to the power of 2 - - A single-precision floating-point number - The number raised to the power of 2. - - - - Returns a specified number raised to the power of 3 - - A single-precision floating-point number - The number raised to the power of 3. - - - - Implementation of 1D Gaussian G(x) function - - The x provided to G(x). - The spread of the blur. - The Gaussian G(x) - - - - Returns the result of a normalized sine cardinal function for the given value. - SinC(x) = sin(pi*x)/(pi*x). - - A single-precision floating-point number to calculate the result for. - - The sine cardinal of . - - - - - Returns the value clamped to the inclusive range of min and max. - - The value to clamp. - The minimum inclusive value. - The maximum inclusive value. - The clamped . - - - - Returns the value clamped to the inclusive range of min and max. - - The value to clamp. - The minimum inclusive value. - The maximum inclusive value. - The clamped . - - - - Returns the value clamped to the inclusive range of min and max. - - The value to clamp. - The minimum inclusive value. - The maximum inclusive value. - The clamped . - - - - Returns the value clamped to the inclusive range of min and max. - - The value to clamp. - The minimum inclusive value. - The maximum inclusive value. - The clamped . - - - - Returns the value clamped to the inclusive range of min and max. - - The value to clamp. - The minimum inclusive value. - The maximum inclusive value. - The clamped . - - - - Returns the value clamped to the inclusive range of min and max. - 5x Faster than - on platforms < NET 5. - - The value to clamp. - The minimum inclusive value. - The maximum inclusive value. - The clamped . - - - - Clamps the span values to the inclusive range of min and max. - - The span containing the values to clamp. - The minimum inclusive value. - The maximum inclusive value. - - - - Clamps the span values to the inclusive range of min and max. - - The span containing the values to clamp. - The minimum inclusive value. - The maximum inclusive value. - - - - Clamps the span values to the inclusive range of min and max. - - The span containing the values to clamp. - The minimum inclusive value. - The maximum inclusive value. - - - - Clamps the span values to the inclusive range of min and max. - - The span containing the values to clamp. - The minimum inclusive value. - The maximum inclusive value. - - - - Clamps the span values to the inclusive range of min and max. - - The span containing the values to clamp. - The minimum inclusive value. - The maximum inclusive value. - - - - Pre-multiplies the "x", "y", "z" components of a vector by its "w" component leaving the "w" component intact. - - The to premultiply - - - - Reverses the result of premultiplying a vector via . - - The to premultiply - - - - Bulk variant of - - The span of vectors - - - - Bulk variant of - - The span of vectors - - - - Calculates the cube pow of all the XYZ channels of the input vectors. - - The span of vectors - - - - Calculates the cube root of all the XYZ channels of the input vectors. - - The span of vectors - - - - Performs a linear interpolation between two values based on the given weighting. - - The first value. - The second value. - A value between 0 and 1 that indicates the weight of . - The . - - - - Calculates floored log of the specified value, base 2. - Note that by convention, input value 0 returns 0 since Log(0) is undefined. - - The value. - - - - Calculates floored log of the specified value, base 2. - Note that by convention, input value 0 returns 0 since Log(0) is undefined. - Bit hacking with deBruijn sequence, extremely fast yet does not use any intrinsics so will work on every platform/runtime. - - - Description of this bit hacking can be found here: - https://cstheory.stackexchange.com/questions/19524/using-the-de-bruijn-sequence-to-find-the-lceil-log-2-v-rceil-of-an-integer - - The value. - - - - Fast division with ceiling for numbers. - - Divident value. - Divisor value. - Ceiled division result. - - - - Rotates the specified value left by the specified number of bits. - - The value to rotate. - The number of bits to rotate with. - The rotated value. - - - - Rotates the specified value left by the specified number of bits. - - The value to rotate. - The number of bits to rotate with. - The rotated value. - - - - Rotates the specified value right by the specified number of bits. - - The value to rotate. - The number of bits to rotate with. - The rotated value. - - - - Rotates the specified value right by the specified number of bits. - - The value to rotate. - The number of bits to rotate with. - The rotated value. - - - - Tells whether input value is outside of the given range. - - Value. - Mininum value, inclusive. - Maximum value, inclusive. - - - - Provides information about the .NET runtime installation. - Many methods defer to when available. - - - - - Gets a value indicating whether the .NET installation is .NET Core 3.1 or lower. - - - - - Gets the name of the .NET installation on which an app is running. - - - - - Indicates whether the current application is running on the specified platform. - - - - - Defines the contract for methods that allow the shuffling of pixel components. - Used for shuffling on platforms that do not support Hardware Intrinsics. - - - - - Gets the shuffle control. - - - - - Shuffle 8-bit integers within 128-bit lanes in - using the control and store the results in . - - The source span of bytes. - The destination span of bytes. - - Implementation can assume that source.Length is less or equal than dest.Length. - Loops should iterate using source.Length. - - - - - - - - - - - - - - - - - Various extension and utility methods for and utilizing SIMD capabilities - - - - - Implementation with 256bit / AVX2 intrinsics NOT depending on newer API-s (Vector.Widen etc.) - - - - - SIMD optimized implementation for . - Works only with span Length divisible by 8. - Implementation adapted from: - http://lolengine.net/blog/2011/3/20/understanding-fast-float-integer-conversions - http://stackoverflow.com/a/536278 - - - - - Implementation of which is faster on older runtimes. - - - - - Convert all values normalized into [0..1] from 'source' - into 'dest' buffer of . The values are scaled up into [0-255] and rounded. - This implementation is SIMD optimized and works only when span Length is divisible by 8. - Based on: - - http://lolengine.net/blog/2011/3/20/understanding-fast-float-integer-conversions - - - - - - Gets a value indicating whether code is being JIT-ed to AVX2 instructions - where both float and integer registers are of size 256 byte. - - - - - Gets a value indicating whether code is being JIT-ed to SSE instructions - where float and integer registers are of size 128 byte. - - - - - Transform all scalars in 'v' in a way that converting them to would have rounding semantics. - - The vector - - - - Rounds all values in 'v' to the nearest integer following semantics. - Source: - - https://github.com/g-truc/glm/blob/master/glm/simd/common.h#L110 - - - The vector - - - - Converts all input -s to -s normalized into [0..1]. - should be the of the same size as , - but there are no restrictions on the span's length. - - The source span of bytes - The destination span of floats - - - - Convert all values normalized into [0..1] from 'source' into 'dest' buffer of . - The values are scaled up into [0-255] and rounded, overflows are clamped. - should be the of the same size as , - but there are no restrictions on the span's length. - - The source span of floats - The destination span of bytes - - - - Implementation methods based on newer API-s (Vector.Widen, Vector.Narrow, Vector.ConvertTo*). - Only accelerated only on RyuJIT having dotnet/coreclr#10662 merged (.NET Core 2.1+ .NET 4.7.2+) - See: - https://github.com/dotnet/coreclr/pull/10662 - API Proposal: - https://github.com/dotnet/corefx/issues/15957 - - - - - Widen and convert a vector of values into 2 vectors of -s. - - - - - as many elements as possible, slicing them down (keeping the remainder). - - - - - as many elements as possible, slicing them down (keeping the remainder). - - - - - Implementation , which is faster on new RyuJIT runtime. - - - - - Implementation of , which is faster on new .NET runtime. - - - - - Fallback implementation based on (128bit). - For , efficient software fallback implementations are present, - and we hope that even mono's JIT is able to emit SIMD instructions for that type :P - - - - - as many elements as possible, slicing them down (keeping the remainder). - - - - - as many elements as possible, slicing them down (keeping the remainder). - - - - - Implementation of using . - - - - - Implementation of using . - - - - - Shuffle single-precision (32-bit) floating-point elements in - using the control and store the results in . - - The source span of floats. - The destination span of floats. - The byte control. - - - - Shuffle 8-bit integers within 128-bit lanes in - using the control and store the results in . - - The source span of bytes. - The destination span of bytes. - The type of shuffle to perform. - - - - Shuffle 8-bit integer triplets within 128-bit lanes in - using the control and store the results in . - - The source span of bytes. - The destination span of bytes. - The type of shuffle to perform. - - - - Pads then shuffles 8-bit integers within 128-bit lanes in - using the control and store the results in . - - The source span of bytes. - The destination span of bytes. - The type of shuffle to perform. - - - - Shuffles then slices 8-bit integers within 128-bit lanes in - using the control and store the results in . - - The source span of bytes. - The destination span of bytes. - The type of shuffle to perform. - - - - Implements basic math operations using tolerant comparison - whenever an equality check is needed. - - - - - A read-only default instance for using 1e-8 as epsilon. - It is a field so it can be passed as an 'in' parameter. - Does not necessarily fit all use cases! - - - - - == 0 - - - - - > 0 - - - - - < 0 - - - - - == - - - - - > - - - - - < - - - - - >= - - - - - <= - - - - - Contains 8 element value tuples of various types. - - - - - - - - Extension methods for the type. - - - - - Loads the fields in a target of from one of type. - - The target of instance. - The source of instance. - - - - Loads the fields in a target of from one of type. - - The target of instance. - The source of instance. - - - - Calculates the 32 bit Adler checksum of a given buffer according to - RFC 1950. ZLIB Compressed Data Format Specification version 3.3) - - - - - The default initial seed value of a Adler32 checksum calculation. - - - - - Calculates the Adler32 checksum with the bytes taken from the span. - - The readonly span of bytes. - The . - - - - Calculates the Adler32 checksum with the bytes taken from the span and seed. - - The input Adler32 value. - The readonly span of bytes. - The . - - - - Calculates the 32 bit Cyclic Redundancy Check (CRC) checksum of a given buffer - according to the IEEE 802.3 specification. - - - Contains precalulated tables for scalar calculations. - - - - - The default initial seed value of a Crc32 checksum calculation. - - - - - Calculates the CRC checksum with the bytes taken from the span. - - The readonly span of bytes. - The . - - - - Calculates the CRC checksum with the bytes taken from the span and seed. - - The input CRC value. - The readonly span of bytes. - The . - - - - The table of all possible eight bit values for fast scalar lookup. - - - - - Provides enumeration of available deflate compression levels. - - - - - Level 0. Equivalent to . - - - - - No compression. Equivalent to . - - - - - Level 1. Equivalent to . - - - - - Best speed compression level. - - - - - Level 2. - - - - - Level 3. - - - - - Level 4. - - - - - Level 5. - - - - - Level 6. Equivalent to . - - - - - The default compression level. Equivalent to . - - - - - Level 7. - - - - - Level 8. - - - - - Level 9. Equivalent to . - - - - - Best compression level. Equivalent to . - - - - - This class compresses input with the deflate algorithm described in RFC 1951. - It has several compression levels and three different strategies described below. - - - - - The best and slowest compression level. This tries to find very - long and distant string repetitions. - - - - - The worst but fastest compression level. - - - - - The default compression level. - - - - - This level won't compress at all but output uncompressed blocks. - - - - - The compression method. This is the only method supported so far. - There is no need to use this constant at all. - - - - - Compression level. - - - - - The current state. - - - - - Initializes a new instance of the class. - - The memory allocator to use for buffer allocations. - The compression level, a value between NoCompression and BestCompression. - - if level is out of range. - - - - Compression Level as an enum for safer use - - - - - The best and slowest compression level. This tries to find very - long and distant string repetitions. - - - - - The worst but fastest compression level. - - - - - The default compression level. - - - - - This level won't compress at all but output uncompressed blocks. - - - - - The compression method. This is the only method supported so far. - There is no need to use this constant at all. - - - - - Gets a value indicating whetherthe stream was finished and no more output bytes - are available. - - - - - Gets a value indicating whether the input buffer is empty. - You should then call setInput(). - NOTE: This method can also return true when the stream - was finished. - - - - - Resets the deflater. The deflater acts afterwards as if it was - just created with the same compression level and strategy as it - had before. - - - - - Flushes the current input block. Further calls to Deflate() will - produce enough output to inflate everything in the current input - block. It is used by DeflaterOutputStream to implement Flush(). - - - - - Finishes the deflater with the current input block. It is an error - to give more input after this method was called. This method must - be called to force all bytes to be flushed. - - - - - Sets the data which should be compressed next. This should be - only called when needsInput indicates that more input is needed. - The given byte array should not be changed, before needsInput() returns - true again. - - The buffer containing the input data. - The start of the data. - The number of data bytes of input. - - if the buffer was finished or if previous input is still pending. - - - - - Sets the compression level. There is no guarantee of the exact - position of the change, but if you call this when needsInput is - true the change of compression level will occur somewhere near - before the end of the so far given input. - - - the new compression level. - - - - - Deflates the current input block to the given array. - - Buffer to store the compressed data. - Offset into the output array. - The maximum number of bytes that may be stored. - - The number of compressed bytes added to the output, or 0 if either - or returns true or length is zero. - - - - - - - - This class contains constants used for deflation. - - - - - Set to true to enable debugging - - - - - Written to Zip file to identify a stored block - - - - - Identifies static tree in Zip file - - - - - Identifies dynamic tree in Zip file - - - - - Header flag indicating a preset dictionary for deflation - - - - - Sets internal buffer sizes for Huffman encoding - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Internal compression engine constant - - - - - Strategies for deflater - - - - - The default strategy - - - - - This strategy will only allow longer string repetitions. It is - useful for random data with a small character set. - - - - - This strategy will not look for string repetitions at all. It - only encodes with Huffman trees (which means, that more common - characters get a smaller encoding. - - - - - Low level compression engine for deflate algorithm which uses a 32K sliding window - with secondary compression from Huffman/Shannon-Fano codes. - - - - - Points to the current character in the window. - - - - - lookahead is the number of characters starting at strstart in - window that are valid. - So window[strstart] until window[strstart+lookahead-1] are valid - characters. - - - - - The current compression function. - - - - - The input data for compression. - - - - - The offset into inputBuf, where input data starts. - - - - - The end offset of the input data. - - - - - Hashtable, hashing three characters to an index for window, so - that window[index]..window[index+2] have this hash code. - Note that the array should really be unsigned short, so you need - to and the values with 0xFFFF. - - - - - prev[index & WMASK] points to the previous index that has the - same hash code as the string starting at index. This way - entries with the same hash code are in a linked list. - Note that the array should really be unsigned short, so you need - to and the values with 0xFFFF. - - - - - This array contains the part of the uncompressed stream that - is of relevance. The current character is indexed by strstart. - - - - - Initializes a new instance of the class. - - The memory allocator to use for buffer allocations. - The deflate strategy to use. - - - - Gets the pending buffer to use. - - - - - Deflate drives actual compression of data - - True to flush input buffers - Finish deflation with the current input. - Returns true if progress has been made. - - - - Sets input data to be deflated. Should only be called when - returns true - - The buffer containing input data. - The offset of the first byte of data. - The number of bytes of data to use as input. - - - - Determines if more input is needed. - - Return true if input is needed via SetInput - - - - Reset internal state - - - - - Set the deflate level (0-9) - - The value to set the level to. - - - - Fill the window - - - - - - - - Inserts the current string in the head hash and returns the previous - value for this hash. - - The previous hash value - - - - - Find the best (longest) string in the window matching the - string starting at strstart. - - - Preconditions: - - strstart + DeflaterConstants.MAX_MATCH <= window.length. - - - The current match. - True if a match greater than the minimum length is found - - - - Performs Deflate Huffman encoding. - - - - - Initializes a new instance of the class. - - The memory allocator to use for buffer allocations. - - - - Gets the lengths of the bit length codes are sent in order of decreasing probability, to avoid transmitting the lengths for unused bit length codes. - - - - - Gets the pending buffer to use. - - - - - Reset internal state - - - - - Write all trees to pending buffer - - The number/rank of treecodes to send. - - - - Compress current buffer writing data to pending buffer - - - - - Flush block to output with no compression - - Data to write - Index of first byte to write - Count of bytes to write - True if this is the last block - - - - Flush block to output with compression - - Data to flush - Index of first byte to flush - Count of bytes to flush - True if this is the last block - - - - Get value indicating if internal buffer is full - - true if buffer is full - - - - Add literal to buffer - - Literal value to add to buffer. - Value indicating internal buffer is full - - - - Add distance code and length to literal and distance trees - - Distance code - Length - Value indicating if internal buffer is full - - - - Reverse the bits of a 16 bit value. - - Value to reverse bits - Value with bits reversed - - - - - - - Resets the internal state of the tree - - - - - Set static codes and length - - new codes - length for new codes - - - - Build dynamic codes and lengths - - - - - Get encoded length - - Encoded length, the sum of frequencies * lengths - - - - Scan a literal or distance tree to determine the frequencies of the codes - in the bit length tree. - - - - - Write the tree values. - - The pending buffer. - The tree to write. - - - - A special stream deflating or compressing the bytes that are - written to it. It uses a Deflater to perform actual deflating. - - - - - Initializes a new instance of the class. - - The memory allocator to use for buffer allocations. - The output stream where deflated output is written. - The compression level. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Stores pending data for writing data to the Deflater. - - - - - Initializes a new instance of the class. - - The memory allocator to use for buffer allocations. - - - - Gets the number of bits written to the buffer. - - - - - Gets a value indicating whether indicates the buffer has been flushed. - - - - - Clear internal state/buffers. - - - - - Write a short value to buffer LSB first. - - The value to write. - - - - Write a block of data to the internal buffer. - - The data to write. - The offset of first byte to write. - The number of bytes to write. - - - - Aligns internal buffer on a byte boundary. - - - - - Write bits to internal buffer - - source of bits - number of bits to write - - - - Write a short value to internal buffer most significant byte first - - The value to write - - - - Flushes the pending buffer into the given output array. - If the output array is to small, only a partial flush is done. - - The output array. - The offset into output array. - The maximum number of bytes to store. - The number of bytes flushed. - - - - - - - Provides methods and properties for compressing streams by using the Zlib Deflate algorithm. - - - - - The raw stream containing the uncompressed image data. - - - - - Computes the checksum for the data stream. - - - - - A value indicating whether this instance of the given entity has been disposed. - - if this instance has been disposed; otherwise, . - - If the entity is disposed, it must not be disposed a second - time. The isDisposed field is set the first time the entity - is disposed. If the isDisposed field is true, then the Dispose() - method will not dispose again. This help not to prolong the entity's - life in the Garbage Collector. - - - - - The stream responsible for compressing the input stream. - - - - - Initializes a new instance of the class. - - The memory allocator to use for buffer allocations. - The stream to compress. - The compression level. - - - - Initializes a new instance of the class. - - The memory allocator to use for buffer allocations. - The stream to compress. - The compression level. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides methods and properties for deframing streams from PNGs. - - - - - Used to read the Adler-32 and Crc-32 checksums. - We don't actually use this for anything so it doesn't - have to be threadsafe. - - - - - A default delegate to get more data from the inner stream. - - - - - The inner raw memory stream. - - - - - A value indicating whether this instance of the given entity has been disposed. - - if this instance has been disposed; otherwise, . - - If the entity is disposed, it must not be disposed a second - time. The isDisposed field is set the first time the entity - is disposed. If the isDisposed field is true, then the Dispose() - method will not dispose again. This help not to prolong the entity's - life in the Garbage Collector. - - - - - The current data remaining to be read. - - - - - Delegate to get more data once we've exhausted the current data remaining. - - - - - Initializes a new instance of the class. - - The inner raw stream. - - - - Initializes a new instance of the class. - - The inner raw stream. - A delegate to get more data from the inner stream. - - - - - - - - - - - - - - - - - - - Gets the compressed stream over the deframed inner stream. - - - - - Adds new bytes from a frame found in the original stream. - - The current remaining data according to the chunk length. - Whether the chunk to be inflated is a critical chunk. - The . - - - - - - - - - - - - - - - - - - - - - - - - - Provides configuration which allows altering default behaviour or extending the library. - - - - - A lazily initialized configuration default instance. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - A collection of configuration modules to register. - - - - Gets the default instance. - - - - - Gets or sets the maximum number of concurrent tasks enabled in ImageSharp algorithms - configured with this instance. - Initialized with by default. - - - - - Gets or sets the size of the buffer to use when working with streams. - Initialized with by default. - - - - - Gets or sets a value indicating whether to force image buffers to be contiguous whenever possible. - - - Contiguous allocations are not possible, if the image needs a buffer larger than . - - - - - Gets a set of properties for the Configuration. - - This can be used for storing global settings and defaults to be accessible to processors. - - - - Gets the currently registered s. - - - - - Gets or sets the position in a stream to use for reading when using a seekable stream as an image data source. - - - - - Gets or the that is currently in use. - - - - - Gets or sets the that is currently in use. - Defaults to . - - Allocators are expensive, so it is strongly recommended to use only one busy instance per process. - In case you need to customize it, you can ensure this by changing - - - It's possible to reduce allocator footprint by assigning a custom instance created with - , but note that since the default pooling - allocators are expensive, it is strictly recommended to use a single process-wide allocator. - You can ensure this by altering the allocator of , or by implementing custom application logic that - manages allocator lifetime. - - If an allocator has to be dropped for some reason, - shall be invoked after disposing all associated instances. - - - - - Gets the maximum header size of all the formats. - - - - - Gets or sets the filesystem helper for accessing the local file system. - - - - - Gets or sets the working buffer size hint for image processors. - The default value is 1MB. - - - Currently only used by Resize. If the working buffer is expected to be discontiguous, - min(WorkingBufferSizeHintInBytes, BufferCapacityInBytes) should be used. - - - - - Gets or sets the image operations provider factory. - - - - - Registers a new format provider. - - The configuration provider to call configure on. - - - - Creates a shallow copy of the . - - A new configuration instance. - - - - Creates the default instance with the following s preregistered: - - - - . - . - . - . - . - - The default configuration of . - - - - Represents the method to handle . - - - - - Utilities to track memory usage and detect memory leaks from not disposing ImageSharp objects. - - - - - Fires when an ImageSharp object's undisposed memory resource leaks to the finalizer. - The event brings significant overhead, and is intended to be used for troubleshooting only. - For production diagnostics, use . - - - - - Gets a value indicating the total number of memory resource objects leaked to the finalizer. - - - - - Gets the Bitmap identifier. - The field used to identify the bitmap file: 0x42 0x41 (Hex code points for B and A). - - - - - Gets the size of this header. - - - - - Gets the offset to next OS2BMPARRAYFILEHEADER. - This offset is calculated from the starting byte of the file. A value of zero indicates that this header is for the last image in the array list. - - - - - Gets the width of the image display in pixels. - - - - - Gets the height of the image display in pixels. - - - - - Enumerates the available bits per pixel the bitmap encoder supports. - - - - - 1 bit per pixel. - - - - - 4 bits per pixel. - - - - - 8 bits per pixel. Each pixel consists of 1 byte. - - - - - 16 bits per pixel. Each pixel consists of 2 bytes. - - - - - 24 bits per pixel. Each pixel consists of 3 bytes. - - - - - 32 bits per pixel. Each pixel consists of 4 bytes. - - - - - Defines the compression type of the image data - in the bitmap file. - - - - - Each image row has a multiple of four elements. If the - row has less elements, zeros will be added at the right side. - The format depends on the number of bits, stored in the info header. - If the number of bits are one, four or eight each pixel data is - a index to the palette. If the number of bits are sixteen, - twenty-four or thirty-two each pixel contains a color. - - - - - Two bytes are one data record. If the first byte is not zero, the - next byte will be repeated as much as the value of the first byte. - If the first byte is zero, the record has different meanings, depending - on the second byte. If the second byte is zero, it is the end of the row, - if it is one, it is the end of the image. - - - - - Two bytes are one data record. If the first byte is not zero, the - next two half bytes will be repeated as much as the value of the first byte. - If the first byte is zero, the record has different meanings, depending - on the second byte. If the second byte is zero, it is the end of the row, - if it is one, it is the end of the image. - - - - - Each image row has a multiple of four elements. If the - row has less elements, zeros will be added at the right side. - - - - - The bitmap contains a JPG image. - Not supported at the moment. - - - - - The bitmap contains a PNG image. - Not supported at the moment. - - - - - Introduced with Windows CE. - Specifies that the bitmap is not compressed and that the color table consists of four DWORD color - masks that specify the red, green, blue, and alpha components of each pixel. - - - - - OS/2 specific compression type. - Similar to run length encoding of 4 and 8 bit. - The only difference is that run values encoded are three bytes in size (one byte per RGB color component), - rather than four or eight bits in size. - - Note: Because compression value of 4 is ambiguous for BI_RGB for windows and RLE24 for OS/2, the enum value is remapped - to a different value, to be clearly separate from valid windows values. - - - - - Registers the image encoders, decoders and mime type detectors for the bmp format. - - - - - - - - Defines constants relating to BMPs - - - - - The list of mimetypes that equate to a bmp. - - - - - The list of file extensions that equate to a bmp. - - - - - Valid magic bytes markers identifying a Bitmap file. - - - - - Single-image BMP file that may have been created under Windows or OS/2. - - - - - OS/2 Bitmap Array. - - - - - OS/2 Color Icon. - - - - - OS/2 Color Pointer. - - - - - OS/2 Icon. - - - - - OS/2 Pointer. - - - - - Image decoder for generating an image out of a Windows bitmap stream. - - - Does not support the following formats at the moment: - - JPG - PNG - Some OS/2 specific subtypes like: Bitmap Array, Color Icon, Color Pointer, Icon, Pointer. - - Formats will be supported in a later releases. We advise always - to use only 24 Bit Windows bitmaps. - - - - - Gets or sets a value indicating how to deal with skipped pixels, which can occur during decoding run length encoded bitmaps. - - - - - - - - - - - - - - Performs the bitmap decoding operation. - - - A useful decoding source example can be found at - - - - - The default mask for the red part of the color for 16 bit rgb bitmaps. - - - - - The default mask for the green part of the color for 16 bit rgb bitmaps. - - - - - The default mask for the blue part of the color for 16 bit rgb bitmaps. - - - - - RLE flag value that indicates following byte has special meaning. - - - - - RLE flag value marking end of a scan line. - - - - - RLE flag value marking end of bitmap data. - - - - - RLE flag value marking the start of [x,y] offset instruction. - - - - - The stream to decode from. - - - - - The metadata. - - - - - The bitmap specific metadata. - - - - - The file header containing general information. - - - - - Indicates which bitmap file marker was read. - - - - - The info header containing detailed information about the bitmap. - - - - - Used for allocating memory during processing operations. - - - - - The bitmap decoder options. - - - - - Initializes a new instance of the class. - - The configuration. - The options. - - - - - - - Gets the dimensions of the image. - - - - - - - - - - - Returns the y- value based on the given height. - - The y- value representing the current row. - The height of the bitmap. - Whether the bitmap is inverted. - The representing the inverted value. - - - - Calculates the amount of bytes to pad a row. - - The image width. - The pixel component count. - - The padding. - - - - - Decodes a bitmap containing the BITFIELDS Compression type. For each color channel, there will be a bitmask - which will be used to determine which bits belong to that channel. - - The pixel format. - The output pixel buffer containing the decoded image. - Whether the bitmap is inverted. - - - - Looks up color values and builds the image from de-compressed RLE8 or RLE4 data. - Compressed RLE8 stream is uncompressed by - Compressed RLE4 stream is uncompressed by - - The pixel format. - The compression type. Either RLE4 or RLE8. - The to assign the palette to. - The containing the colors. - The width of the bitmap. - The height of the bitmap. - Whether the bitmap is inverted. - - - - Looks up color values and builds the image from de-compressed RLE24. - - The pixel format. - The to assign the palette to. - The width of the bitmap. - The height of the bitmap. - Whether the bitmap is inverted. - - - - Produce uncompressed bitmap data from a RLE4 stream. - - - RLE4 is a 2-byte run-length encoding. -
If first byte is 0, the second byte may have special meaning. -
Otherwise, the first byte is the length of the run and second byte contains two color indexes. -
- The width of the bitmap. - Buffer for uncompressed data. - Keeps track over skipped and therefore undefined pixels. - Keeps track of rows, which have undefined pixels. -
- - - Produce uncompressed bitmap data from a RLE8 stream. - - - RLE8 is a 2-byte run-length encoding. -
If first byte is 0, the second byte may have special meaning. -
Otherwise, the first byte is the length of the run and second byte is the color for the run. -
- The width of the bitmap. - Buffer for uncompressed data. - Keeps track of skipped and therefore undefined pixels. - Keeps track of rows, which have undefined pixels. -
- - - Produce uncompressed bitmap data from a RLE24 stream. - - -
If first byte is 0, the second byte may have special meaning. -
Otherwise, the first byte is the length of the run and following three bytes are the color for the run. -
- The width of the bitmap. - Buffer for uncompressed data. - Keeps track of skipped and therefore undefined pixels. - Keeps track of rows, which have undefined pixels. -
- - - Keeps track of skipped / undefined pixels, when the EndOfBitmap command occurs. - - The already processed pixel count. - The width of the image. - The skipped pixel count. - The undefined pixels. - Rows with undefined pixels. - - - - Keeps track of undefined / skipped pixels, when the EndOfLine command occurs. - - The already uncompressed pixel count. - The width of image. - The undefined pixels. - The rows with undefined pixels. - The number of skipped pixels. - - - - Keeps track of undefined / skipped pixels, when the delta command occurs. - - The count. - The width of the image. - Delta skip in x direction. - Delta skip in y direction. - The undefined pixels. - The rows with undefined pixels. - The number of skipped pixels. - - - - Reads the color palette from the stream. - - The pixel format. - The to assign the palette to. - The containing the colors. - The width of the bitmap. - The height of the bitmap. - The number of bits per pixel. - Usually 4 bytes, but in case of Windows 2.x bitmaps or OS/2 1.x bitmaps - the bytes per color palette entry's can be 3 bytes instead of 4. - Whether the bitmap is inverted. - - - - Reads the 16 bit color palette from the stream. - - The pixel format. - The to assign the palette to. - The width of the bitmap. - The height of the bitmap. - Whether the bitmap is inverted. - The bitmask for the red channel. - The bitmask for the green channel. - The bitmask for the blue channel. - - - - Performs final shifting from a 5bit value to an 8bit one. - - The masked and shifted value. - The - - - - Performs final shifting from a 6bit value to an 8bit one. - - The masked and shifted value. - The - - - - Reads the 24 bit color palette from the stream. - - The pixel format. - The to assign the palette to. - The width of the bitmap. - The height of the bitmap. - Whether the bitmap is inverted. - - - - Reads the 32 bit color palette from the stream. - - The pixel format. - The to assign the palette to. - The width of the bitmap. - The height of the bitmap. - Whether the bitmap is inverted. - - - - Reads the 32 bit color palette from the stream, checking the alpha component of each pixel. - This is a special case only used for 32bpp WinBMPv3 files, which could be in either BGR0 or BGRA format. - - The pixel format. - The to assign the palette to. - The width of the bitmap. - The height of the bitmap. - Whether the bitmap is inverted. - - - - Decode an 32 Bit Bitmap containing a bitmask for each color channel. - - The pixel format. - The output pixel buffer containing the decoded image. - The width of the image. - The height of the image. - Whether the bitmap is inverted. - The bitmask for the red channel. - The bitmask for the green channel. - The bitmask for the blue channel. - The bitmask for the alpha channel. - - - - Calculates the necessary right shifts for a given color bitmask (the 0 bits to the right). - - The color bit mask. - Number of bits to shift right. - - - - Counts none zero bits. - - A color mask. - The none zero bits. - - - - Reads the from the stream. - - - - - Reads the from the stream. - - - - - Reads the and from the stream and sets the corresponding fields. - - Bytes per color palette entry. Usually 4 bytes, but in case of Windows 2.x bitmaps or OS/2 1.x bitmaps - the bytes per color palette entry's can be 3 bytes instead of 4. - - - - Image encoder for writing an image to a stream as a Windows bitmap. - - - - - Gets or sets the number of bits per pixel. - - - - - Gets or sets a value indicating whether the encoder should support transparency. - Note: Transparency support only works together with 32 bits per pixel. This option will - change the default behavior of the encoder of writing a bitmap version 3 info header with no compression. - Instead a bitmap version 4 info header will be written with the BITFIELDS compression. - - - - - Gets or sets the quantizer for reducing the color count for 8-Bit images. - Defaults to Wu Quantizer. - - - - - - - - - - - Image encoder for writing an image to a stream as a Windows bitmap. - - - - - The amount to pad each row by. - - - - - The mask for the alpha channel of the color for 32 bit rgba bitmaps. - - - - - The mask for the red part of the color for 32 bit rgba bitmaps. - - - - - The mask for the green part of the color for 32 bit rgba bitmaps. - - - - - The mask for the blue part of the color for 32 bit rgba bitmaps. - - - - - The color palette for an 8 bit image will have 256 entry's with 4 bytes for each entry. - - - - - The color palette for an 4 bit image will have 16 entry's with 4 bytes for each entry. - - - - - The color palette for an 1 bit image will have 2 entry's with 4 bytes for each entry. - - - - - Used for allocating memory during processing operations. - - - - - The global configuration. - - - - - The color depth, in number of bits per pixel. - - - - - A bitmap v4 header will only be written, if the user explicitly wants support for transparency. - In this case the compression type BITFIELDS will be used. - Otherwise a bitmap v3 header will be written, which is supported by almost all decoders. - - - - - The quantizer for reducing the color count for 8-Bit, 4-Bit and 1-Bit images. - - - - - Initializes a new instance of the class. - - The encoder options. - The memory manager. - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to request cancellation. - - - - Writes the pixel data to the binary stream. - - The pixel format. - The to write to. - - The containing pixel data. - - - - - Writes the 32bit color palette to the stream. - - The pixel format. - The to write to. - The containing pixel data. - - - - Writes the 24bit color palette to the stream. - - The pixel format. - The to write to. - The containing pixel data. - - - - Writes the 16bit color palette to the stream. - - The type of the pixel. - The to write to. - The containing pixel data. - - - - Writes an 8 bit image with a color palette. The color palette has 256 entry's with 4 bytes for each entry. - - The type of the pixel. - The to write to. - The containing pixel data. - - - - Writes an 8 bit color image with a color palette. The color palette has 256 entry's with 4 bytes for each entry. - - The type of the pixel. - The to write to. - The containing pixel data. - A byte span of size 1024 for the color palette. - - - - Writes an 8 bit gray image with a color palette. The color palette has 256 entry's with 4 bytes for each entry. - - The type of the pixel. - The to write to. - The containing pixel data. - A byte span of size 1024 for the color palette. - - - - Writes an 4 bit color image with a color palette. The color palette has 16 entry's with 4 bytes for each entry. - - The type of the pixel. - The to write to. - The containing pixel data. - - - - Writes a 1 bit image with a color palette. The color palette has 2 entry's with 4 bytes for each entry. - - The type of the pixel. - The to write to. - The containing pixel data. - - - - Writes the color palette to the stream. The color palette has 4 bytes for each entry. - - The type of the pixel. - The to write to. - The color palette from the quantized image. - A temporary byte span to write the color palette to. - - - - Writes a 1-bit palette. - - The stream to write the palette to. - The start index. - The end index. - A quantized pixel row. - - - - Stores general information about the Bitmap file. - - - - The first two bytes of the Bitmap file format - (thus the Bitmap header) are stored in big-endian order. - All of the other integer values are stored in little-endian format - (i.e. least-significant byte first). - - - - - Defines the size of the data structure in the bitmap file. - - - - - Gets the Bitmap identifier. - The field used to identify the bitmap file: 0x42 0x4D - (Hex code points for B and M) - - - - - Gets the size of the bitmap file in bytes. - - - - - Gets any reserved data; actual value depends on the application - that creates the image. - - - - - Gets the offset, i.e. starting address, of the byte where - the bitmap data can be found. - - - - - Indicates which bitmap file marker was read. - - - - - Single-image BMP file that may have been created under Windows or OS/2. - - - - - OS/2 Bitmap Array. - - - - - OS/2 Color Icon. - - - - - OS/2 Color Pointer. - - - - - OS/2 Icon. - - - - - OS/2 Pointer. - - - - - Registers the image encoders, decoders and mime type detectors for the bmp format. - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - Detects bmp file headers. - - - - - - - - - - - This block of bytes tells the application detailed information - about the image, which will be used to display the image on - the screen. - - - - - - Defines the size of the BITMAPCOREHEADER data structure in the bitmap file. - - - - - Defines the size of the short variant of the OS22XBITMAPHEADER data structure in the bitmap file. - - - - - Defines the size of the BITMAPINFOHEADER (BMP Version 3) data structure in the bitmap file. - - - - - Special case of the BITMAPINFOHEADER V3 used by adobe where the color bitmasks are part of the info header instead of following it. - - - - - Special case of the BITMAPINFOHEADER V3 used by adobe where the color bitmasks (including the alpha channel) are part of the info header instead of following it. - - - - - Size of a IBM OS/2 2.x bitmap header. - - - - - Defines the size of the BITMAPINFOHEADER (BMP Version 4) data structure in the bitmap file. - - - - - Defines the size of the BITMAPINFOHEADER (BMP Version 5) data structure in the bitmap file. - - - - - Defines the size of the biggest supported header data structure in the bitmap file. - - - - - Defines the size of the field. - - - - - Gets or sets the size of this header. - - - - - Gets or sets the bitmap width in pixels (signed integer). - - - - - Gets or sets the bitmap height in pixels (signed integer). - - - - - Gets or sets the number of color planes being used. Must be set to 1. - - - - - Gets or sets the number of bits per pixel, which is the color depth of the image. - Typical values are 1, 4, 8, 16, 24 and 32. - - - - - Gets or sets the compression method being used. - See the next table for a list of possible values. - - - - - Gets or sets the image size. This is the size of the raw bitmap data (see below), - and should not be confused with the file size. - - - - - Gets or sets the horizontal resolution of the image. - (pixel per meter, signed integer) - - - - - Gets or sets the vertical resolution of the image. - (pixel per meter, signed integer) - - - - - Gets or sets the number of colors in the color palette, - or 0 to default to 2^n. - - - - - Gets or sets the number of important colors used, - or 0 when every color is important{ get; set; } generally ignored. - - - - - Gets or sets red color mask. This is used with the BITFIELDS decoding. - - - - - Gets or sets green color mask. This is used with the BITFIELDS decoding. - - - - - Gets or sets blue color mask. This is used with the BITFIELDS decoding. - - - - - Gets or sets alpha color mask. This is not used yet. - - - - - Gets or sets the Color space type. Not used yet. - - - - - Gets or sets the X coordinate of red endpoint. Not used yet. - - - - - Gets or sets the Y coordinate of red endpoint. Not used yet. - - - - - Gets or sets the Z coordinate of red endpoint. Not used yet. - - - - - Gets or sets the X coordinate of green endpoint. Not used yet. - - - - - Gets or sets the Y coordinate of green endpoint. Not used yet. - - - - - Gets or sets the Z coordinate of green endpoint. Not used yet. - - - - - Gets or sets the X coordinate of blue endpoint. Not used yet. - - - - - Gets or sets the Y coordinate of blue endpoint. Not used yet. - - - - - Gets or sets the Z coordinate of blue endpoint. Not used yet. - - - - - Gets or sets the Gamma red coordinate scale value. Not used yet. - - - - - Gets or sets the Gamma green coordinate scale value. Not used yet. - - - - - Gets or sets the Gamma blue coordinate scale value. Not used yet. - - - - - Parses the BITMAPCOREHEADER (BMP Version 2) consisting of the headerSize, width, height, planes, and bitsPerPixel fields (12 bytes). - - The data to parse. - The parsed header. - - - - - Parses a short variant of the OS22XBITMAPHEADER. It is identical to the BITMAPCOREHEADER, except that the width and height - are 4 bytes instead of 2, resulting in 16 bytes total. - - The data to parse. - The parsed header. - - - - - Parses the full BMP Version 3 BITMAPINFOHEADER header (40 bytes). - - The data to parse. - The parsed header. - - - - - Special case of the BITMAPINFOHEADER V3 used by adobe where the color bitmasks are part of the info header instead of following it. - 52 bytes without the alpha mask, 56 bytes with the alpha mask. - - The data to parse. - Indicates, if the alpha bitmask is present. - The parsed header. - - - - - Parses a OS/2 version 2 bitmap header (64 bytes). Only the first 40 bytes are parsed which are - very similar to the Bitmap v3 header. The other 24 bytes are ignored, but they do not hold any - useful information for decoding the image. - - The data to parse. - The parsed header. - - - - - Parses the full BMP Version 4 BITMAPINFOHEADER header (108 bytes). - - The data to parse. - The parsed header. - - - - - Writes a bitmap version 3 (Microsoft Windows NT) header to a buffer (40 bytes). - - The buffer to write to. - - - - Writes a complete Bitmap V4 header to a buffer. - - The buffer to write to. - - - - Enum value for the different bitmap info header types. The enum value is the number of bytes for the specific bitmap header. - - - - - Bitmap Core or BMP Version 2 header (Microsoft Windows 2.x). - - - - - Short variant of the OS/2 Version 2 bitmap header. - - - - - BMP Version 3 header (Microsoft Windows 3.x or Microsoft Windows NT). - - - - - Adobe variant of the BMP Version 3 header. - - - - - Adobe variant of the BMP Version 3 header with an alpha mask. - - - - - BMP Version 2.x header (IBM OS/2 2.x). - - - - - BMP Version 4 header (Microsoft Windows 95). - - - - - BMP Version 5 header (Windows NT 5.0, 98 or later). - - - - - Provides Bmp specific metadata information for the image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the bitmap info header type. - - - - - Gets or sets the number of bits per pixel. - - - - - - - - Cold path optimization for throwing 's - - The error message for the exception. - - - - Cold path optimization for throwing 's - - The error message for the exception. - - - - Image decoder options for decoding Windows bitmap streams. - - - - - Gets the value indicating how to deal with skipped pixels, which can occur during decoding run length encoded bitmaps. - - - - - Configuration options for use during bmp encoding. - - - - - Gets the number of bits per pixel. - - - - - Gets a value indicating whether the encoder should support transparency. - Note: Transparency support only works together with 32 bits per pixel. This option will - change the default behavior of the encoder of writing a bitmap version 3 info header with no compression. - Instead a bitmap version 4 info header will be written with the BITFIELDS compression. - - - - - Gets the quantizer for reducing the color count for 8-Bit, 4-Bit, and 1-Bit images. - - - - - Defines possible options, how skipped pixels during decoding of run length encoded bitmaps should be treated. - - - - - Undefined pixels should be black. This is the default behavior and equal to how System.Drawing handles undefined pixels. - - - - - Undefined pixels should be transparent. - - - - - Undefined pixels should have the first color of the palette. - - - - - Provides enumeration for the available color table modes. - - - - - A single color table is calculated from the first frame and reused for subsequent frames. - - - - - A unique color table is calculated for each frame. - - - - - Registers the image encoders, decoders and mime type detectors for the gif format. - - - - - - - - Constants that define specific points within a Gif. - - - - - The file type. - - - - - The file version. - - - - - The extension block introducer !. - - - - - The graphic control label. - - - - - The application extension label. - - - - - The application block size. - - - - - The application identification. - - - - - The Netscape looping application sub block size. - - - - - The comment label. - - - - - The maximum length of a comment data sub-block is 255. - - - - - The image descriptor label ,. - - - - - The plain text label. - - - - - The image label introducer ,. - - - - - The terminator. - - - - - The end introducer trailer ;. - - - - - The character encoding to use when reading and writing comments - (ASCII 7bit). - - - - - The collection of mimetypes that equate to a Gif. - - - - - The collection of file extensions that equate to a Gif. - - - - - Gets the ASCII encoded bytes used to identify the GIF file (combining and ). - - - - - Gets the ASCII encoded application identification bytes (representing ). - - - - - Gets the ASCII encoded application identification bytes. - - - - - Decoder for generating an image out of a gif encoded stream. - - - - - Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets or sets the decoding mode for multi-frame images - - - - - - - - - - - - - - Performs the gif decoding operation. - - - - - The temp buffer used to reduce allocations. - - - - - The currently loaded stream. - - - - - The global color table. - - - - - The area to restore. - - - - - The logical screen descriptor. - - - - - The graphics control extension. - - - - - The image descriptor. - - - - - The abstract metadata. - - - - - The gif specific metadata. - - - - - Initializes a new instance of the class. - - The configuration. - The decoder options. - - - - - - - Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets the decoding mode for multi-frame images. - - - - - Gets the dimensions of the image. - - - - - - - - - - - Reads the graphic control extension. - - - - - Reads the image descriptor. - - - - - Reads the logical screen descriptor. - - - - - Reads the application extension block parsing any animation or XMP information - if present. - - - - - Skips over a block or reads its terminator. - The length of the block to skip. - - - - - Reads the gif comments. - - - - - Reads an individual gif frame. - - The pixel format. - The image to decode the information to. - The previous frame. - - - - Reads the frame indices marking the color to use for each pixel. - - The 2D pixel buffer to write to. - - - - Reads the frames colors, mapping indices to colors. - - The pixel format. - The image to decode the information to. - The previous frame. - The indexed pixels. - The color table containing the available colors. - The - - - - Restores the current frame area to the background. - - The pixel format. - The frame. - - - - Sets the frames metadata. - - The metadata. - - - - Reads the logical screen descriptor and global color table blocks - - The stream containing image data. - - - - Provides enumeration for instructing the decoder what to do with the last image - in an animation sequence. - section 23 - - - - - No disposal specified. - The decoder is not required to take any action. - - - - - Do not dispose. - The graphic is to be left in place. - - - - - Restore to background color. - The area used by the graphic must be restored to the background color. - - - - - Restore to previous. - The decoder is required to restore the area overwritten by the - graphic with what was there prior to rendering the graphic. - - - - - Image encoder for writing image data to a stream in gif format. - - - - - Gets or sets the quantizer for reducing the color count. - Defaults to the - - - - - Gets or sets the color table mode: Global or local. - - - - - Gets or sets the used for quantization - when building a global color table in case of . - - - - - - - - - - - Implements the GIF encoding protocol. - - - - - Used for allocating memory during processing operations. - - - - - Configuration bound to the encoding operation. - - - - - A reusable buffer used to reduce allocations. - - - - - The quantizer used to generate the color palette. - - - - - The color table mode: Global or local. - - - - - The number of bits requires to store the color palette. - - - - - The pixel sampling strategy for global quantization. - - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The options for the encoder. - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to request cancellation. - - - - Returns the index of the most transparent color in the palette. - - The quantized frame. - The pixel format. - - The . - - - - - Writes the file header signature and version to the stream. - - The stream to write to. - - - - Writes the logical screen descriptor to the stream. - - The image metadata. - The image width. - The image height. - The transparency index to set the default background index to. - Whether to use a global or local color table. - The stream to write to. - - - - Writes the application extension to the stream. - - The stream to write to. - The frame count fo this image. - The animated image repeat count. - The XMP metadata profile. Null if profile is not to be written. - - - - Writes the image comments to the stream. - - The metadata to be extract the comment data. - The stream to write to. - - - - Writes a comment sub-block to the stream. - - The stream to write to. - Comment as a Span. - Current start index. - The length of the string to write. Should not exceed 255 bytes. - - - - Writes the graphics control extension to the stream. - - The metadata of the image or frame. - The index of the color in the color palette to make transparent. - The stream to write to. - - - - Writes the provided extension to the stream. - - The extension to write to the stream. - The stream to write to. - - - - Writes the image descriptor to the stream. - - The pixel format. - The to be encoded. - Whether to use the global color table. - The stream to write to. - - - - Writes the color table to the stream. - - The pixel format. - The to encode. - The stream to write to. - - - - Writes the image pixel data to the stream. - - The pixel format. - The containing indexed pixels. - The stream to write to. - - - - Registers the image encoders, decoders and mime type detectors for the gif format. - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - - - - Provides Gif specific metadata information for the image frame. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the length of the color table for paletted images. - If not 0, then this field indicates the maximum number of colors to use when quantizing the - image frame. - - - - - Gets or sets the frame delay for animated images. - If not 0, when utilized in Gif animation, this field specifies the number of hundredths (1/100) of a second to - wait before continuing with the processing of the Data Stream. - The clock starts ticking immediately after the graphic is rendered. - - - - - Gets or sets the disposal method for animated images. - Primarily used in Gif animation, this field indicates the way in which the graphic is to - be treated after being displayed. - - - - - - - - Detects gif file headers - - - - - - - - - - - Provides Gif specific metadata information for the image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the number of times any animation is repeated. - - 0 means to repeat indefinitely, count is set as repeat n-1 times. Defaults to 1. - - - - - - Gets or sets the color table mode. - - - - - Gets or sets the length of the global color table if present. - - - - - Gets or sets the the collection of comments about the graphics, credits, descriptions or any - other type of non-control and non-graphic data. - - - - - - - - Cold path optimization for throwing 's - - The error message for the exception. - - - - Cold path optimization for throwing 's. - - The error message for the exception. - The exception that is the cause of the current exception, or a null reference - if no inner exception is specified. - - - - Decoder for generating an image out of a gif encoded stream. - - - - - Gets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets the decoding mode for multi-frame images. - - - - - The configuration options used for encoding gifs. - - - - - Gets the quantizer used to generate the color palette. - - - - - Gets the color table mode: Global or local. - - - - - Gets the used for quantization when building a global color table. - - - - - Decompresses and decodes data using the dynamic LZW algorithms. - - - - - The max decoder pixel stack size. - - - - - The null code. - - - - - The stream to decode. - - - - - The prefix buffer. - - - - - The suffix buffer. - - - - - The pixel stack buffer. - - - - - Initializes a new instance of the class - and sets the stream, where the compressed data should be read from. - - The to use for buffer allocations. - The stream to read from. - is null. - - - - Decodes and decompresses all pixel indices from the stream. - - Minimum code size of the data. - The pixel array to decode to. - - - - Reads the next data block from the stream. A data block begins with a byte, - which defines the size of the block, followed by the block itself. - - The buffer to store the block in. - - The . - - - - - - - - Encodes and compresses the image data using dynamic Lempel-Ziv compression. - - - Adapted from Jef Poskanzer's Java port by way of J. M. G. Elliott. K Weiner 12/00 - - GIFCOMPR.C - GIF Image compression routines - - - Lempel-Ziv compression based on 'compress'. GIF modifications by - David Rowley (mgardi@watdcsu.waterloo.edu) - - GIF Image compression - modified 'compress' - - Based on: compress.c - File compression ala IEEE Computer, June 1984. - By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) - Jim McKie (decvax!mcvax!jim) - Steve Davies (decvax!vax135!petsd!peora!srd) - Ken Turkowski (decvax!decwrl!turtlevax!ken) - James A. Woods (decvax!ihnp4!ames!jaw) - Joe Orost (decvax!vax135!petsd!joe) - - - - - - 80% occupancy - - - - - The amount to shift each code. - - - - - Mask used when shifting pixel values - - - - - The maximum number of bits/code. - - - - - Should NEVER generate this code. - - - - - The initial code size. - - - - - The hash table. - - - - - The code table. - - - - - Define the storage for the packet accumulator. - - - - - Number of bits/code - - - - - maximum code, given bitCount - - - - - First unused entry - - - - - Block compression parameters -- after all codes are used up, - and compression rate changes, start over. - - - - - Algorithm: use open addressing double hashing (no chaining) on the - prefix code / next character combination. We do a variant of Knuth's - algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime - secondary probe. Here, the modular division first probe is gives way - to a faster exclusive-or manipulation. Also do block compression with - an adaptive reset, whereby the code table is cleared when the compression - ratio decreases, but after the table fills. The variable-length output - codes are re-sized at this point, and a special CLEAR code is generated - for the decompressor. Late addition: construct the table according to - file size for noticeable speed improvement on small files. Please direct - questions about this implementation to ames!jaw. - - - - - The clear code. - - - - - The end-of-file code. - - - - - Output the given code. - Inputs: - code: A bitCount-bit integer. If == -1, then EOF. This assumes - that bitCount =< wordsize - 1. - Outputs: - Outputs code to the file. - Assumptions: - Chars are 8 bits long. - Algorithm: - Maintain a BITS character long buffer (so that 8 codes will - fit in it exactly). Use the VAX insv instruction to insert each - code in turn. When the buffer fills up empty it and start over. - - - - - The current bits. - - - - - Number of characters so far in this 'packet' - - - - - Initializes a new instance of the class. - - The to use for buffer allocations. - The color depth in bits. - - - - Encodes and compresses the indexed pixels to the stream. - - The 2D buffer of indexed pixels. - The stream to write to. - - - - Gets the maximum code value. - - The number of bits - See - - - - Add a character to the end of the current packet, and if it is 254 characters, - flush the packet to disk. - - The character to add. - The reference to the storage for packet accumulators - The stream to write to. - - - - Table clear for block compress. - - The output stream. - - - - Reset the code table. - - - - - Compress the packets to the stream. - - The 2D buffer of indexed pixels. - The initial bits. - The stream to write to. - - - - Flush the packet to disk and reset the accumulator. - - The output stream. - - - - Output the current code to the stream. - - The code. - The stream to write to. - - - - - - - The Graphic Control Extension contains parameters used when - processing a graphic rendering block. - - - - - Gets the size of the block. - - - - - Gets the packed disposalMethod and transparencyFlag value. - - - - - Gets the delay time in of hundredths (1/100) of a second - to wait before continuing with the processing of the Data Stream. - The clock starts ticking immediately after the graphic is rendered. - - - - - Gets the transparency index. - The Transparency Index is such that when encountered, the corresponding pixel - of the display device is not modified and processing goes on to the next pixel. - - - - - Gets the disposal method which indicates the way in which the - graphic is to be treated after being displayed. - - - - - Gets a value indicating whether transparency flag is to be set. - This indicates whether a transparency index is given in the Transparent Index field. - - - - - Each image in the Data Stream is composed of an Image Descriptor, - an optional Local Color Table, and the image data. - Each image must fit within the boundaries of the - Logical Screen, as defined in the Logical Screen Descriptor. - - - - - Gets the column number, in pixels, of the left edge of the image, - with respect to the left edge of the Logical Screen. - Leftmost column of the Logical Screen is 0. - - - - - Gets the row number, in pixels, of the top edge of the image with - respect to the top edge of the Logical Screen. - Top row of the Logical Screen is 0. - - - - - Gets the width of the image in pixels. - - - - - Gets the height of the image in pixels. - - - - - Gets the packed value of localColorTableFlag, interlaceFlag, sortFlag, and localColorTableSize. - - - - - The Logical Screen Descriptor contains the parameters - necessary to define the area of the display device - within which the images will be rendered - - - - - Gets the width, in pixels, of the Logical Screen where the images will - be rendered in the displaying device. - - - - - Gets the height, in pixels, of the Logical Screen where the images will be - rendered in the displaying device. - - - - - Gets the packed value consisting of: - globalColorTableFlag, colorResolution, sortFlag, and sizeOfGlobalColorTable. - - - - - Gets the index at the Global Color Table for the Background Color. - The Background Color is the color used for those - pixels on the screen that are not covered by an image. - - - - - Gets the pixel aspect ratio. - - - - - Gets a value indicating whether a flag denoting the presence of a Global Color Table - should be set. - If the flag is set, the Global Color Table will included after - the Logical Screen Descriptor. - - - - - Gets the global color table size. - If the Global Color Table Flag is set, - the value in this field is used to calculate the number of - bytes contained in the Global Color Table. - - - - - Gets the color depth, in number of bits per pixel. - The lowest 3 packed bits represent the bit depth minus 1. - - - - - Gets the repeat count. - 0 means loop indefinitely. Count is set as play n + 1 times. - - - - - Gets the raw Data. - - - - - Reads the XMP metadata from the specified stream. - - The stream to read from. - The memory allocator. - The XMP metadata - Thrown if the XMP block is not properly terminated. - - - - A base interface for GIF extensions. - - - - - Gets the label identifying the extensions. - - - - - Gets the length of the contents of this extension. - - - - - Writes the extension data to the buffer. - - The buffer to write the extension to. - The number of bytes written to the buffer. - - - - Encapsulates properties and methods required for decoding an image from a stream. - - - - - Decodes the image from the specified stream to an of a specific pixel type. - - The pixel format. - The configuration for the image. - The containing image data. - The token to monitor for cancellation requests. - The . - - - - Decodes the image from the specified stream to an . - - The configuration for the image. - The containing image data. - The token to monitor for cancellation requests. - The . - - - - Abstraction for shared internals for ***DecoderCore implementations to be used with . - - - - - Gets the associated configuration. - - - - - Gets the dimensions of the image being decoded. - - - - - Decodes the image from the specified stream. - - The pixel format. - The stream, where the image should be decoded from. Cannot be null. - The token to monitor for cancellation requests. - is null. - The decoded image. - - Cancellable synchronous method. In case of cancellation, - an shall be thrown which will be handled on the call site. - - - - - Reads the raw image information from the specified stream. - - The containing image data. - The token to monitor for cancellation requests. - The . - - Cancellable synchronous method. In case of cancellation, - an shall be thrown which will be handled on the call site. - - - - - Encapsulates properties and methods required for encoding an image to a stream. - - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to monitor for cancellation requests. - A representing the asynchronous operation. - - - - Abstraction for shared internals for ***DecoderCore implementations to be used with . - - - - - Encodes the image. - - The image. - The stream. - The token to monitor for cancellation requests. - The pixel type. - - - - Defines the contract for an image format. - - - - - Gets the name that describes this image format. - - - - - Gets the default mimetype that the image format uses - - - - - Gets all the mimetypes that have been used by this image format. - - - - - Gets the file extensions this image format commonly uses. - - - - - Defines the contract for an image format containing metadata. - - The type of format metadata. - - - - Creates a default instance of the format metadata. - - The . - - - - Defines the contract for an image format containing metadata with multiple frames. - - The type of format metadata. - The type of format frame metadata. - - - - Creates a default instance of the format frame metadata. - - The . - - - - Used for detecting mime types from a file header - - - - - Gets the size of the header for this image type. - - The size of the header. - - - - Detect mimetype - - The containing the file header. - returns the mime type of detected otherwise returns null - - - - Encapsulates methods used for detecting the raw image information without fully decoding it. - - - - - Reads the raw image information from the specified stream. - - The configuration for the image. - The containing image data. - The token to monitor for cancellation requests. - The object - - - - Collection of Image Formats to be used in class. - - - - - Used for locking against as there is no ConcurrentSet type. - - - - - - The list of supported keyed to mime types. - - - - - The list of supported keyed to mime types. - - - - - The list of supported s. - - - - - The list of supported s. - - - - - Initializes a new instance of the class. - - - - - Gets the maximum header size of all the formats. - - - - - Gets the currently registered s. - - - - - Gets the currently registered s. - - - - - Gets the currently registered s. - - - - - Gets the currently registered s. - - - - - Registers a new format provider. - - The format to register as a known format. - - - - For the specified file extensions type find the e . - - The extension to discover - The if found otherwise null - - - - For the specified mime type find the . - - The mime-type to discover - The if found; otherwise null - - - - Sets a specific image encoder as the encoder for a specific image format. - - The image format to register the encoder for. - The encoder to use, - - - - Sets a specific image decoder as the decoder for a specific image format. - - The image format to register the encoder for. - The decoder to use, - - - - Removes all the registered image format detectors. - - - - - Adds a new detector for detecting mime types. - - The detector to add - - - - For the specified mime type find the decoder. - - The format to discover - The if found otherwise null - - - - For the specified mime type find the encoder. - - The format to discover - The if found otherwise null - - - - Sets the max header size. - - - - - 8x8 matrix of coefficients. - - - - - A number of scalar coefficients in a - - - - - A placeholder buffer so the actual struct occupies exactly 64 * 2 bytes. - - - This is not used directly in the code. - - - - - Gets or sets a value at the given index - - The index - The value - - - - Gets or sets a value in a row+column of the 8x8 block - - The x position index in the row - The column index - The value - - - - Convert to - - - - - Copy all elements to an array of . - - - - - Copy elements into 'destination' Span of values - - - - - Copy elements into 'destination' Span of values - - - - - Load raw 16bit integers from source. - - Source - - - - Cast and copy -s from the beginning of 'source' span. - - - - - - - - Returns index of the last non-zero element in given matrix. - - - Index of the last non-zero element. Returns -1 if all elements are equal to zero. - - - - - Transpose the block inplace. - - - - - Calculate the total sum of absolute differences of elements in 'a' and 'b'. - - - - - 8x8 matrix of coefficients. - - - - - A number of scalar coefficients in a - - - - - Get/Set scalar elements at a given index - - The index - The float value at the specified index - - - - Load raw 32bit floating point data from source. - - Source - - - - Load raw 32bit floating point data from source - - Source - - - - Copy raw 32bit floating point data to dest - - Destination - - - - Multiply all elements of the block. - - The value to multiply by. - - - - Multiply all elements of the block by the corresponding elements of 'other'. - - - - - Adds a vector to all elements of the block. - - The added vector. - - - - Quantize input block, transpose, apply zig-zag ordering and store as . - - Source block. - Destination block. - The quantization table. - - - - Level shift by +maximum/2, clip to [0..maximum], and round all the values in the block. - - - - - Rounds all values in the block. - - - - - Loads values from using extended AVX2 intrinsics. - - The source - - - - Compares entire 8x8 block to a single scalar value. - - Value to compare to. - - - - - - - - - - Transpose the block inplace. - - - - - Scalar inplace transpose implementation for - - - - - Level shift by +maximum/2, clip to [0, maximum] - - - - - AVX2-only variant for executing and in one step. - - - - - Fill the block from 'source' doing short -> float conversion. - - - - - Copy block data into the destination color buffer pixel area with the provided horizontal and vertical scale factors. - - - - - Provides information about the Adobe marker segment. - - See the included 5116.DCT.pdf file in the source for more information. - - - - Gets the length of an adobe marker segment. - - - - - Initializes a new instance of the struct. - - The DCT encode version - The horizontal downsampling hint used for DCT encoding - The vertical downsampling hint used for DCT encoding - The color transform model used - - - - Gets the DCT Encode Version - - - - - Gets the horizontal downsampling hint used for DCT encoding - 0x0 : (none - Chop) - Bit 15 : Encoded with Blend=1 downsampling. - - - - - Gets the vertical downsampling hint used for DCT encoding - 0x0 : (none - Chop) - Bit 15 : Encoded with Blend=1 downsampling - - - - - Gets the colorspace transform model used - 00 : Unknown (RGB or CMYK) - 01 : YCbCr - 02 : YCCK - - - - - Converts the specified byte array representation of an Adobe marker to its equivalent and - returns a value that indicates whether the conversion succeeded. - - The byte array containing metadata to parse. - The marker to return. - - - - - - - - - - - - - Encapsulates the conversion of color channels from jpeg image to RGB channels. - - - - - The available converters - - - - - Initializes a new instance of the class. - - - - - Gets a value indicating whether this is available - on the current runtime and CPU architecture. - - - - - Gets the of this converter. - - - - - Gets the Precision of this converter in bits. - - - - - Gets the maximum value of a sample - - - - - Gets the half of the maximum value of a sample - - - - - Returns the corresponding to the given - - - - - Converts planar jpeg component values in to RGB color space inplace. - - The input/ouptut as a stack-only struct - - - - Returns the s for all supported colorspaces and precisions. - - - - - Returns the s for the YCbCr colorspace. - - - - - Returns the s for the YccK colorspace. - - - - - Returns the s for the CMYK colorspace. - - - - - Returns the s for the gray scale colorspace. - - - - - Returns the s for the RGB colorspace. - - - - - A stack-only struct to reference the input buffers using -s. - - - - - The component count - - - - - The component 0 (eg. Y) - - - - - The component 1 (eg. Cb). In case of grayscale, it points to . - - - - - The component 2 (eg. Cr). In case of grayscale, it points to . - - - - - The component 4 - - - - - Initializes a new instance of the struct. - - List of component buffers. - Row to convert - - - - Initializes a new instance of the struct. - - List of component color processors. - Row to convert - - - - abstract base for implementations - based on scalar instructions. - - - - - abstract base for implementations - based on API. - - - Converters of this family can work with data of any size. - Even though real life data is guaranteed to be of size - divisible by 8 newer SIMD instructions like AVX512 won't work with - such data out of the box. These converters have fallback code - for 'remainder' data. - - - - - Used to buffer and track the bits read from the Huffman entropy encoded data. - - - - - Gets the current, if any, marker in the input stream. - - - - - Gets the opening position of an identified marker. - - - - - Gets a value indicating whether to continue reading the input stream. - - - - - Whether a RST marker has been detected, I.E. One that is between RST0 and RST7 - - - - - Whether a bad marker has been detected, I.E. One that is not between RST0 and RST7 - - - - - Decodes the Huffman encoded spectral scan. - Originally ported from - with additional fixes for both performance and common encoding errors. - - - - - instance containing decoding-related information. - - - - - Shortcut for .Components. - - - - - Number of component in the current scan. - - - - - The reset interval determined by RST markers. - - - - - How many mcu's are left to do. - - - - - The End-Of-Block countdown for ending the sequence prematurely when the remaining coefficients are zero. - - - - - The DC Huffman tables. - - - - - The AC Huffman tables - - - - - Initializes a new instance of the class. - - The input stream. - Spectral to pixel converter. - The token to monitor cancellation. - - - - Sets reset interval determined by RST markers. - - - - - Decodes the entropy coded data. - - Component count in the current scan. - - - - Build the huffman table using code lengths and code values. - - Table type. - Table index. - Code lengths. - Code values. - The provided spare workspace memory, can be dirty. - - - - Represents a Huffman coding table containing basic coding data plus tables for accelerated computation. - - - - - Memory workspace buffer size used in ctor. - - - - - Derived from the DHT marker. Contains the symbols, in order of incremental code length. - - - - - Contains the largest code of length k (0 if none). MaxCode[17] is a sentinel to - ensure terminates. - - - - - Values[] offset for codes of length k ValOffset[k] = Values[] index of 1st symbol of code length - k, less the smallest code of length k; so given a code of length k, the corresponding symbol is - Values[code + ValOffset[k]]. - - - - - Contains the length of bits for the given k value. - - - - - Lookahead table: indexed by the next bits of - the input data stream. If the next Huffman code is no more - than bits long, we can obtain its length and - the corresponding symbol directly from this tables. - - The lower 8 bits of each table entry contain the number of - bits in the corresponding Huffman code, or + 1 - if too long. The next 8 bits of each entry contain the symbol. - - - - - Initializes a new instance of the struct. - - The code lengths. - The huffman values. - The provided spare workspace memory, can be dirty. - - - - Common interface to represent raw Jpeg components. - - - - - Gets the component's position in the components array. - - - - - Gets the number of blocks in this component as - - - - - Gets the horizontal and the vertical sampling factor as - - - - - Gets the divisors needed to apply when calculating colors. - - https://en.wikipedia.org/wiki/Chroma_subsampling - - In case of 4:2:0 subsampling the values are: Luma.SubSamplingDivisors = (1,1) Chroma.SubSamplingDivisors = (2,2) - - - - - Gets the index of the quantization table for this block. - - - - - Gets the storing the "raw" frequency-domain decoded + unzigged blocks. - We need to apply IDCT and dequantization to transform them into color-space blocks. - - - - - Represents decompressed, unprocessed jpeg data with spectral space -s. - - - - - Gets the color space - - - - - Gets the components. - - - - - Gets the quantization tables, in natural order. - - - - - Provides information about the JFIF marker segment. - TODO: Thumbnail? - - - - - Gets the length of an JFIF marker segment. - - - - - Initializes a new instance of the struct. - - The major version. - The minor version. - The units for the density values. - The horizontal pixel density. - The vertical pixel density. - - - - Gets the major version. - - - - - Gets the minor version. - - - - - Gets the units for the following pixel density fields - 00 : No units; width:height pixel aspect ratio = Ydensity:Xdensity - 01 : Pixels per inch (2.54 cm) - 02 : Pixels per centimeter - - - - - Gets the horizontal pixel density. Must not be zero. - - - - - Gets the vertical pixel density. Must not be zero. - - - - - Converts the specified byte array representation of an JFIF marker to its equivalent and - returns a value that indicates whether the conversion succeeded. - - The byte array containing metadata to parse. - The marker to return. - - - - - - - - - - - - - Identifies the colorspace of a Jpeg image. - - - - - Color space with 1 component. - - - - - Color space with 4 components. - - - - - Color space with 4 components. - - - - - Color space with 3 components. - - - - - Color space with 3 components. - - - - - Represents a single frame component. - - - - - Gets the component id. - - - - - Gets or sets DC coefficient predictor. - - - - - Gets the horizontal sampling factor. - - - - - Gets the vertical sampling factor. - - - - - - - - - - - - - - - - - - - - - - - Gets the number of blocks per line. - - - - - Gets the number of blocks per column. - - - - - Gets or sets the index for the DC Huffman table. - - - - - Gets or sets the index for the AC Huffman table. - - - - - - - - Initializes component for future buffers initialization. - - Maximal horizontal subsampling factor among all the components. - Maximal vertical subsampling factor among all the components. - - - - Encapsulates spectral data to rgba32 processing for one component. - - - - - The size of the area in corresponding to one 8x8 Jpeg block - - - - - Jpeg frame instance containing required decoding metadata. - - - - - Gets the maximal number of block rows being processed in one step. - - - - - Gets the component containing decoding meta information. - - - - - Gets the instance containing decoding meta information. - - - - - Initializes a new instance of the class. - - - - - Gets the temporary working buffer of color values. - - - - - - - - Convert raw spectral DCT data to color data and copy it to the color buffer . - - - - - Represents a jpeg file marker. - - - - - Initializes a new instance of the struct. - - The marker - The position within the stream - - - - Initializes a new instance of the struct. - - The marker - The position within the stream - Whether the current marker is invalid - - - - Gets a value indicating whether the current marker is invalid - - - - - Gets the position of the marker within a stream - - - - - Gets the position of the marker within a stream - - - - - - - - Represent a single jpeg frame - - - - - Gets a value indicating whether the frame uses the extended specification. - - - - - Gets a value indicating whether the frame uses the progressive specification. - - - - - Gets or sets a value indicating whether the frame is encoded using multiple scans (SOS markers). - - - This is true for progressive and baseline non-interleaved images. - - - - - Gets the precision. - - - - - Gets the maximum color value derived from . - - - - - Gets the number of pixel per row. - - - - - Gets the number of pixels per line. - - - - - Gets the pixel size of the image. - - - - - Gets the number of components within a frame. - - - - - Gets or sets the component id collection. - - - - - Gets or sets the order in which to process the components. - in interleaved mode. - - - - - Gets or sets the frame component collection. - - - - - Gets or sets the number of MCU's per line. - - - - - Gets or sets the number of MCU's per column. - - - - - Gets the mcu size of the image. - - - - - Gets the color depth, in number of bits per pixel. - - - - - - - - Allocates the frame component blocks. - - Maximal horizontal subsampling factor among all the components. - Maximal vertical subsampling factor among all the components. - - - - Provides methods for identifying metadata and color profiles within jpeg images. - - - - - Gets the JFIF specific markers. - - - - - Gets the ICC specific markers. - - - - - Gets the adobe photoshop APP13 marker which can contain IPTC meta data. - - - - - Gets the 8BIM marker, which signals the start of a adobe specific image resource block. - - - - - Gets a IPTC Image resource ID. - - - - - Gets the EXIF specific markers. - - - - - Gets the XMP specific markers. - - - - - Gets the Adobe specific markers . - - - - - Returns a value indicating whether the passed bytes are a match to the profile identifier. - - The bytes to check. - The profile identifier. - The . - - - - Converter used to convert jpeg spectral data to color pixels. - - - - - Gets a value indicating whether this converter has converted spectral - data of the current image or not. - - - - - Injects jpeg image decoding metadata. - - - This is guaranteed to be called only once at SOF marker by . - - instance containing decoder-specific parameters. - instance containing decoder-specific parameters. - - - - Converts single spectral jpeg stride to color stride in baseline - decoding mode. - - - Called once per decoded spectral stride in - only for baseline interleaved jpeg images. - Spectral 'stride' doesn't particularly mean 'single stride'. - Actual stride height depends on the subsampling factor of the given image. - - - - - Marks current converter state as 'converted'. - - - This must be called only for baseline interleaved jpeg's. - - - - - Gets the color converter. - - The jpeg frame with the color space to convert to. - The raw JPEG data. - The color converter. - - - - - Color decoding scheme: - - - Decode spectral data to Jpeg color space - Convert from Jpeg color space to RGB - Convert from RGB to target pixel space - - - - - - - instance associated with current - decoding routine. - - - - - Jpeg component converters from decompressed spectral to color data. - - - - - Color converter from jpeg color space to target pixel color space. - - - - - Intermediate buffer of RGB components used in color conversion. - - - - - Proxy buffer used in packing from RGB to target TPixel pixels. - - - - - Resulting 2D pixel buffer. - - - - - How many pixel rows are processed in one 'stride'. - - - - - How many pixel rows were processed. - - - - - Initializes a new instance of the class. - - The configuration. - - - - Gets converted pixel buffer. - - - For non-baseline interleaved jpeg this method does a 'lazy' spectral - conversion from spectral to color. - - Cancellation token. - Pixel buffer. - - - - - - - - - - Converts single spectral jpeg stride to color stride. - - Spectral stride index. - - - - - - - Enumerates the Huffman tables - - - - - The DC luminance huffman table index - - - - - The AC luminance huffman table index - - - - - The DC chrominance huffman table index - - - - - The AC chrominance huffman table index - - - - - A compiled look-up table representation of a huffmanSpec. - The maximum codeword size is 16 bits. - - - - Each value maps to a int32 of which the 24 most significant bits hold the - codeword in bits and the 8 least significant bits hold the codeword size. - - - Code value occupies 24 most significant bits as integer value. - This value is shifted to the MSB position for performance reasons. - For example, decimal value 10 is stored like this: - - MSB LSB - 1010 0000 00000000 00000000 | 00000100 - - This was done to eliminate extra binary shifts in the encoder. - While code length is represented as 8 bit integer value - - - - - - The compiled representations of theHuffmanSpec. - - - - - Initializes static members of the struct. - - - - - Initializes a new instance of the struct. - - dasd - - - - Gets the collection of huffman values. - - - - - Maximum number of bytes encoded jpeg 8x8 block can occupy. - It's highly unlikely for block to occupy this much space - it's a theoretical limit. - - - Where 16 is maximum huffman code binary length according to itu - specs. 10 is maximum value binary length, value comes from discrete - cosine tranform with value range: [-1024..1023]. Block stores - 8x8 = 64 values thus multiplication by 64. Then divided by 8 to get - the number of bytes. This value is then multiplied by - for performance reasons. - - - - - Multiplier used within cache buffers size calculation. - - - - Theoretically, bytes buffer can fit - exactly one minimal coding unit. In reality, coding blocks occupy much - less space than the theoretical maximum - this can be exploited. - If temporal buffer size is multiplied by at least 2, second half of - the resulting buffer will be used as an overflow 'guard' if next - block would occupy maximum number of bytes. While first half may fit - many blocks before needing to flush. - - - This is subject to change. This can be equal to 1 but recomended - value is 2 or even greater - futher benchmarking needed. - - - - - - size multiplier. - - - Jpeg specification requiers to insert 'stuff' bytes after each - 0xff byte value. Worst case scenarion is when all bytes are 0xff. - While it's highly unlikely (if not impossible) to get such - combination, it's theoretically possible so buffer size must be guarded. - - - - - Compiled huffman tree to encode given values. - - Yields codewords by index consisting of [run length | bitsize]. - - - - Emitted bits 'micro buffer' before being transferred to the . - - - - - Buffer for temporal storage of huffman rle encoding bit data. - - - Encoding bits are assembled to 4 byte unsigned integers and then copied to this buffer. - This process does NOT include inserting stuff bytes. - - - - - Buffer for temporal storage which is then written to the output stream. - - - Encoding bits from are copied to this byte buffer including stuff bytes. - - - - - Number of jagged bits stored in - - - - - The output stream. All attempted writes after the first error become no-ops. - - - - - Initializes a new instance of the class. - - Amount of encoded 8x8 blocks per single jpeg macroblock. - Output stream for saving encoded data. - - - - Gets a value indicating whether is full - and must be flushed using - before encoding next 8x8 coding block. - - - - - Encodes the image with no subsampling. - - The pixel format. - The pixel accessor providing access to the image pixels. - Luminance quantization table provided by the callee. - Chrominance quantization table provided by the callee. - The token to monitor for cancellation. - - - - Encodes the image with subsampling. The Cb and Cr components are each subsampled - at a factor of 2 both horizontally and vertically. - - The pixel format. - The pixel accessor providing access to the image pixels. - Luminance quantization table provided by the callee. - Chrominance quantization table provided by the callee. - The token to monitor for cancellation. - - - - Encodes the image with no chroma, just luminance. - - The pixel format. - The pixel accessor providing access to the image pixels. - Luminance quantization table provided by the callee. - The token to monitor for cancellation. - - - - Encodes the image with no subsampling and keeps the pixel data as Rgb24. - - The pixel format. - The pixel accessor providing access to the image pixels. - Quantization table provided by the callee. - The token to monitor for cancellation. - - - - Writes a block of pixel data using the given quantization table, - returning the post-quantized DC value of the DCT-transformed block. - The block is in natural (not zig-zag) order. - - The quantization table index. - The previous DC value. - Source block. - Quantization table. - The . - - - - Emits the most significant count of bits to the buffer. - - - - Supports up to 32 count of bits but, generally speaking, jpeg - standard assures that there won't be more than 16 bits per single - value. - - - Emitting algorithm uses 3 intermediate buffers for caching before - writing to the stream: - - - uint32 - - Bit buffer. Encoded spectral values can occupy up to 16 bits, bits - are assembled to whole bytes via this intermediate buffer. - - - - uint32[] - - Assembled bytes from uint32 buffer are saved into this buffer. - uint32 buffer values are saved using indices from the last to the first. - As bytes are saved to the memory as 4-byte packages endianness matters: - Jpeg stream is big-endian, indexing buffer bytes from the last index to the - first eliminates all operations to extract separate bytes. This only works for - little-endian machines (there are no known examples of big-endian users atm). - For big-endians this approach is slower due to the separate byte extraction. - - - - byte[] - - Byte buffer used only during method. - - - - - - Bits to emit, must be shifted to the left. - Bits count stored in the bits parameter. - - - - Emits the given value with the given Huffman table. - - Huffman table. - Value to encode. - - - - Emits given value via huffman rle encoding. - - Huffman table. - The number of preceding zeroes, preshifted by 4 to the left. - Value to encode. - - - - Calculates how many minimum bits needed to store given value for Huffman jpeg encoding. - - - This is an internal operation supposed to be used only in class for jpeg encoding. - - The value. - - - - General method for flushing cached spectral data bytes to - the ouput stream respecting stuff bytes. - - - Bytes cached via are stored in 4-bytes blocks - which makes this method endianness dependent. - - - - - Flushes spectral data bytes after encoding all channel blocks - in a single jpeg macroblock using . - - - This must be called only if is true - only during the macroblocks encoding routine. - - - - - Flushes final cached bits to the stream padding 1's to - complement full bytes. - - - This must be called only once at the end of the encoding routine. - check is not needed. - - - - - The Huffman encoding specifications. - - - - - The Huffman encoding specifications. - This encoder uses the same Huffman encoding for all images. - - - - - Gets count[i] - The number of codes of length i bits. - - - - - Gets value[i] - The decoded value of the codeword at the given index. - - - - - Initializes a new instance of the struct. - - - The number of codes. - - - The decoded values. - - - - - On-stack worker struct to efficiently encapsulate the TPixel -> L8 -> Y conversion chain of 8x8 pixel blocks. - - The pixel type to work on - - - - Number of pixels processed per single call - - - - - The Y component - - - - - Temporal 64-pixel span to hold unconverted TPixel data. - - - - - Temporal 64-byte span to hold converted data. - - - - - Sampled pixel buffer size. - - - - - for internal operations. - - - - - Gets size of sampling area from given frame pixel buffer. - - - - - Converts a 8x8 image area inside 'pixels' at position (x,y) placing the result members of the structure () - - - - - Converts 8x8 L8 pixel matrix to 8x8 Block of floats using Avx2 Intrinsics. - - Start of span of L8 pixels with size of 64 - 8x8 destination matrix of Luminance(Y) converted data - - - - Converts 8x8 L8 pixel matrix to 8x8 Block of floats. - - Start of span of L8 pixels with size of 64 - 8x8 destination matrix of Luminance(Y) converted data - - - - Enumerates the quantization tables. - - - - - The luminance quantization table index. - - - - - The chrominance quantization table index. - - - - - On-stack worker struct to convert TPixel -> Rgb24 of 8x8 pixel blocks. - - The pixel type to work on. - - - - Number of pixels processed per single call - - - - - Total byte size of processed pixels converted from TPixel to - - - - - The Red component. - - - - - The Green component. - - - - - The Blue component. - - - - - Temporal 64-byte span to hold unconverted TPixel data. - - - - - Temporal 64-byte span to hold converted Rgb24 data. - - - - - Sampled pixel buffer size. - - - - - for internal operations. - - - - - Gets size of sampling area from given frame pixel buffer. - - - - - Converts a 8x8 image area inside 'pixels' at position (x, y) to Rgb24. - - - - - Converts 8x8 RGB24 pixel matrix to 8x8 Block of floats using Avx2 Intrinsics. - - Span of Rgb24 pixels with size of 64 - 8x8 destination matrix of Red converted data - 8x8 destination matrix of Blue converted data - 8x8 destination matrix of Green converted data - - - - Provides 8-bit lookup tables for converting from Rgb to YCbCr colorspace. - Methods to build the tables are based on libjpeg implementation. - - - - - The red luminance table - - - - - The green luminance table - - - - - The blue luminance table - - - - - The red blue-chrominance table - - - - - The green blue-chrominance table - - - - - The blue blue-chrominance table - B=>Cb and R=>Cr are the same - - - - - The green red-chrominance table - - - - - The blue red-chrominance table - - - - - Initializes the YCbCr tables - - The initialized - - - - Converts Rgb24 pixels into YCbCr color space with 4:4:4 subsampling sampling of luminance and chroma. - - Span of Rgb24 pixel data - Resulting Y values block - Resulting Cb values block - Resulting Cr values block - - - - Converts Rgb24 pixels into YCbCr color space with 4:2:0 subsampling of luminance and chroma. - - Calculates 2 out of 4 luminance blocks and half of chroma blocks. This method must be called twice per 4x 8x8 DCT blocks with different row param. - Span of Rgb24 pixel data - First or "left" resulting Y block - Second or "right" resulting Y block - Resulting Cb values block - Resulting Cr values block - Row index of the 16x16 block, 0 or 1 - - - - Converts 8x8 Rgb24 pixel matrix to YCbCr pixel matrices with 4:4:4 subsampling - - Total size of rgb span must be 200 bytes - Span of rgb pixels with size of 64 - 8x8 destination matrix of Luminance(Y) converted data - 8x8 destination matrix of Chrominance(Cb) converted data - 8x8 destination matrix of Chrominance(Cr) converted data - - - - Converts 16x8 Rgb24 pixels matrix to 2 Y 8x8 matrices with 4:2:0 subsampling - - - - - On-stack worker struct to efficiently encapsulate the TPixel -> Rgb24 -> YCbCr conversion chain of 8x8 pixel blocks. - - The pixel type to work on - - - - Number of pixels processed per single call - - - - - Total byte size of processed pixels converted from TPixel to - - - - - The left Y component - - - - - The left Y component - - - - - The Cb component - - - - - The Cr component - - - - - The color conversion tables - - - - - Temporal 16x8 block to hold TPixel data - - - - - Temporal RGB block - - - - - Sampled pixel buffer size - - - - - for internal operations - - - - - Gets size of sampling area from given frame pixel buffer. - - - - - On-stack worker struct to efficiently encapsulate the TPixel -> Rgb24 -> YCbCr conversion chain of 8x8 pixel blocks. - - The pixel type to work on - - - - Number of pixels processed per single call - - - - - Total byte size of processed pixels converted from TPixel to - - - - - The Y component - - - - - The Cb component - - - - - The Cr component - - - - - The color conversion tables - - - - - Temporal 64-byte span to hold unconverted TPixel data - - - - - Temporal 64-byte span to hold converted Rgb24 data - - - - - Sampled pixel buffer size - - - - - for internal operations - - - - - Gets size of sampling area from given frame pixel buffer. - - - - - Converts a 8x8 image area inside 'pixels' at position (x,y) placing the result members of the structure (, , ) - - - - - Contains inaccurate, but fast forward and inverse DCT implementations. - - - - - Gets adjustment table for quantization tables. - - - - Current IDCT and FDCT implementations are based on Arai, Agui, - and Nakajima's algorithm. Both DCT methods does not - produce finished DCT output, final step is fused into the - quantization step. Quantization and de-quantization coefficients - must be multiplied by these values. - - - Given values were generated by formula: - - scalefactor[row] * scalefactor[col], where - scalefactor[0] = 1 - scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - - - - - - - Adjusts given quantization table for usage with . - - Quantization table to adjust. - - - - Adjusts given quantization table for usage with . - - Quantization table to adjust. - - - - Apply 2D floating point IDCT inplace. - - - Input block must be dequantized before this method with table - adjusted by . - - Input block. - - - - Apply 2D floating point IDCT inplace. - - - Input block must be quantized after this method with table adjusted - by . - - Input block. - - - - Apply floating point IDCT inplace using API. - - - This method can be used even if there's no SIMD intrinsics available - as can be compiled to scalar instructions. - - Input block. - - - - Apply floating point FDCT inplace using API. - - Input block. - - - - Provides methods and properties related to jpeg quantization. - - - - - Upper bound (inclusive) for jpeg quality setting. - - - - - Lower bound (inclusive) for jpeg quality setting. - - - - - Default JPEG quality for both luminance and chominance tables. - - - - - Represents lowest quality setting which can be estimated with enough confidence. - Any quality below it results in a highly compressed jpeg image - which shouldn't use standard itu quantization tables for re-encoding. - - - - - Represents highest quality setting which can be estimated with enough confidence. - - - - - Gets unscaled luminance quantization table. - - - The values are derived from ITU section K.1. - - - - - Gets unscaled chrominance quantization table. - - - The values are derived from ITU section K.1. - - - - Ported from JPEGsnoop: - https://github.com/ImpulseAdventure/JPEGsnoop/blob/9732ee0961f100eb69bbff4a0c47438d5997abee/source/JfifDecode.cpp#L4570-L4694 - - Estimates jpeg quality based on standard quantization table. - - - Technically, this can be used with any given table but internal decoder code uses ITU spec tables: - and . - - Input quantization table. - Natural order quantization table to estimate against. - Estimated quality. - - - - Estimates jpeg quality based on quantization table in zig-zag order. - - Luminance quantization table. - Estimated quality - - - - Estimates jpeg quality based on quantization table in zig-zag order. - - Chrominance quantization table. - Estimated quality - - - - Cache 8 pixel rows on the stack, which may originate from different buffers of a . - - - - - Extension methods for - - - - - Multiplies 'a.Width' with 'b.Width' and 'a.Height' with 'b.Height'. - TODO: Shouldn't we expose this as operator in SixLabors.Core? - - - - - Divides 'a.Width' with 'b.Width' and 'a.Height' with 'b.Height'. - TODO: Shouldn't we expose this as operator in SixLabors.Core? - - - - - Divide Width and Height as real numbers and return the Ceiling. - - - - - Divide Width and Height as real numbers and return the Ceiling. - - - - - Divide Width and Height as real numbers and return the Ceiling. - - - - - Gets span of zig-zag ordering indices. - - - When reading corrupted data, the Huffman decoders could attempt - to reference an entry beyond the end of this array (if the decoded - zero run length reaches past the end of the block). To prevent - wild stores without adding an inner-loop test, we put some extra - "63"s after the real entries. This will cause the extra coefficient - to be stored in location 63 of the block, not somewhere random. - The worst case would be a run-length of 15, which means we need 16 - fake entries. - - - - - Gets span of zig-zag with fused transpose step ordering indices. - - - When reading corrupted data, the Huffman decoders could attempt - to reference an entry beyond the end of this array (if the decoded - zero run length reaches past the end of the block). To prevent - wild stores without adding an inner-loop test, we put some extra - "63"s after the real entries. This will cause the extra coefficient - to be stored in location 63 of the block, not somewhere random. - The worst case would be a run-length of 15, which means we need 16 - fake entries. - - - - - Image decoder for generating an image out of a jpg stream. - - - - - Gets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Encoder for writing the data image to a stream in jpeg format. - - - - - Gets or sets the quality, that will be used to encode the image. Quality - index must be between 0 and 100 (compression from max to min). - Defaults to 75. - - - - - Gets the color type, that will be used to encode the image. - - - - - Provides enumeration of available JPEG color types. - - - - - YCbCr (luminance, blue chroma, red chroma) color as defined in the ITU-T T.871 specification. - Medium Quality - The horizontal sampling is halved and the Cb and Cr channels are only - sampled on each alternate line. - - - - - YCbCr (luminance, blue chroma, red chroma) color as defined in the ITU-T T.871 specification. - High Quality - Each of the three Y'CbCr components have the same sample rate, - thus there is no chroma subsampling. - - - - - YCbCr (luminance, blue chroma, red chroma) color as defined in the ITU-T T.871 specification. - The two chroma components are sampled at half the horizontal sample rate of luma while vertically it has full resolution. - - Note: Not supported by the encoder. - - - - - YCbCr (luminance, blue chroma, red chroma) color as defined in the ITU-T T.871 specification. - In 4:1:1 chroma subsampling, the horizontal color resolution is quartered. - - Note: Not supported by the encoder. - - - - - YCbCr (luminance, blue chroma, red chroma) color as defined in the ITU-T T.871 specification. - This ratio uses half of the vertical and one-fourth the horizontal color resolutions. - - Note: Not supported by the encoder. - - - - - Single channel, luminance. - - - - - The pixel data will be preserved as RGB without any sub sampling. - - - - - CMYK colorspace (cyan, magenta, yellow, and key black) intended for printing. - - Note: Not supported by the encoder. - - - - - Registers the image encoders, decoders and mime type detectors for the jpeg format. - - - - - - - - Contains jpeg constant values defined in the specification. - - - - - The maximum allowable length in each dimension of a jpeg image. - - - - - The list of mimetypes that equate to a jpeg. - - - - - The list of file extensions that equate to a jpeg. - - - - - Contains marker specific constants. - - - - - The prefix used for all markers. - - - - - Same as but of type - - - - - The Start of Image marker - - - - - The End of Image marker - - - - - Application specific marker for marking the jpeg format. - - - - - - Application specific marker for marking where to store metadata. - - - - - Application specific marker for marking where to store ICC profile information. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker. - - - - - Application specific marker used by Adobe for storing encoding information for DCT filters. - - - - - Application specific marker used by GraphicConverter to store JPEG quality. - - - - - Define arithmetic coding conditioning marker. - - - - - The text comment marker - - - - - Define Quantization Table(s) marker - - Specifies one or more quantization tables. - - - - - - Start of Frame (baseline DCT) - - Indicates that this is a baseline DCT-based JPEG, and specifies the width, height, number of components, - and component subsampling (e.g., 4:2:0). - - - - - - Start Of Frame (Extended Sequential DCT) - - Indicates that this is a progressive DCT-based JPEG, and specifies the width, height, number of components, - and component subsampling (e.g., 4:2:0). - - - - - - Start Of Frame (progressive DCT) - - Indicates that this is a progressive DCT-based JPEG, and specifies the width, height, number of components, - and component subsampling (e.g., 4:2:0). - - - - - - Start of Frame marker, non differential lossless, Huffman coding. - - - - - Start of Frame marker, differential, Huffman coding, Differential sequential DCT. - - - - - Start of Frame marker, differential, Huffman coding, Differential progressive DCT. - - - - - Start of Frame marker, differential lossless, Huffman coding. - - - - - Start of Frame marker, non-differential, arithmetic coding, Extended sequential DCT. - - - - - Start of Frame marker, non-differential, arithmetic coding, Progressive DCT. - - - - - Start of Frame marker, non-differential, arithmetic coding, Lossless (sequential). - - - - - Start of Frame marker, differential, arithmetic coding, Differential sequential DCT. - - - - - Start of Frame marker, differential, arithmetic coding, Differential progressive DCT. - - - - - Start of Frame marker, differential, arithmetic coding, Differential lossless (sequential). - - - - - Define Huffman Table(s) - - Specifies one or more Huffman tables. - - - - - - Define Restart Interval - - Specifies the interval between RSTn markers, in macroblocks.This marker is followed by two bytes indicating the fixed size so - it can be treated like any other variable size segment. - - - - - - Start of Scan - - Begins a top-to-bottom scan of the image. In baseline DCT JPEG images, there is generally a single scan. - Progressive DCT JPEG images usually contain multiple scans. This marker specifies which slice of data it - will contain, and is immediately followed by entropy-coded data. - - - - - - Define First Restart - - Inserted every r macroblocks, where r is the restart interval set by a DRI marker. - Not used if there was no DRI marker. The low three bits of the marker code cycle in value from 0 to 7. - - - - - - Define Eigth Restart - - Inserted every r macroblocks, where r is the restart interval set by a DRI marker. - Not used if there was no DRI marker. The low three bits of the marker code cycle in value from 0 to 7. - - - - - - Contains Adobe specific constants. - - - - - The color transform is unknown.(RGB or CMYK) - - - - - The color transform is YCbCr (luminance, red chroma, blue chroma) - - - - - The color transform is YCCK (luminance, red chroma, blue chroma, keyline) - - - - - Contains Huffman specific constants. - - - - - The size of the huffman decoder register. - - - - - The number of bits to fetch when filling the buffer. - - - - - The number of times to read the input stream when filling the buffer. - - - - - The minimum number of bits allowed before by the before fetching. - - - - - If the next Huffman code is no more than this number of bits, we can obtain its length - and the corresponding symbol directly from this tables. - - - - - If a Huffman code is this number of bits we cannot use the lookup table to determine its value. - - - - - The size of the lookup table. - - - - - Image decoder for generating an image out of a jpg stream. - - - - - - - - - - - - - - - - - Performs the jpeg decoding operation. - Originally ported from - with additional fixes for both performance and common encoding errors. - - - - - The only supported precision - - - - - The buffer used to temporarily store bytes read from the stream. - - - - - The buffer used to read markers from the stream. - - - - - Whether the image has an EXIF marker. - - - - - Contains exif data. - - - - - Whether the image has an ICC marker. - - - - - Contains ICC data. - - - - - Whether the image has a IPTC data. - - - - - Contains IPTC data. - - - - - Whether the image has a XMP data. - - - - - Contains XMP data. - - - - - Contains information about the JFIF marker. - - - - - Contains information about the Adobe marker. - - - - - Scan decoder. - - - - - Initializes a new instance of the class. - - The configuration. - The options. - - - - - - - Gets the frame - - - - - - - - Gets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets the decoded by this decoder instance. - - - - - - - - Gets the components. - - - - - - - - - - - Finds the next file marker within the byte stream. - - The buffer to read file markers to. - The input stream. - The - - - - - - - - - - Load quantization and/or Huffman tables for subsequent use for jpeg's embedded in tiff's, - so those tables do not need to be duplicated with segmented tiff's (tiff's with multiple strips). - - The table bytes. - The scan decoder. - - - - Parses the input stream for file markers. - - The input stream. - Scan decoder used exclusively to decode SOS marker. - The token to monitor cancellation. - - - - - - - Returns the correct colorspace based on the image component count and the jpeg frame component id's. - - The number of components. - The - - - - Returns the jpeg color type based on the colorspace and subsampling used. - - Jpeg color type. - - - - Initializes the EXIF profile. - - - - - Initializes the ICC profile. - - - - - Initializes the IPTC profile. - - - - - Initializes the XMP profile. - - - - - Assigns derived metadata properties to , eg. horizontal and vertical resolution if it has a JFIF header. - - - - - Extends the profile with additional data. - - The profile data array. - The array containing addition profile data. - - - - Processes the application header containing the JFIF identifier plus extra data. - - The input stream. - The remaining bytes in the segment block. - - - - Processes the App1 marker retrieving any stored metadata. - - The input stream. - The remaining bytes in the segment block. - - - - Processes the App2 marker retrieving any stored ICC profile information - - The input stream. - The remaining bytes in the segment block. - - - - Processes a App13 marker, which contains IPTC data stored with Adobe Photoshop. - The tableBytes of an APP13 segment is formed by an identifier string followed by a sequence of resource data blocks. - - The input stream. - The remaining bytes in the segment block. - - - - Reads the adobe image resource block name: a Pascal string (padded to make size even). - - The span holding the block resource data. - The length of the name. - - - - Reads the length of a adobe image resource data block. - - The span holding the block resource data. - The length of the block name. - The block length. - - - - Processes the application header containing the Adobe identifier - which stores image encoding information for DCT filters. - - The input stream. - The remaining bytes in the segment block. - - - - Processes the Define Quantization Marker and tables. Specified in section B.2.4.1. - - The input stream. - The remaining bytes in the segment block. - - Thrown if the tables do not match the header - - - - - Processes the Start of Frame marker. Specified in section B.2.2. - - The input stream. - The remaining bytes in the segment block. - The current frame marker. - Whether to parse metadata only - - - - Processes a Define Huffman Table marker, and initializes a huffman - struct from its contents. Specified in section B.2.4.2. - - The input stream. - The remaining bytes in the segment block. - - - - Processes the DRI (Define Restart Interval Marker) Which specifies the interval between RSTn markers, in - macroblocks - - The input stream. - The remaining bytes in the segment block. - - - - Processes the SOS (Start of scan marker). - - - - - Reads a from the stream advancing it by two bytes - - The input stream. - The - - - - Encoder for writing the data image to a stream in jpeg format. - - - - - - - - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to monitor for cancellation requests. - A representing the asynchronous operation. - - - - Image encoder for writing an image to a stream as a jpeg. - - - - - The number of quantization tables. - - - - - A scratch buffer to reduce allocations. - - - - - The quality, that will be used to encode the image. - - - - - Gets or sets the colorspace to use. - - - - - The output stream. All attempted writes after the first error become no-ops. - - - - - Initializes a new instance of the class. - - The options. - - - - Encode writes the image to the jpeg baseline format with the given options. - - The pixel format. - The image to write from. - The stream to write to. - The token to request cancellation. - - - - If color type was not set, set it based on the given image. - Note, if there is no metadata and the image has multiple components this method - returns defering the field assignment - to . - - - - - Returns true, if the color type is supported by the encoder. - - The color type. - true, if color type is supported. - - - - Gets the component ids. - For color space RGB this will be RGB as ASCII, otherwise 1, 2, 3. - - The component Ids. - - - - Writes data to "Define Quantization Tables" block for QuantIndex. - - The "Define Quantization Tables" block. - Offset in "Define Quantization Tables" block. - The quantization index. - The quantization table to copy data from. - - - - Write the start of image marker. - - - - - Writes the application header containing the JFIF identifier plus extra data. - - The image metadata. - - - - Writes the Define Huffman Table marker and tables. - - The number of components to write. - - - - Writes the Define Quantization Marker and tables. - - - - - Writes the APP14 marker to indicate the image is in RGB color space. - - - - - Writes the EXIF profile. - - The exif profile. - - - - Writes the IPTC metadata. - - The iptc metadata to write. - - Thrown if the IPTC profile size exceeds the limit of 65533 bytes. - - - - - Writes the XMP metadata. - - The XMP metadata to write. - - Thrown if the XMP profile size exceeds the limit of 65533 bytes. - - - - - Writes the App1 header. - - The length of the data the app1 marker contains. - - - - Writes a AppX header. - - The length of the data the app marker contains. - The app marker to write. - - - - Writes the ICC profile. - - The ICC profile to write. - - Thrown if any of the ICC profiles size exceeds the limit. - - - - - Writes the metadata profiles to the image. - - The image metadata. - - - - Writes the Start Of Frame (Baseline) marker. - - The width of the image. - The height of the image. - The number of components in a pixel. - The component Id's. - - - - Writes the StartOfScan marker. - - The number of components in a pixel. - The componentId's. - - - - Writes the EndOfImage marker. - - - - - Writes the header for a marker with the given length. - - The marker to write. - The marker length. - - - - Initializes quantization tables. - - - - Zig-zag ordering is NOT applied to the resulting tables. - - - We take quality values in a hierarchical order: - 1. Check if encoder has set quality - 2. Check if metadata has set quality - 3. Take default quality value - 75 - - - Color components count. - Jpeg metadata instance. - Output luminance quantization table. - Output chrominance quantization table. - - - - Registers the image encoders, decoders and mime type detectors for the jpeg format. - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - Detects Jpeg file headers - - - - - - - - - - - Returns a value indicating whether the given bytes identify Jfif data. - - The bytes representing the file header. - The - - - - Returns a value indicating whether the given bytes identify EXIF data. - - The bytes representing the file header. - The - - - - Returns a value indicating whether the given bytes identify Jpeg data. - This is a last chance resort for jpegs that contain ICC information. - - The bytes representing the file header. - The - - - - Provides Jpeg specific metadata information for the image. - - - - - Backing field for - - - - - Backing field for - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the jpeg luminance quality. - - - This value might not be accurate if it was calculated during jpeg decoding - with non-complient ITU quantization tables. - - - - - Gets or sets the jpeg chrominance quality. - - - This value might not be accurate if it was calculated during jpeg decoding - with non-complient ITU quantization tables. - - - - - Gets or sets the encoded quality. - - - Note that jpeg image can have different quality for luminance and chrominance components. - This property returns maximum value of luma/chroma qualities. - - - - - Gets or sets the color type. - - - - - - - - Cold path optimization for throwing 's. - - The error message for the exception. - - - - Cold path optimization for throwing 's. - - The error message for the exception. - - - - Pixel decoding methods for the PBM binary encoding. - - - - - Decode the specified pixels. - - The type of pixel to encode to. - The configuration. - The pixel array to encode into. - The stream to read the data from. - The ColorType to decode. - Data type of the pixles components. - - Thrown if an invalid combination of setting is requested. - - - - - Pixel encoding methods for the PBM binary encoding. - - - - - Decode pixels into the PBM binary encoding. - - The type of input pixel. - The configuration. - The bytestream to write to. - The input image. - The ColorType to use. - Data type of the pixles components. - - Thrown if an invalid combination of setting is requested. - - - - - Extensions methods for . - - - - - Skip over any whitespace or any comments. - - - - - Read a decimal text value. - - The integer value of the decimal. - - - - Configuration options for use during PBM encoding. - - - - - Gets the encoding of the pixels. - - - - - Gets the Color type of the resulting image. - - - - - Gets the Data Type of the pixel components. - - - - - Provides enumeration of available PBM color types. - - - - - PBM - - - - - PGM - Greyscale. Single component. - - - - - PPM - RGB Color. 3 components. - - - - - The data type of the components of the pixels. - - - - - Single bit per pixel, exclusively for . - - - - - 8 bits unsigned integer per component. - - - - - 16 bits unsigned integer per component. - - - - - Registers the image encoders, decoders and mime type detectors for the Pbm format. - - - - - - - - Contains PBM constant values defined in the specification. - - - - - The maximum allowable pixel value of a ppm image. - - - - - The list of mimetypes that equate to a ppm. - - - - - The list of file extensions that equate to a ppm. - - - - - Image decoder for reading PGM, PBM or PPM bitmaps from a stream. These images are from - the family of PNM images. - - - PBM - Black and white images. - - - PGM - Grayscale images. - - - PPM - Color images, with RGB pixels. - - - The specification of these images is found at . - - - - - - - - - - - - - - Performs the PBM decoding operation. - - - - - Initializes a new instance of the class. - - The configuration. - - - - - - - Gets the colortype to use - - - - - Gets the size of the pixel array - - - - - Gets the component data type - - - - - Gets the Encoding of pixels - - - - - Gets the decoded by this decoder instance. - - - - - - - - - - - - - - Processes the ppm header. - - The input stream. - - - - Image encoder for writing an image to a stream as PGM, PBM or PPM bitmap. These images are from - the family of PNM images. - - The PNM formats are a fairly simple image format. They share a plain text header, consisting of: - signature, width, height and max_pixel_value only. The pixels follow thereafter and can be in - plain text decimals separated by spaces, or binary encoded. - - - PBM - Black and white images, with 1 representing black and 0 representing white. - - - PGM - Grayscale images, scaling from 0 to max_pixel_value, 0 representing black and max_pixel_value representing white. - - - PPM - Color images, with RGB pixels (in that order), with 0 representing black and 2 representing full color. - - - - The specification of these images is found at . - - - - - Gets or sets the Encoding of the pixels. - - - - - Gets or sets the Color type of the resulting image. - - - - - Gets or sets the data type of the pixels components. - - - - - - - - - - - Image encoder for writing an image to a stream as a PGM, PBM, PPM or PAM bitmap. - - - - - The global configuration. - - - - - The encoder options. - - - - - The encoding for the pixels. - - - - - Gets the Color type of the resulting image. - - - - - Gets the maximum pixel value, per component. - - - - - Initializes a new instance of the class. - - The configuration. - The encoder options. - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to request cancellation. - - - - Writes the pixel data to the binary stream. - - The pixel format. - The to write to. - - The containing pixel data. - - - - - Provides enumeration of available PBM encodings. - - - - - Plain text decimal encoding. - - - - - Binary integer encoding. - - - - - Registers the image encoders, decoders and mime type detectors for the PBM format. - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - Detects Pbm file headers. - - - - - - - - - - - Provides PBM specific metadata information for the image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the encoding of the pixels. - - - - - Gets or sets the color type. - - - - - Gets or sets the data type of the pixel components. - - - - - - - - Pixel decoding methods for the PBM plain encoding. - - - - - Decode the specified pixels. - - The type of pixel to encode to. - The configuration. - The pixel array to encode into. - The stream to read the data from. - The ColorType to decode. - Data type of the pixles components. - - - - Pixel encoding methods for the PBM plain encoding. - - - - - Decode pixels into the PBM plain encoding. - - The type of input pixel. - The configuration. - The bytestream to write to. - The input image. - The ColorType to use. - Data type of the pixles components. - - - - Contains information about the pixels that make up an images visual data. - - - - - Initializes a new instance of the class. - - Color depth, in number of bits per pixel. - - - - Initializes a new instance of the class. - - Color depth, in number of bits per pixel. - The pixel alpha transparency behavior. - - - - Gets color depth, in number of bits per pixel. - - - - - Gets the pixel alpha transparency behavior. - means unknown, unspecified. - - - - - Constants and helper methods for the Adam7 interlacing algorithm. - - - - - The amount to increment when processing each column per scanline for each interlaced pass. - - - - - The index to start at when processing each column per scanline for each interlaced pass. - - - - - The index to start at when processing each row per scanline for each interlaced pass. - - - - - The amount to increment when processing each row per scanline for each interlaced pass. - - - - - Gets the width of the block. - - The width. - The pass. - - The - - - - - Gets the height of the block. - - The height. - The pass. - - The - - - - - Returns the correct number of columns for each interlaced pass. - - The line width. - The current pass index. - The - - - - The pHYs chunk specifies the intended pixel size or aspect ratio for display of the image. - - - - - Gets the number of pixels per unit on the X axis. - - - - - Gets the number of pixels per unit on the Y axis. - - - - - Gets the unit specifier. - 0: unit is unknown - 1: unit is the meter - When the unit specifier is 0, the pHYs chunk defines pixel aspect ratio only; the actual size of the pixels remains unspecified. - - - - - Parses the PhysicalChunkData from the given buffer. - - The data buffer. - The parsed PhysicalChunkData. - - - - Constructs the PngPhysicalChunkData from the provided metadata. - If the resolution units are not in meters, they are automatically converted. - - The metadata. - The constructed PngPhysicalChunkData instance. - - - - Writes the data to the given buffer. - - The buffer. - - - - The Average filter uses the average of the two neighboring pixels (left and above) to predict - the value of a pixel. - - - - - - Decodes a scanline, which was filtered with the average filter. - - The scanline to decode. - The previous scanline. - The bytes per pixel. - - - - Encodes a scanline with the average filter applied. - - The scanline to encode. - The previous scanline. - The filtered scanline result. - The bytes per pixel. - The sum of the total variance of the filtered row. - - - - Calculates the average value of two bytes - - The left byte - The above byte - The - - - - Provides enumeration of the various PNG filter types. - - - - - - With the None filter, the scanline is transmitted unmodified; it is only necessary to - insert a filter type byte before the data. - - - - - The Sub filter transmits the difference between each byte and the value of the corresponding - byte of the prior pixel. - - - - - The Up filter is just like the Sub filter except that the pixel immediately above the current - pixel, rather than just to its left, is used as the predictor. - - - - - The Average filter uses the average of the two neighboring pixels (left and above) to - predict the value of a pixel. - - - - - The Paeth filter computes a simple linear function of the three neighboring pixels (left, above, upper left), - then chooses as predictor the neighboring pixel closest to the computed value. - This technique is due to Alan W. Paeth - - - - - The None filter, the scanline is transmitted unmodified; it is only necessary to - insert a filter type byte before the data. - - - - - - Encodes the scanline - - The scanline to encode - The filtered scanline result. - - - - The Paeth filter computes a simple linear function of the three neighboring pixels (left, above, upper left), - then chooses as predictor the neighboring pixel closest to the computed value. - This technique is due to Alan W. Paeth. - - - - - - Decodes a scanline, which was filtered with the paeth filter. - - The scanline to decode. - The previous scanline. - The bytes per pixel. - - - - Encodes a scanline and applies the paeth filter. - - The scanline to encode - The previous scanline. - The filtered scanline result. - The bytes per pixel. - The sum of the total variance of the filtered row. - - - - Computes a simple linear function of the three neighboring pixels (left, above, upper left), then chooses - as predictor the neighboring pixel closest to the computed value. - - The left neighbor pixel. - The above neighbor pixel. - The upper left neighbor pixel. - - The . - - - - - The Sub filter transmits the difference between each byte and the value of the corresponding byte - of the prior pixel. - - - - - - Decodes a scanline, which was filtered with the sub filter. - - The scanline to decode. - The bytes per pixel. - - - - Encodes a scanline with the sup filter applied. - - The scanline to encode. - The filtered scanline result. - The bytes per pixel. - The sum of the total variance of the filtered row. - - - - The Up filter is just like the Sub filter except that the pixel immediately above the current pixel, - rather than just to its left, is used as the predictor. - - - - - - Decodes a scanline, which was filtered with the up filter. - - The scanline to decode - The previous scanline. - - - - Encodes a scanline with the up filter applied. - - The scanline to encode. - The previous scanline. - The filtered scanline result. - The sum of the total variance of the filtered row. - - - - The options for decoding png images - - - - - Gets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - The options available for manipulating the encoder pipeline. - - - - - Gets the number of bits per sample or per palette index (not per pixel). - Not all values are allowed for all values. - - - - - Gets the color type. - - - - - Gets the filter method. - - - - - Gets the compression level 1-9. - Defaults to . - - - - - Gets the threshold of characters in text metadata, when compression should be used. - - - - - Gets the gamma value, that will be written the image. - - The gamma value of the image. - - - - Gets the quantizer for reducing the color count. - - - - - Gets the transparency threshold. - - - - - Gets a value indicating whether this instance should write an Adam7 interlaced image. - - - - - Gets a value indicating whether the metadata should be ignored when the image is being encoded. - When set to true, all ancillary chunks will be skipped. - - - - - Gets the chunk filter method. This allows to filter ancillary chunks. - - - - - Gets a value indicating whether fully transparent pixels that may contain R, G, B values which are not 0, - should be converted to transparent black, which can yield in better compression in some cases. - - - - - Provides enumeration for the available PNG bit depths. - - - - - 1 bit per sample or per palette index (not per pixel). - - - - - 2 bits per sample or per palette index (not per pixel). - - - - - 4 bits per sample or per palette index (not per pixel). - - - - - 8 bits per sample or per palette index (not per pixel). - - - - - 16 bits per sample or per palette index (not per pixel). - - - - - Stores header information about a chunk. - - - - - Gets the length. - An unsigned integer giving the number of bytes in the chunk's - data field. The length counts only the data field, not itself, - the chunk type code, or the CRC. Zero is a valid length - - - - - Gets the chunk type. - The value is the equal to the UInt32BigEndian encoding of its 4 ASCII characters. - - - - - Gets the data bytes appropriate to the chunk type, if any. - This field can be of zero length or null. - - - - - Gets a value indicating whether the given chunk is critical to decoding - - - - - Provides enumeration of available PNG optimization methods. - - - - - With the None filter, all chunks will be written. - - - - - Excludes the physical dimension information chunk from encoding. - - - - - Excludes the gamma information chunk from encoding. - - - - - Excludes the eXIf chunk from encoding. - - - - - Excludes the tTXt, iTXt or zTXt chunk from encoding. - - - - - All ancillary chunks will be excluded. - - - - - Contains a list of chunk types. - - - - - The IDAT chunk contains the actual image data. The image can contains more - than one chunk of this type. All chunks together are the whole image. - - - - - This chunk must appear last. It marks the end of the PNG data stream. - The chunk's data field is empty. - - - - - The first chunk in a png file. Can only exists once. Contains - common information like the width and the height of the image or - the used compression method. - - - - - The PLTE chunk contains from 1 to 256 palette entries, each a three byte - series in the RGB format. - - - - - The eXIf data chunk which contains the Exif profile. - - - - - This chunk specifies the relationship between the image samples and the desired - display output intensity. - - - - - The pHYs chunk specifies the intended pixel size or aspect ratio for display of the image. - - - - - Textual information that the encoder wishes to record with the image can be stored in - tEXt chunks. Each tEXt chunk contains a keyword and a text string. - - - - - Textual information that the encoder wishes to record with the image. The zTXt and tEXt chunks are semantically equivalent, - but the zTXt chunk is recommended for storing large blocks of text. Each zTXt chunk contains a (uncompressed) keyword and - a compressed text string. - - - - - The iTXt chunk contains International textual data. It contains a keyword, an optional language tag, an optional translated keyword - and the actual text string, which can be compressed or uncompressed. - - - - - The tRNS chunk specifies that the image uses simple transparency: - either alpha values associated with palette entries (for indexed-color images) - or a single transparent color (for grayscale and true color images). - - - - - The tIME chunk gives the time of the last image modification (not the time of initial image creation). - - - - - The bKGD chunk specifies a default background colour to present the image against. - If there is any other preferred background, either user-specified or part of a larger page (as in a browser), - the bKGD chunk should be ignored. - - - - - The iCCP chunk contains a embedded color profile. If the iCCP chunk is present, - the image samples conform to the colour space represented by the embedded ICC profile as defined by the International Color Consortium. - - - - - The sBIT chunk defines the original number of significant bits (which can be less than or equal to the sample depth). - This allows PNG decoders to recover the original data losslessly even if the data had a sample depth not directly supported by PNG. - - - - - If the sRGB chunk is present, the image samples conform to the sRGB colour space [IEC 61966-2-1] and should be displayed - using the specified rendering intent defined by the International Color Consortium. - - - - - The hIST chunk gives the approximate usage frequency of each colour in the palette. - - - - - The sPLT chunk contains the suggested palette. - - - - - The cHRM chunk may be used to specify the 1931 CIE x,y chromaticities of the red, - green, and blue display primaries used in the image, and the referenced white point. - - - - - Malformed chunk named CgBI produced by apple, which is not conform to the specification. - Related issue is here https://github.com/SixLabors/ImageSharp/issues/410 - - - - - Provides enumeration of available PNG color types. - - - - - Each pixel is a grayscale sample. - - - - - Each pixel is an R,G,B triple. - - - - - Each pixel is a palette index; a PLTE chunk must appear. - - - - - Each pixel is a grayscale sample, followed by an alpha sample. - - - - - Each pixel is an R,G,B triple, followed by an alpha sample. - - - - - Provides enumeration of available PNG compression levels. - - - - - Level 0. Equivalent to . - - - - - No compression. Equivalent to . - - - - - Level 1. Equivalent to . - - - - - Best speed compression level. - - - - - Level 2. - - - - - Level 3. - - - - - Level 4. - - - - - Level 5. - - - - - Level 6. Equivalent to . - - - - - The default compression level. Equivalent to . - - - - - Level 7. - - - - - Level 8. - - - - - Level 9. Equivalent to . - - - - - Best compression level. Equivalent to . - - - - - Registers the image encoders, decoders and mime type detectors for the png format. - - - - - - - - Defines Png constants defined in the specification. - - - - - The character encoding to use when reading and writing textual data keywords and text - (Latin-1 ISO-8859-1). - - - - - The character encoding to use when reading and writing language tags within iTXt chunks - (ASCII 7bit). - - - - - The character encoding to use when reading and writing translated textual data keywords and text - (UTF8). - - - - - The list of mimetypes that equate to a Png. - - - - - The list of file extensions that equate to a Png. - - - - - The header bytes as a big-endian coded ulong. - - - - - The dictionary of available color types. - - - - - The maximum length of keyword in a text chunk is 79 bytes. - - - - - The minimum length of a keyword in a text chunk is 1 byte. - - - - - Gets the header bytes identifying a Png. - - - - - Gets the keyword of the XMP metadata, encoded in an iTXT chunk. - - - - - Decoder for generating an image out of a png encoded stream. - - - - - - - - - - - - - - - - - Performs the png decoding operation. - - - - - Reusable buffer. - - - - - Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets or sets a value indicating whether to read the IHDR and tRNS chunks only. - - - - - Used the manage memory allocations. - - - - - The stream to decode from. - - - - - The png header. - - - - - The number of bytes per pixel. - - - - - The number of bytes per sample. - - - - - The number of bytes per scanline. - - - - - The palette containing color information for indexed png's. - - - - - The palette containing alpha channel color information for indexed png's. - - - - - Previous scanline processed. - - - - - The current scanline that is being processed. - - - - - The index of the current scanline being processed. - - - - - The current number of bytes read in the current scanline. - - - - - Gets or sets the png color type. - - - - - The next chunk of data to return. - - - - - Initializes a new instance of the class. - - The configuration. - The decoder options. - - - - - - - Gets the dimensions of the image. - - - - - - - - - - - Reads the least significant bits from the byte pair with the others set to 0. - - The source buffer - THe offset - The - - - - Attempts to convert a byte array to a new array where each value in the original array is represented by the - specified number of bits. - - The bytes to convert from. Cannot be empty. - The number of bytes per scanline - The number of bits per value. - The new array. - The resulting array. - - - - Reads the data chunk containing physical dimension data. - - The metadata to read to. - The data containing physical data. - - - - Reads the data chunk containing gamma data. - - The metadata to read to. - The data containing physical data. - - - - Initializes the image and various buffers needed for processing - - The type the pixels will be - The metadata information for the image - The image that we will populate - - - - Calculates the correct number of bits per pixel for the given color type. - - The - - - - Calculates the correct number of bytes per pixel for the given color type. - - The - - - - Calculates the scanline length. - - The width of the row. - - The representing the length. - - - - - Reads the scanlines within the image. - - The pixel format. - The png chunk containing the compressed scanline data. - The pixel data. - The png metadata - - - - Decodes the raw pixel data row by row - - The pixel format. - The compressed pixel data stream. - The image to decode to. - The png metadata - - - - Decodes the raw interlaced pixel data row by row - - - The pixel format. - The compressed pixel data stream. - The current image. - The png metadata. - - - - Processes the de-filtered scanline filling the image pixel data - - The pixel format. - The de-filtered scanline - The image - The png metadata. - - - - Processes the interlaced de-filtered scanline filling the image pixel data - - The pixel format. - The de-filtered scanline - The current image row. - The png metadata. - The column start index. Always 0 for none interlaced images. - The column increment. Always 1 for none interlaced images. - - - - Decodes and assigns marker colors that identify transparent pixels in non indexed images. - - The alpha tRNS array. - The png metadata. - - - - Reads a header chunk from the data. - - The png metadata. - The containing data. - - - - Reads a text chunk containing image properties from the data. - - The object. - The metadata to decode to. - The containing the data. - - - - Reads the compressed text chunk. Contains a uncompressed keyword and a compressed text string. - - The object. - The metadata to decode to. - The containing the data. - - - - Checks if the given text chunk is actually storing parsable metadata. - - The object to store the parsed metadata in. - The name of the text chunk. - The contents of the text chunk. - True if metadata was successfully parsed from the text chunk. False if the - text chunk was not identified as metadata, and should be stored in the metadata - object unmodified. - - - - Reads exif data encoded into a text chunk with the name "raw profile type exif". - This method was used by ImageMagick, exiftool, exiv2, digiKam, etc, before the - 2017 update to png that allowed a true exif chunk. - - The to store the decoded exif tags into. - The contents of the "raw profile type exif" text chunk. - - - - Compares two ReadOnlySpan<char>s in a case-insensitive method. - This is only needed because older frameworks are missing the extension method. - - The first to compare. - The second to compare. - True if the spans were identical, false otherwise. - - - - int.Parse() a ReadOnlySpan<char>, with a fallback for older frameworks. - - The to parse. - The parsed . - - - - Sets the in to , - or copies exif tags if already contains an . - - The to store the exif data in. - The to copy exif tags from. - If already contains an , - controls whether existing exif tags in will be overwritten with any conflicting - tags from . - - - - Reads a iTXt chunk, which contains international text data. It contains: - - A uncompressed keyword. - - Compression flag, indicating if a compression is used. - - Compression method. - - Language tag (optional). - - A translated keyword (optional). - - Text data, which is either compressed or uncompressed. - - The metadata to decode to. - The containing the data. - - - - Decompresses a byte array with zlib compressed text data. - - Compressed text data bytes. - The string encoding to use. - The uncompressed value. - The . - - - - Reads the next data chunk. - - Count of bytes in the next data chunk, or 0 if there are no more data chunks left. - - - - Reads a chunk from the stream. - - The image format chunk. - - The . - - - - - Validates the png chunk. - - The . - - - - Reads the cycle redundancy chunk from the data. - - - - - Skips the chunk data and the cycle redundancy chunk read from the data. - - The image format chunk. - - - - Reads the chunk data from the stream. - - The length of the chunk data to read. - - - - Identifies the chunk type from the chunk. - - - Thrown if the input stream is not valid. - - - - - Attempts to read the length of the next chunk. - - - Whether the length was read. - - - - - Tries to reads a text chunk keyword, which have some restrictions to be valid: - Keywords shall contain only printable Latin-1 characters and should not have leading or trailing whitespace. - See: https://www.w3.org/TR/PNG/#11zTXt - - The keyword bytes. - The name. - True, if the keyword could be read and is valid. - - - - Image encoder for writing image data to a stream in png format. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to monitor for cancellation requests. - A representing the asynchronous operation. - - - - Performs the png encoding operation. - - - - - The maximum block size, defaults at 64k for uncompressed blocks. - - - - - Used the manage memory allocations. - - - - - The configuration instance for the decoding operation. - - - - - Reusable buffer for writing general data. - - - - - Reusable buffer for writing chunk data. - - - - - The encoder options - - - - - The bit depth. - - - - - Gets or sets a value indicating whether to use 16 bit encoding for supported color types. - - - - - The number of bytes per pixel. - - - - - The image width. - - - - - The image height. - - - - - The raw data of previous scanline. - - - - - The raw data of current scanline. - - - - - Initializes a new instance of the class. - - The to use for buffer allocations. - The configuration. - The options for influencing the encoder - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to request cancellation. - - - - - - - Convert transparent pixels, to transparent black pixels, which can yield to better compression in some cases. - - The type of the pixel. - The cloned image where the transparent pixels will be changed. - - - - Creates the quantized image and sets calculates and sets the bit depth. - - The type of the pixel. - The image to quantize. - Cloned image with transparent pixels are changed to black. - The quantized image. - - - Collects a row of grayscale pixels. - The pixel format. - The image row span. - - - - Collects a row of true color pixel data. - - The pixel format. - The row span. - - - - Encodes the pixel data line by line. - Each scanline is encoded in the most optimal manner to improve compression. - - The pixel format. - The row span. - The quantized pixels. Can be null. - The row. - - - - Apply the line filter for the raw scanline to enable better compression. - - - - - Collects the pixel data line by line for compressing. - Each scanline is filtered in the most optimal manner to improve compression. - - The pixel format. - The row span. - The filtered buffer. - Used for attempting optimized filtering. - The quantized pixels. Can be . - The row number. - - - - Encodes the indexed pixel data (with palette) for Adam7 interlaced mode. - - The row span. - The filtered buffer. - Used for attempting optimized filtering. - - - - Applies all PNG filters to the given scanline and returns the filtered scanline that is deemed - to be most compressible, using lowest total variation as proxy for compressibility. - - - - - Writes the header chunk to the stream. - - The containing image data. - - - - Writes the palette chunk to the stream. - Should be written before the first IDAT chunk. - - The pixel format. - The containing image data. - The quantized frame. - - - - Writes the physical dimension information to the stream. - Should be written before IDAT chunk. - - The containing image data. - The image metadata. - - - - Writes the eXIf chunk to the stream, if any EXIF Profile values are present in the metadata. - - The containing image data. - The image metadata. - - - - Writes an iTXT chunk, containing the XMP metdata to the stream, if such profile is present in the metadata. - - The containing image data. - The image metadata. - - - - Writes a text chunk to the stream. Can be either a tTXt, iTXt or zTXt chunk, - depending whether the text contains any latin characters or should be compressed. - - The containing image data. - The image metadata. - - - - Compresses a given text using Zlib compression. - - The text bytes to compress. - The compressed text byte array. - - - - Writes the gamma information to the stream. - Should be written before PLTE and IDAT chunk. - - The containing image data. - - - - Writes the transparency chunk to the stream. - Should be written after PLTE and before IDAT. - - The containing image data. - The image metadata. - - - - Writes the pixel information to the stream. - - The pixel format. - The image. - The quantized pixel data. Can be null. - The stream. - - - - Allocates the buffers for each scanline. - - The bytes per scanline. - - - - Encodes the pixels. - - The type of the pixel. - The pixels. - The quantized pixels span. - The deflate stream. - - - - Interlaced encoding the pixels. - - The type of the pixel. - The image. - The deflate stream. - - - - Interlaced encoding the quantized (indexed, with palette) pixels. - - The type of the pixel. - The quantized. - The deflate stream. - - - - Writes the chunk end to the stream. - - The containing image data. - - - - Writes a chunk to the stream. - - The to write to. - The type of chunk to write. - The containing data. - - - - Writes a chunk of a specified length to the stream at the given offset. - - The to write to. - The type of chunk to write. - The containing data. - The position to offset the data at. - The of the data to write. - - - - Calculates the scanline length. - - The width of the row. - - The representing the length. - - - - - The helper methods for class. - - - - - Packs the given 8 bit array into and array of depths. - - The source span in 8 bits. - The resultant span in . - The bit depth. - The scaling factor. - - - - The options structure for the . - - - - - Initializes a new instance of the class. - - The source. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The helper methods for the PNG encoder options. - - - - - Adjusts the options based upon the given metadata. - - The options. - The PNG metadata. - if set to true [use16 bit]. - The bytes per pixel. - - - - Creates the quantized frame. - - The type of the pixel. - The options. - The image. - - - - Calculates the bit depth value. - - The type of the pixel. - The options. - The quantized frame. - - - - Calculates the correct number of bytes per pixel for the given color type. - - Bytes per pixel. - - - - Returns a suggested for the given - This is not exhaustive but covers many common pixel formats. - - - - - Returns a suggested for the given - This is not exhaustive but covers many common pixel formats. - - - - - Provides enumeration of available PNG filter methods. - - - - - With the None filter, the scanline is transmitted unmodified. - - - - - The Sub filter transmits the difference between each byte and the value of the corresponding - byte of the prior pixel. - - - - - The Up filter is just like the filter except that the pixel immediately above the current pixel, - rather than just to its left, is used as the predictor. - - - - - The Average filter uses the average of the two neighboring pixels (left and above) to predict the value of a pixel. - - - - - The Paeth filter computes a simple linear function of the three neighboring pixels (left, above, upper left), - then chooses as predictor the neighboring pixel closest to the computed value. - - - - - Computes the output scanline using all five filters, and selects the filter that gives the smallest sum of - absolute values of outputs. - This method usually outperforms any single fixed filter choice. - - - - - Registers the image encoders, decoders and mime type detectors for the png format. - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - Represents the png header chunk. - - - - - Gets the dimension in x-direction of the image in pixels. - - - - - Gets the dimension in y-direction of the image in pixels. - - - - - Gets the bit depth. - Bit depth is a single-byte integer giving the number of bits per sample - or per palette index (not per pixel). Valid values are 1, 2, 4, 8, and 16, - although not all values are allowed for all color types. - - - - - Gets the color type. - Color type is a integer that describes the interpretation of the - image data. Color type codes represent sums of the following values: - 1 (palette used), 2 (color used), and 4 (alpha channel used). - - - - - Gets the compression method. - Indicates the method used to compress the image data. At present, - only compression method 0 (deflate/inflate compression with a sliding - window of at most 32768 bytes) is defined. - - - - - Gets the preprocessing method. - Indicates the preprocessing method applied to the image - data before compression. At present, only filter method 0 - (adaptive filtering with five basic filter types) is defined. - - - - - Gets the transmission order. - Indicates the transmission order of the image data. - Two values are currently defined: 0 (no interlace) or 1 (Adam7 interlace). - - - - - Validates the png header. - - - Thrown if the image does pass validation. - - - - - Writes the header to the given buffer. - - The buffer to write to. - - - - Parses the PngHeader from the given data buffer. - - The data to parse. - The parsed PngHeader. - - - - Detects png file headers - - - - - - - - - - - Provides enumeration of available PNG interlace modes. - - - - - Non interlaced - - - - - Adam 7 interlacing. - - - - - Provides Png specific metadata information for the image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the number of bits per sample or per palette index (not per pixel). - Not all values are allowed for all values. - - - - - Gets or sets the color type. - - - - - Gets or sets a value indicating whether this instance should write an Adam7 interlaced image. - - - - - Gets or sets the gamma value for the image. - - - - - Gets or sets the Rgb24 transparent color. - This represents any color in an 8 bit Rgb24 encoded png that should be transparent. - - - - - Gets or sets the Rgb48 transparent color. - This represents any color in a 16 bit Rgb24 encoded png that should be transparent. - - - - - Gets or sets the 8 bit grayscale transparent color. - This represents any color in an 8 bit grayscale encoded png that should be transparent. - - - - - Gets or sets the 16 bit grayscale transparent color. - This represents any color in a 16 bit grayscale encoded png that should be transparent. - - - - - Gets or sets a value indicating whether the image contains a transparency chunk and markers were decoded. - - - - - Gets or sets the collection of text data stored within the iTXt, tEXt, and zTXt chunks. - Used for conveying textual information associated with the image. - - - - - - - - Provides methods to allow the decoding of raw scanlines to image rows of different pixel formats. - TODO: We should make this a stateful class or struct to reduce the number of arguments on methods (most are invariant). - - - - - Stores text data contained in the iTXt, tEXt, and zTXt chunks. - Used for conveying textual information associated with the image, like the name of the author, - the copyright information, the date, where the image was created, or some other information. - - - - - Initializes a new instance of the struct. - - The keyword of the property. - The value of the property. - An optional language tag. - A optional translated keyword. - - - - Gets the keyword of this which indicates - the type of information represented by the text string as described in https://www.w3.org/TR/PNG/#11keywords. - - - Typical properties are the author, copyright information or other meta information. - - - - - Gets the value of this . - - - - - Gets an optional language tag defined in https://www.w3.org/TR/PNG/#2-RFC-3066 indicates the human language used by the translated keyword and the text. - If the first word is two or three letters long, it is an ISO language code https://www.w3.org/TR/PNG/#2-ISO-639. - - - Examples: cn, en-uk, no-bok, x-klingon, x-KlInGoN. - - - - - Gets an optional translated keyword, should contain a translation of the keyword into the language indicated by the language tag. - - - - - Compares two objects. The result specifies whether the values - of the properties of the two objects are equal. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects. The result specifies whether the values - of the properties of the two objects are unequal. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Indicates whether this instance and a specified object are equal. - - - The object to compare with the current instance. - - - true if and this instance are the same type and represent the - same value; otherwise, false. - - - - - Returns the hash code for this instance. - - - A 32-bit signed integer that is the hash code for this instance. - - - - - Returns the fully qualified type name of this instance. - - - A containing a fully qualified type name. - - - - - Indicates whether the current object is equal to another object of the same type. - - - True if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Cold path optimizations for throwing png format based exceptions. - - - - - Enum indicating how the transparency should be handled on encoding. - - - - - The transparency will be kept as is. - - - - - Converts fully transparent pixels that may contain R, G, B values which are not 0, - to transparent black, which can yield in better compression in some cases. - - - - - The options for decoding tga images. Currently empty, but this may change in the future. - - - - - Configuration options for use during tga encoding. - - - - - Gets the number of bits per pixel. - - - - - Gets a value indicating whether run length compression should be used. - - - - - Enumerates the available bits per pixel the tga encoder supports. - - - - - 8 bits per pixel. Each pixel consists of 1 byte. - - - - - 16 bits per pixel. Each pixel consists of 2 bytes. - - - - - 24 bits per pixel. Each pixel consists of 3 bytes. - - - - - 32 bits per pixel. Each pixel consists of 4 bytes. - - - - - Indicates if compression is used. - - - - - No compression is used. - - - - - Run length encoding is used. - - - - - Registers the image encoders, decoders and mime type detectors for the tga format. - - - - - - - - The list of mimetypes that equate to a targa file. - - - - - The list of file extensions that equate to a targa file. - - - - - The file header length of a tga image in bytes. - - - - - Image decoder for Truevision TGA images. - - - - - - - - - - - - - - Performs the tga decoding operation. - - - - - A scratch buffer to reduce allocations. - - - - - The metadata. - - - - - The tga specific metadata. - - - - - The file header containing general information about the image. - - - - - Used for allocating memory during processing operations. - - - - - The stream to decode from. - - - - - The bitmap decoder options. - - - - - Indicates whether there is a alpha channel present. - - - - - Initializes a new instance of the class. - - The configuration. - The options. - - - - - - - Gets the dimensions of the image. - - - - - - - - Reads a uncompressed TGA image with a palette. - - The pixel type. - The width of the image. - The height of the image. - The to assign the palette to. - The color palette. - Color map size of one entry in bytes. - The image origin. - - - - Reads a run length encoded TGA image with a palette. - - The pixel type. - The width of the image. - The height of the image. - The to assign the palette to. - The color palette. - Color map size of one entry in bytes. - The image origin. - - - - Reads a uncompressed monochrome TGA image. - - The pixel type. - The width of the image. - The height of the image. - The to assign the palette to. - the image origin. - - - - Reads a uncompressed TGA image where each pixels has 16 bit. - - The pixel type. - The width of the image. - The height of the image. - The to assign the palette to. - The image origin. - - - - Reads a uncompressed TGA image where each pixels has 24 bit. - - The pixel type. - The width of the image. - The height of the image. - The to assign the palette to. - The image origin. - - - - Reads a uncompressed TGA image where each pixels has 32 bit. - - The pixel type. - The width of the image. - The height of the image. - The to assign the palette to. - The image origin. - - - - Reads a run length encoded TGA image. - - The pixel type. - The width of the image. - The height of the image. - The to assign the palette to. - The bytes per pixel. - The image origin. - - - - - - - Produce uncompressed tga data from a run length encoded stream. - - The width of the image. - The height of the image. - Buffer for uncompressed data. - The bytes used per pixel. - - - - Returns the y- value based on the given height. - - The y- value representing the current row. - The height of the image. - The image origin. - The representing the inverted value. - - - - Indicates whether the y coordinates needs to be inverted, to keep a top left origin. - - The image origin. - True, if y coordinate needs to be inverted. - - - - Returns the x- value based on the given width. - - The x- value representing the current column. - The width of the image. - The image origin. - The representing the inverted value. - - - - Indicates whether the x coordinates needs to be inverted, to keep a top left origin. - - The image origin. - True, if x coordinate needs to be inverted. - - - - Reads the tga file header from the stream. - - The containing image data. - The image origin. - - - - Image encoder for writing an image to a stream as a targa truevision image. - - - - - Gets or sets the number of bits per pixel. - - - - - Gets or sets a value indicating whether no compression or run length compression should be used. - - - - - - - - - - - Image encoder for writing an image to a stream as a truevision targa image. - - - - - Used for allocating memory during processing operations. - - - - - The global configuration. - - - - - Reusable buffer for writing data. - - - - - The color depth, in number of bits per pixel. - - - - - Indicates if run length compression should be used. - - - - - Initializes a new instance of the class. - - The encoder options. - The memory manager. - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to request cancellation. - - - - Writes the pixel data to the binary stream. - - The pixel format. - The to write to. - - The containing pixel data. - - - - - Writes a run length encoded tga image to the stream. - - The pixel type. - The stream to write the image to. - The image to encode. - - - - Finds consecutive pixels which have the same value. - - The pixel type. - The pixels of the image. - X coordinate to start searching for the same pixels. - Y coordinate to start searching for the same pixels. - The number of equal pixels. - - - - Writes the 8bit pixels uncompressed to the stream. - - The pixel format. - The to write to. - The containing pixel data. - - - - Writes the 16bit pixels uncompressed to the stream. - - The pixel format. - The to write to. - The containing pixel data. - - - - Writes the 24bit pixels uncompressed to the stream. - - The pixel format. - The to write to. - The containing pixel data. - - - - Writes the 32bit pixels uncompressed to the stream. - - The pixel format. - The to write to. - The containing pixel data. - - - - Convert the pixel values to grayscale using ITU-R Recommendation BT.709. - - The pixel to get the luminance from. - - - - This block of bytes tells the application detailed information about the targa image. - - - - - - Defines the size of the data structure in the targa file. - - - - - Gets the id length. - This field identifies the number of bytes contained in Field 6, the Image ID Field. The maximum number - of characters is 255. A value of zero indicates that no Image ID field is included with the image. - - - - - Gets the color map type. - This field indicates the type of color map (if any) included with the image. There are currently 2 defined - values for this field: - 0 - indicates that no color-map data is included with this image. - 1 - indicates that a color-map is included with this image. - - - - - Gets the image type. - The TGA File Format can be used to store Pseudo-Color, True-Color and Direct-Color images of various - pixel depths. - - - - - Gets the start of the color map. - This field and its sub-fields describe the color map (if any) used for the image. If the Color Map Type field - is set to zero, indicating that no color map exists, then these 5 bytes should be set to zero. - - - - - Gets the total number of color map entries included. - - - - - Gets the number of bits per entry. Typically 15, 16, 24 or 32-bit values are used. - - - - - Gets the XOffset. - These bytes specify the absolute horizontal coordinate for the lower left - corner of the image as it is positioned on a display device having an - origin at the lower left of the screen. - - - - - Gets the YOffset. - These bytes specify the absolute vertical coordinate for the lower left - corner of the image as it is positioned on a display device having an - origin at the lower left of the screen. - - - - - Gets the width of the image in pixels. - - - - - Gets the height of the image in pixels. - - - - - Gets the number of bits per pixel. This number includes - the Attribute or Alpha channel bits. Common values are 8, 16, 24 and - 32 but other pixel depths could be used. - - - - - Gets the ImageDescriptor. - ImageDescriptor contains two pieces of information. - Bits 0 through 3 contain the number of attribute bits per pixel. - Attribute bits are found only in pixels for the 16- and 32-bit flavors of the TGA format and are called alpha channel, - overlay, or interrupt bits. Bits 4 and 5 contain the image origin location (coordinate 0,0) of the image. - This position may be any of the four corners of the display screen. - When both of these bits are set to zero, the image origin is the lower-left corner of the screen. - Bits 6 and 7 of the ImageDescriptor field are unused and should be set to 0. - - - - - Registers the image encoders, decoders and mime type detectors for the tga format. - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - Detects tga file headers. - - - - - - - - - - - Bottom left origin. - - - - - Bottom right origin. - - - - - Top left origin. - - - - - Top right origin. - - - - - Defines the tga image type. The TGA File Format can be used to store Pseudo-Color, - True-Color and Direct-Color images of various pixel depths. - - - - - No image data included. - - - - - Uncompressed, color mapped image. - - - - - Uncompressed true color image. - - - - - Uncompressed Black and white (grayscale) image. - - - - - Run length encoded, color mapped image. - - - - - Run length encoded, true color image. - - - - - Run length encoded, black and white (grayscale) image. - - - - - Extension methods for TgaImageType enum. - - - - - Checks if this tga image type is run length encoded. - - The tga image type. - True, if this image type is run length encoded, otherwise false. - - - - Checks, if the image type has valid value. - - The image type. - true, if its a valid tga image type. - - - - Provides TGA specific metadata information for the image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the number of bits per pixel. - - - - - Gets or sets the the number of alpha bits per pixel. - - - - - - - - Cold path optimization for throwing 's - - The error message for the exception. - - - - Cold path optimization for throwing 's - - The error message for the exception. - The exception that is the cause of the current exception, or a null reference - if no inner exception is specified. - - - - Cold path optimization for throwing 's - - The error message for the exception. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pack Bits compression for tiff images. See Tiff Spec v6, section 9. - - - - - Bitwriter for writing compressed CCITT T4 1D data. - - - - - The modified huffman is basically the same as CCITT T4, but without EOL markers and padding at the end of the rows. - - - - - Initializes a new instance of the class. - - The output stream to write the compressed data. - The memory allocator. - The width of the image. - The bits per pixel. - Indicates if the modified huffman RLE should be used. - - - - - - - Writes a image compressed with CCITT T4 to the output buffer. - - The pixels as 8-bit gray array. - The strip height. - The destination for the compressed data. - - - - Bitwriter for writing compressed CCITT T6 2D data. - - - - - Vertical codes from -3 to +3. - - - - - Initializes a new instance of the class. - - The output stream to write the compressed data. - The memory allocator. - The width of the image. - The bits per pixel. - - - - - - - Writes a image compressed with CCITT T6 to the output buffer. - - The pixels as 8-bit gray array. - The strip height. - The destination for the compressed data. - - - - - - - Finds the end of a pixel run. - - The row of pixels to examine. - The index of the first pixel in to examine. - Color of pixels in the run. If not specified, the color at - will be used. - The index of the first pixel at or after - that does not match , or the length of , - whichever comes first. - - - - - - - Writes a run to the output buffer. - - The length of the run. - If true the run is white pixels, - if false the run is black pixels. - The destination to write the run to. - - - - Common functionality for CCITT T4 and T6 Compression - - - - - Initializes a new instance of the class. - - The output. - The allocator. - The width. - The bits per pixel. - - - - Gets the best makeup run length for a given run length - - A run length needing a makeup code - The makeup length for . - - - - Gets the terminating code for a run length. - - The run length to get the terminating code for. - The length of the terminating code. - If true, the run is of white pixels. - If false the run is of black pixels - The terminating code for a run of length - - - - Gets the makeup code for a run length. - - The run length to get the makeup code for. - The length of the makeup code. - If true, the run is of white pixels. - If false the run is of black pixels - The makeup code for a run of length - - - - Pads output to the next byte - - - If the output is not currently on a byte boundary, - zero-pad it to the next byte - - - - - Writes a code to the output. - - The length of the code to write. - The code to be written. - The destination buffer to write the code to. - - - - Writes a image compressed with CCITT T6 to the stream. - - The pixels as 8-bit gray array. - The strip height. - - - - Compress a data strip - - The pixels as 8-bit gray array. - The strip height. - The destination for the compressed data. - - - - - - - - - - - - - - - - - - - - - - Encodes and compresses the image data using dynamic Lempel-Ziv compression. - - - - This code is based on the used for GIF encoding. There is potential - for a shared implementation. Differences between the GIF and TIFF implementations of the LZW - encoding are: (i) The GIF implementation includes an initial 'data size' byte, whilst this is - always 8 for TIFF. (ii) The GIF implementation writes a number of sub-blocks with an initial - byte indicating the length of the sub-block. In TIFF the data is written as a single block - with no length indicator (this can be determined from the 'StripByteCounts' entry). - - - - - - Initializes a new instance of the class. - - The memory allocator. - - - - Encodes and compresses the indexed pixels to the stream. - - The data to compress. - The stream to write to. - - - - - - - Represents a reference scan line for CCITT 2D decoding. - - - - - Initializes a new instance of the struct. - - Indicates, if white is zero, otherwise black is zero. - The scan line. - - - - Initializes a new instance of the struct. - - Indicates, if white is zero, otherwise black is zero. - The width of the scanline. - - - - Finds b1: The first changing element on the reference line to the right of a0 and of opposite color to a0. - - The reference or starting element om the coding line. - Fill byte. - Position of b1. - - - - Finds b2: The next changing element to the right of b1 on the reference line. - - The first changing element on the reference line to the right of a0 and opposite of color to a0. - Position of b1. - - - - Initializes a new instance of the struct. - - The type. - The bits required. - The extension bits. - - - - Gets the code type. - - - - - Enum for the different two dimensional code words for the ccitt fax compression. - - - - - No valid code word was read. - - - - - Pass mode: This mode is identified when the position of b2 lies to the left of a1. - - - - - Indicates horizontal mode. - - - - - Vertical 0 code word: relative distance between a1 and b1 is 0. - - - - - Vertical r1 code word: relative distance between a1 and b1 is 1, a1 is to the right of b1. - - - - - Vertical r2 code word: relative distance between a1 and b1 is 2, a1 is to the right of b1. - - - - - Vertical r3 code word: relative distance between a1 and b1 is 3, a1 is to the right of b1. - - - - - Vertical l1 code word: relative distance between a1 and b1 is 1, a1 is to the left of b1. - - - - - Vertical l2 code word: relative distance between a1 and b1 is 2, a1 is to the left of b1. - - - - - Vertical l3 code word: relative distance between a1 and b1 is 3, a1 is to the left of b1. - - - - - 1d extensions code word, extension code is used to indicate the change from the current mode to another mode, e.g., another coding scheme. - Not supported. - - - - - 2d extensions code word, extension code is used to indicate the change from the current mode to another mode, e.g., another coding scheme. - Not supported. - - - - - Class to handle cases where TIFF image data is compressed using Deflate compression. - - - Note that the 'OldDeflate' compression type is identical to the 'Deflate' compression type. - - - - - Initializes a new instance of the class. - - The memoryAllocator to use for buffer allocations. - The image width. - The bits used per pixel. - The color type of the pixel data. - The tiff predictor used. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - - - - Spectral converter for gray TIFF's which use the JPEG compression. - - The type of the pixel. - - - - Initializes a new instance of the class. - - The configuration. - - - - - - - Class to handle cases where TIFF image data is compressed as a jpeg stream. - - - - - Initializes a new instance of the class. - - The configuration. - The memoryAllocator to use for buffer allocations. - The image width. - The bits per pixel. - The JPEG tables containing the quantization and/or Huffman tables. - The photometric interpretation. - - - - - - - - - - Represents a lzw string with a code word and a code length. - - - - - Initializes a new instance of the class. - - The code word. - - - - Gets the code length; - - - - - Gets the first character of the codeword. - - - - - Concatenates two code words. - - The code word to concatenate. - A concatenated lzw string. - - - - Writes decoded pixel to buffer at a given position. - - The buffer to write to. - The position to write to. - The number of bytes written. - - - - Class to handle cases where TIFF image data is compressed using LZW compression. - - - - - Initializes a new instance of the class. - - The memoryAllocator to use for buffer allocations. - The image width. - The bits used per pixel. - The color type of the pixel data. - The tiff predictor used. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - - - - Bit reader for data encoded with the modified huffman rle method. - See TIFF 6.0 specification, section 10. - - - - - Initializes a new instance of the class. - - The compressed input stream. - The logical order of bits within a byte. - The number of bytes to read from the stream. - The memory allocator. - - - - - - - - - - - - - No EOL is expected at the start of a run for the modified huffman encoding. - - - - - Class to handle cases where TIFF image data is compressed using Modified Huffman Compression. - - - - - Initializes a new instance of the class. - - The memory allocator. - The logical order of bits within a byte. - The image width. - The number of bits per pixel. - The photometric interpretation. - - - - Gets the logical order of bits within a byte. - - - - - - - - - - - Class to handle cases where TIFF image data is not compressed. - - - - - Initializes a new instance of the class. - - The memory allocator. - The width of the image. - The bits per pixel. - - - - - - - - - - Class to handle cases where TIFF image data is compressed using PackBits compression. - - - - - Initializes a new instance of the class. - - The memoryAllocator to use for buffer allocations. - The width of the image. - The number of bits per pixel. - - - - - - - - - - Spectral converter for YCbCr TIFF's which use the JPEG compression. - The jpeg data should be always treated as RGB color space. - - The type of the pixel. - - - - Initializes a new instance of the class. - This Spectral converter will always convert the pixel data to RGB color. - - The configuration. - - - - - - - Bitreader for reading compressed CCITT T4 1D data. - - - - - The logical order of bits within a byte. - - - - - Indicates whether its the first line of data which is read from the image. - - - - - Indicates whether we have found a termination code which signals the end of a run. - - - - - We keep track if its the start of the row, because each run is expected to start with a white run. - If the image row itself starts with black, a white run of zero is expected. - - - - - Indicates, if fill bits have been added as necessary before EOL codes such that EOL always ends on a byte boundary. Defaults to false. - - - - - The minimum code length in bits. - - - - - The maximum code length in bits. - - - - - Initializes a new instance of the class. - - The compressed input stream. - The logical order of bits within a byte. - The number of bytes to read from the stream. - The memory allocator. - Indicates, if fill bits have been added as necessary before EOL codes such that EOL always ends on a byte boundary. Defaults to false. - - - - Gets the current value. - - - - - Gets the number of bits read for the current run value. - - - - - Gets the number of bits read. - - - - - Gets the available data in bytes. - - - - - Gets or sets the byte position in the buffer. - - - - - Gets the compressed image data. - - - - - Gets a value indicating whether there is more data to read left. - - - - - Gets or sets a value indicating whether the current run is a white pixel run, otherwise its a black pixel run. - - - - - Gets the number of pixels in the current run. - - - - - Gets a value indicating whether the end of a pixel row has been reached. - - - - - Read the next run of pixels. - - - - - Initialization for a new row. - - - - - - - - An EOL is expected before the first data. - - - - - Resets the current value read and the number of bits read. - - if set to true resets also the run length. - - - - Resets the bits read to 0. - - - - - Reads the next value. - - The number of bits to read. - The value read. - - - - Class to handle cases where TIFF image data is compressed using CCITT T4 compression. - - - - - Initializes a new instance of the class. - - The memory allocator. - The logical order of bits within a byte. - The image width. - The number of bits per pixel. - Fax compression options. - The photometric interpretation. - - - - Gets the logical order of bits within a byte. - - - - - - - - - - - Bit reader for reading CCITT T6 compressed fax data. - See: Facsimile Coding Schemes and Coding Control Functions for Group 4 Facsimile Apparatus, itu-t recommendation t.6 - - - - - Initializes a new instance of the class. - - The compressed input stream. - The logical order of bits within a byte. - The number of bytes to read from the stream. - The memory allocator. - - - - - - - Gets or sets the two dimensional code. - - - - - No EOL is expected at the start of a run. - - - - - Swaps the white run to black run an vise versa. - - - - - Class to handle cases where TIFF image data is compressed using CCITT T6 compression. - - - - - Initializes a new instance of the class. - - The memory allocator. - The logical order of bits within a byte. - The image width. - The number of bits per pixel. - The photometric interpretation. - - - - Gets the logical order of bits within a byte. - - - - - - - - - - - Decompresses and decodes data using the dynamic LZW algorithms, see TIFF spec Section 13. - - - - - The stream to decode. - - - - - As soon as we use entry 4094 of the table (maxTableSize - 2), the lzw compressor write out a (12-bit) ClearCode. - At this point, the compressor reinitializes the string table and then writes out 9-bit codes again. - - - - - End of Information. - - - - - Minimum code length of 9 bits. - - - - - Maximum code length of 12 bits. - - - - - Maximum table size of 4096. - - - - - Initializes a new instance of the class - and sets the stream, where the compressed data should be read from. - - The stream to read from. - is null. - - - - Decodes and decompresses all pixel indices from the stream. - - The pixel array to decode to. - - - - Fax compression options, see TIFF spec page 51f (T4Options). - - - - - No options. - - - - - If set, 2-dimensional coding is used (otherwise 1-dimensional is assumed). - - - - - If set, uncompressed mode is used. - - - - - If set, fill bits have been added as necessary before EOL codes such that - EOL always ends on a byte boundary, thus ensuring an EOL-sequence of 1 byte - preceded by a zero nibble: xxxx-0000 0000-0001. - - - - - Methods for undoing the horizontal prediction used in combination with deflate and LZW compressed TIFF images. - - - - - Inverts the horizontal prediction. - - Buffer with decompressed pixel data. - The width of the image or strip. - The color type of the pixel data. - If set to true decodes the pixel data as big endian, otherwise as little endian. - - - - Applies a horizontal predictor to the rgb row. - Make use of the fact that many continuous-tone images rarely vary much in pixel value from one pixel to the next. - In such images, if we replace the pixel values by differences between consecutive pixels, many of the differences should be 0, plus - or minus 1, and so on.This reduces the apparent information content and allows LZW to encode the data more compactly. - - The rgb pixel rows. - The width. - - - - Applies a horizontal predictor to a gray pixel row. - - The gray pixel rows. - The width. - - - - Gets the image width. - - - - - Gets the bits per pixel. - - - - - Gets the bytes per row. - - - - - Gets the predictor to use. Should only be used with deflate or lzw compression. - - - - - Gets the memory allocator. - - - - - - - - Initializes a new instance of the class. - - The output stream to write the compressed image to. - The memory allocator. - The image width. - Bits per pixel. - The predictor to use (should only be used with deflate or lzw compression). Defaults to none. - - - - Gets the compression method to use. - - - - - Gets the output stream to write the compressed image to. - - - - - Does any initialization required for the compression. - - The number of rows per strip. - - - - Compresses a strip of the image. - - Image rows to compress. - Image height. - - - - The base tiff decompressor class. - - - - - Initializes a new instance of the class. - - The memory allocator. - The width of the image. - The bits per pixel. - The predictor. - - - - Decompresses image data into the supplied buffer. - - The to read image data from. - The strip offset of stream. - The number of bytes to read from the input stream. - The height of the strip. - The output buffer for uncompressed data. - - - - Decompresses image data into the supplied buffer. - - The to read image data from. - The number of bytes to read from the input stream. - The height of the strip. - The output buffer for uncompressed data. - - - - Provides enumeration of the various TIFF compression types the decoder can handle. - - - - - Image data is stored uncompressed in the TIFF file. - - - - - Image data is compressed using PackBits compression. - - - - - Image data is compressed using Deflate compression. - - - - - Image data is compressed using LZW compression. - - - - - Image data is compressed using CCITT T.4 fax compression. - - - - - Image data is compressed using CCITT T.6 fax compression. - - - - - Image data is compressed using modified huffman compression. - - - - - The image data is compressed as a JPEG stream. - - - - - Enumeration representing the compression formats defined by the Tiff file-format. - - - - - A invalid compression value. - - - - - No compression. - - - - - CCITT Group 3 1-Dimensional Modified Huffman run-length encoding. - - - - - T4-encoding: CCITT T.4 bi-level encoding (see Section 11 of the TIFF 6.0 specification). - - - - - T6-encoding: CCITT T.6 bi-level encoding (see Section 11 of the TIFF 6.0 specification). - - - - - LZW compression (see Section 13 of the TIFF 6.0 specification). - - - - - JPEG compression - obsolete (see Section 22 of the TIFF 6.0 specification). - - Note: The TIFF encoder does not support this compression and will default to use no compression instead, - if this is chosen. - - - - - JPEG compression (see TIFF Specification, supplement 2). - - Note: The TIFF encoder does not yet support this compression and will default to use no compression instead, - if this is chosen. - - - - - Deflate compression, using zlib data format (see TIFF Specification, supplement 2). - - - - - ITU-T Rec. T.82 coding, applying ITU-T Rec. T.85 (JBIG) (see RFC2301). - - Note: The TIFF encoder does not yet support this compression and will default to use no compression instead, - if this is chosen. - - - - - ITU-T Rec. T.43 representation, using ITU-T Rec. T.82 (JBIG) (see RFC2301). - - Note: The TIFF encoder does not yet support this compression and will default to use no compression instead, - if this is chosen. - - - - - NeXT 2-bit Grey Scale compression algorithm. - - Note: The TIFF encoder does not support this compression and will default to use no compression instead, - if this is chosen. - - - - - PackBits compression. - - - - - ThunderScan 4-bit compression. - - Note: The TIFF encoder does not support this compression and will default to use no compression instead, - if this is chosen. - - - - - Deflate compression - old. - - Note: The TIFF encoder does not support this compression and will default to use no compression instead, - if this is chosen. - - - - - Defines constants defined in the TIFF specification. - - - - - Byte order markers for indicating little endian encoding. - - - - - Byte order markers for indicating big endian encoding. - - - - - Byte order markers for indicating little endian encoding. - - - - - Byte order markers for indicating big endian encoding. - - - - - Magic number used within the image file header to identify a TIFF format file. - - - - - The big tiff header magic number - - - - - The big tiff bytesize of offsets value. - - - - - RowsPerStrip default value, which is effectively infinity. - - - - - Size (in bytes) of the Rational and SRational data types - - - - - The default strip size is 8k. - - - - - The bits per sample for 1 bit bicolor images. - - - - - The bits per sample for images with a 4 color palette. - - - - - The bits per sample for 8 bit images. - - - - - The bits per sample for color images with 8 bits for each color channel. - - - - - The list of mimetypes that equate to a tiff. - - - - - The list of file extensions that equate to a tiff. - - - - - Enumeration representing the possible uses of extra components in TIFF format files. - - - - - Unspecified data. - - - - - Associated alpha data (with pre-multiplied color). - - - - - Unassociated alpha data. - - - - - Enumeration representing the fill orders defined by the Tiff file-format. - - - - - Pixels with lower column values are stored in the higher-order bits of the byte. - - - - - Pixels with lower column values are stored in the lower-order bits of the byte. - - - - - Enumeration representing the sub-file types defined by the Tiff file-format. - - - - - A full-resolution image. - - - - - Reduced-resolution version of another image in this TIFF file. - - - - - A single page of a multi-page image. - - - - - A transparency mask for another image in this TIFF file. - - - - - Alternative reduced-resolution version of another image in this TIFF file (see DNG specification). - - - - - Mixed raster content (see RFC2301). - - - - - Enumeration representing the image orientations defined by the Tiff file-format. - - - - - The 0th row and 0th column represent the visual top and left-hand side of the image respectively. - - - - - The 0th row and 0th column represent the visual top and right-hand side of the image respectively. - - - - - The 0th row and 0th column represent the visual bottom and right-hand side of the image respectively. - - - - - The 0th row and 0th column represent the visual bottom and left-hand side of the image respectively. - - - - - The 0th row and 0th column represent the visual left-hand side and top of the image respectively. - - - - - The 0th row and 0th column represent the visual right-hand side and top of the image respectively. - - - - - The 0th row and 0th column represent the visual right-hand side and bottom of the image respectively. - - - - - The 0th row and 0th column represent the visual left-hand side and bottom of the image respectively. - - - - - Enumeration representing the photometric interpretation formats defined by the Tiff file-format. - - - - - Bilevel and grayscale: 0 is imaged as white. The maximum value is imaged as black. - - Not supported by the TiffEncoder. - - - - - Bilevel and grayscale: 0 is imaged as black. The maximum value is imaged as white. - - - - - RGB image. - - - - - Palette Color. - - - - - A transparency mask. - - Not supported by the TiffEncoder. - - - - - Separated: usually CMYK (see Section 16 of the TIFF 6.0 specification). - - Not supported by the TiffEncoder. - - - - - YCbCr (see Section 21 of the TIFF 6.0 specification). - - Not supported by the TiffEncoder. - - - - - 1976 CIE L*a*b* (see Section 23 of the TIFF 6.0 specification). - - Not supported by the TiffEncoder. - - - - - ICC L*a*b* (see TIFF Specification, supplement 1). - - Not supported by the TiffEncoder. - - - - - ITU L*a*b* (see RFC2301). - - Not supported by the TiffEncoder. - - - - - Color Filter Array (see the DNG specification). - - Not supported by the TiffEncoder. - - - - - Linear Raw (see the DNG specification). - - Not supported by the TiffEncoder. - - - - - Enumeration representing how the components of each pixel are stored the Tiff file-format. - - - - - Chunky format. - The component values for each pixel are stored contiguously. - The order of the components within the pixel is specified by - PhotometricInterpretation. For example, for RGB data, the data is stored as RGBRGBRGB. - - - - - Planar format. - The components are stored in separate “component planes.” The - values in StripOffsets and StripByteCounts are then arranged as a 2-dimensional - array, with SamplesPerPixel rows and StripsPerImage columns. (All of the columns - for row 0 are stored first, followed by the columns of row 1, and so on.) - PhotometricInterpretation describes the type of data stored in each component - plane. For example, RGB data is stored with the Red components in one component - plane, the Green in another, and the Blue in another. - - - - - A mathematical operator that is applied to the image data before an encoding scheme is applied. - - - - - No prediction. - - - - - Horizontal differencing. - - - - - Floating point horizontal differencing. - - Note: The Tiff Encoder does not yet support this. If this is chosen, the encoder will fallback to none. - - - - - Specifies how to interpret each data sample in a pixel. - - - - - Unsigned integer data. Default value. - - - - - Signed integer data. - - - - - IEEE floating point data. - - - - - Undefined data format. - - - - - The complex int. - - - - - The complex float. - - - - - Enumeration representing the sub-file types defined by the Tiff file-format. - - - - - Full-resolution image data. - - - - - Reduced-resolution image data. - - - - - A single page of a multi-page image. - - - - - Enumeration representing the thresholding applied to image data defined by the Tiff file-format. - - - - - No dithering or halftoning. - - - - - An ordered dither or halftone technique. - - - - - A randomized process such as error diffusion. - - - - - The TIFF IFD reader class. - - - - - Gets the byte order. - - - - - Reads image file directories. - - Image file directories. - - - - Encapsulates the options for the . - - - - - Gets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets the decoding mode for multi-frame images. - - - - - Encapsulates the options for the . - - - - - Gets the number of bits per pixel. - - - - - Gets the compression type to use. - - - - - Gets the compression level 1-9 for the deflate compression mode. - Defaults to . - - - - - Gets the PhotometricInterpretation to use. Possible options are RGB, RGB with a color palette, gray or BiColor. - If no PhotometricInterpretation is specified or it is unsupported by the encoder, RGB will be used. - - - - - Gets a value indicating which horizontal prediction to use. This can improve the compression ratio with deflate or lzw compression. - - - - - Gets the quantizer for creating a color palette image. - - - - - Implements the 'BlackIsZero' photometric interpretation for 16-bit grayscale images. - - - - - Initializes a new instance of the class. - - The configuration. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'BlackIsZero' photometric interpretation (optimized for bilevel images). - - The pixel format. - - - - - - - Implements the 'BlackIsZero' photometric interpretation for 24-bit grayscale images. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'BlackIsZero' photometric interpretation for 32-bit float grayscale images. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'BlackIsZero' photometric interpretation for 32-bit grayscale images. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'BlackIsZero' photometric interpretation (optimized for 4-bit grayscale images). - - - - - - - - Implements the 'BlackIsZero' photometric interpretation (optimized for 8-bit grayscale images). - - - - - - - - Implements the 'BlackIsZero' photometric interpretation (for all bit depths). - - - - - - - - Implements the 'PaletteTiffColor' photometric interpretation (for all bit depths). - - - - The number of bits per sample for each pixel. - The RGB color lookup table to use for decoding the image. - - - - - - - Implements the 'RGB' photometric interpretation with 16 bits for each channel. - - - - - Initializes a new instance of the class. - - The configuration. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with 'Planar' layout for each color channel with 16 bit. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with 24 bits for each channel. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with 'Planar' layout for each color channel with 24 bit. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with 32 bits for each channel. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with 'Planar' layout for each color channel with 32 bit. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation for 4 bits per color channel images. - - - - - - - - Implements the 'RGB' photometric interpretation (optimized for 8-bit full color images). - - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and with 16 bits for each channel. - - - - - Initializes a new instance of the class. - - The configuration. - The memory allocator. - if set to true decodes the pixel data as big endian, otherwise as little endian. - The type of the extra samples. - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and with 'Planar' layout for each color channel with 16 bit. - - - - - Initializes a new instance of the class. - - The extra samples type. - If set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and with 24 bits for each channel. - - - - - Initializes a new instance of the class. - - The type of the extra samples. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and with 'Planar' layout for each color channel with 24 bit. - - - - - Initializes a new instance of the class. - - The extra samples type. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and with 32 bits for each channel. - - - - - Initializes a new instance of the class. - - The type of the extra samples. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and a 'Planar' layout for each color channel with 32 bit. - - - - - Initializes a new instance of the class. - - The extra samples type. - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and 8 bits per channel. - - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and with 32 bits for each channel. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with an alpha channel and with 'Planar' layout (for all bit depths). - - - - - Decodes pixel data using the current photometric interpretation. - - The buffers to read image data from. - The image buffer to write pixels to. - The x-coordinate of the left-hand side of the image block. - The y-coordinate of the top of the image block. - The width of the image block. - The height of the image block. - - - - Implements the 'RGB' photometric interpretation with alpha channel (for all bit depths). - - - - - - - - Implements the 'RGB' photometric interpretation with 32 bits for each channel. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'RGB' photometric interpretation with 'Planar' layout (for all bit depths). - - - - - Decodes pixel data using the current photometric interpretation. - - The buffers to read image data from. - The image buffer to write pixels to. - The x-coordinate of the left-hand side of the image block. - The y-coordinate of the top of the image block. - The width of the image block. - The height of the image block. - - - - Implements the 'RGB' photometric interpretation (for all bit depths). - - - - - - - - The base class for photometric interpretation decoders. - - The pixel format. - - - - Decodes source raw pixel data using the current photometric interpretation. - - The buffer to read image data from. - The image buffer to write pixels to. - The x-coordinate of the left-hand side of the image block. - The y-coordinate of the top of the image block. - The width of the image block. - The height of the image block. - - - - The base class for planar color decoders. - - The pixel format. - - - - Decodes source raw pixel data using the current photometric interpretation. - - The buffers to read image data from. - The image buffer to write pixels to. - The x-coordinate of the left-hand side of the image block. - The y-coordinate of the top of the image block. - The width of the image block. - The height of the image block. - - - - Provides enumeration of the various TIFF photometric interpretation implementation types. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Optimized implementation for bilevel images. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Optimized implementation for 4-bit images. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Optimized implementation for 8-bit images. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Optimized implementation for 16-bit images. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Optimized implementation for 24-bit images. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Optimized implementation for 32-bit images. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Pixel data is 32-bit float. - - - - - Grayscale: 0 is imaged as white. The maximum value is imaged as black. - - - - - Grayscale: 0 is imaged as white. The maximum value is imaged as black. Optimized implementation for bilevel images. - - - - - Grayscale: 0 is imaged as white. The maximum value is imaged as black. Optimized implementation for 4-bit images. - - - - - Grayscale: 0 is imaged as white. The maximum value is imaged as black. Optimized implementation for 8-bit images. - - - - - Grayscale: 0 is imaged as white. The maximum value is imaged as black. Optimized implementation for 16-bit images. - - - - - Grayscale: 0 is imaged as white. The maximum value is imaged as black. Optimized implementation for 24-bit images. - - - - - Grayscale: 0 is imaged as white. The maximum value is imaged as black. Optimized implementation for 32-bit images. - - - - - Grayscale: 0 is imaged as black. The maximum value is imaged as white. Pixel data is 32-bit float. - - - - - Palette-color. - - - - - RGB Full Color. - - - - - RGB color image with 2 bits for each channel. - - - - - RGBA color image with 2 bits for each channel. - - - - - RGB color image with 3 bits for each channel. - - - - - RGBA color image with 3 bits for each channel. - - - - - RGB color image with 4 bits for each channel. - - - - - RGBA color image with 4 bits for each channel. - - - - - RGB color image with 5 bits for each channel. - - - - - RGBA color image with 5 bits for each channel. - - - - - RGB color image with 6 bits for each channel. - - - - - RGBA color image with 6 bits for each channel. - - - - - RGB Full Color. Optimized implementation for 8-bit images. - - - - - RGBA Full Color with 8-bit for each channel. - - - - - RGB color image with 10 bits for each channel. - - - - - RGBA color image with 10 bits for each channel. - - - - - RGB color image with 12 bits for each channel. - - - - - RGBA color image with 12 bits for each channel. - - - - - RGB color image with 14 bits for each channel. - - - - - RGBA color image with 14 bits for each channel. - - - - - RGB color image with 16 bits for each channel. - - - - - RGBA color image with 16 bits for each channel. - - - - - RGB color image with 24 bits for each channel. - - - - - RGBA color image with 24 bits for each channel. - - - - - RGB color image with 32 bits for each channel. - - - - - RGBA color image with 32 bits for each channel. - - - - - RGB color image with 32 bits floats for each channel. - - - - - RGBA color image with 32 bits floats for each channel. - - - - - RGB Full Color. Planar configuration of data. 8 Bit per color channel. - - - - - RGBA color image with an alpha channel. Planar configuration of data. 8 Bit per color channel. - - - - - RGB Full Color. Planar configuration of data. 16 Bit per color channel. - - - - - RGB Color with an alpha channel. Planar configuration of data. 16 Bit per color channel. - - - - - RGB Full Color. Planar configuration of data. 24 Bit per color channel. - - - - - RGB Color with an alpha channel. Planar configuration of data. 24 Bit per color channel. - - - - - RGB Full Color. Planar configuration of data. 32 Bit per color channel. - - - - - RGB Color with an alpha channel. Planar configuration of data. 32 Bit per color channel. - - - - - The pixels are stored in YCbCr format. - - - - - The pixels are stored in YCbCr format as planar. - - - - - Implements the 'WhiteIsZero' photometric interpretation for 16-bit grayscale images. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'WhiteIsZero' photometric interpretation (optimized for bilevel images). - - - - - - - - Implements the 'WhiteIsZero' photometric interpretation for 24-bit grayscale images. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'WhiteIsZero' photometric interpretation for 32-bit float grayscale images. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'WhiteIsZero' photometric interpretation for 32-bit grayscale images. - - - - - Initializes a new instance of the class. - - if set to true decodes the pixel data as big endian, otherwise as little endian. - - - - - - - Implements the 'WhiteIsZero' photometric interpretation (optimized for 4-bit grayscale images). - - - - - - - - Implements the 'WhiteIsZero' photometric interpretation (optimized for 8-bit grayscale images). - - - - - - - - Implements the 'WhiteIsZero' photometric interpretation (for all bit depths). - - - - - - - - Converts YCbCr data to rgb data. - - - - - - - - - - - Enumerates the available bits per pixel for the tiff format. - - - - - 1 bit per pixel, for bi-color image. - - - - - 4 bits per pixel, for images with a color palette. - - - - - 6 bits per pixel. 2 bit for each color channel. - - Note: The TiffEncoder does not yet support 2 bits per color channel and will default to 24 bits per pixel instead. - - - - - 8 bits per pixel, grayscale or color palette images. - - - - - 10 bits per pixel, for gray images. - - Note: The TiffEncoder does not yet support 10 bits per pixel and will default to 24 bits per pixel instead. - - - - - 12 bits per pixel. 4 bit for each color channel. - - Note: The TiffEncoder does not yet support 4 bits per color channel and will default to 24 bits per pixel instead. - - - - - 14 bits per pixel, for gray images. - - Note: The TiffEncoder does not yet support 14 bits per pixel images and will default to 24 bits per pixel instead. - - - - - 16 bits per pixel, for gray images. - - Note: The TiffEncoder does not yet support 16 bits per color channel and will default to 24 bits per pixel instead. - - - - - 24 bits per pixel. One byte for each color channel. - - - - - 30 bits per pixel. 10 bit for each color channel. - - Note: The TiffEncoder does not yet support 10 bits per color channel and will default to 24 bits per pixel instead. - - - - - 36 bits per pixel. 12 bit for each color channel. - - Note: The TiffEncoder does not yet support 12 bits per color channel and will default to 24 bits per pixel instead. - - - - - 42 bits per pixel. 14 bit for each color channel. - - Note: The TiffEncoder does not yet support 14 bits per color channel and will default to 24 bits per pixel instead. - - - - - 48 bits per pixel. 16 bit for each color channel. - - Note: The TiffEncoder does not yet support 16 bits per color channel and will default to 24 bits per pixel instead. - - - - - The number of bits per component. - - - - - The bits for the channel 0. - - - - - The bits for the channel 1. - - - - - The bits for the channel 2. - - - - - The bits for the alpha channel. - - - - - The number of channels. - - - - - Initializes a new instance of the struct. - - The bits for the channel 0. - The bits for the channel 1. - The bits for the channel 2. - The bits for the channel 3. - - - - Tries to parse a ushort array and convert it into a TiffBitsPerSample struct. - - The value to parse. - The tiff bits per sample. - True, if the value could be parsed. - - - - - - - - - - - - - Converts the bits per sample struct to an ushort array. - - Bits per sample as ushort array. - - - - Gets the bits per pixel for the given bits per sample. - - Bits per pixel. - - - - - - - Registers the image encoders, decoders and mime type detectors for the TIFF format. - - - - - - - - Image decoder for generating an image out of a TIFF stream. - - - - - Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets or sets the decoding mode for multi-frame images. - - - - - - - - - - - - - - Performs the tiff decoding operation. - - - - - Used for allocating memory during processing operations. - - - - - Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets the decoding mode for multi-frame images - - - - - The stream to decode from. - - - - - Indicates the byte order of the stream. - - - - - Indicating whether is BigTiff format. - - - - - Initializes a new instance of the class. - - The configuration. - The decoder options. - - - - Gets or sets the bits per sample. - - - - - Gets or sets the bits per pixel. - - - - - Gets or sets the lookup table for RGB palette colored images. - - - - - Gets or sets the photometric interpretation implementation to use when decoding the image. - - - - - Gets or sets the reference black and white for decoding YCbCr pixel data. - - - - - Gets or sets the YCbCr coefficients. - - - - - Gets or sets the YCbCr sub sampling. - - - - - Gets or sets the compression used, when the image was encoded. - - - - - Gets or sets the Fax specific compression options. - - - - - Gets or sets the the logical order of bits within a byte. - - - - - Gets or sets the extra samples type. - - - - - Gets or sets the JPEG tables when jpeg compression is used. - - - - - Gets or sets the planar configuration type to use when decoding the image. - - - - - Gets or sets the photometric interpretation. - - - - - Gets or sets the sample format. - - - - - Gets or sets the horizontal predictor. - - - - - - - - - - - - - - - - - Decodes the image data from a specified IFD. - - The pixel format. - The IFD tags. - The token to monitor cancellation. - The tiff frame. - - - - Calculates the size (in bytes) for a pixel buffer using the determined color format. - - The width for the desired pixel buffer. - The height for the desired pixel buffer. - The index of the plane for planar image configuration (or zero for chunky). - The size (in bytes) of the required pixel buffer. - - - - Decodes the image data for planar encoded pixel data. - - The pixel format. - The image frame to decode data into. - The number of rows per strip of data. - An array of byte offsets to each strip in the image. - An array of the size of each strip (in bytes). - The token to monitor cancellation. - - - - Decodes the image data for chunky encoded pixel data. - - The pixel format. - The image frame to decode data into. - The rows per strip. - The strip offsets. - The strip byte counts. - The token to monitor cancellation. - - - - Gets the width of the image frame. - - The image frame exif profile. - The image width. - - - - Gets the height of the image frame. - - The image frame exif profile. - The image height. - - - - The decoder metadata creator. - - - - - The decoder options parser. - - - - - Determines the TIFF compression and color types, and reads any associated parameters. - - The options. - The exif profile of the frame to decode. - The IFD entries container to read the image format information for current frame. - - - - Encoder for writing the data image to a stream in TIFF format. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs the TIFF encoding operation. - - - - - Used for allocating memory during processing operations. - - - - - A scratch buffer to reduce allocations. - - - - - The global configuration. - - - - - The quantizer for creating color palette image. - - - - - Sets the deflate compression level. - - - - - The default predictor is None. - - - - - The default bits per pixel is Bit24. - - - - - The default compression is None. - - - - - The default photometric interpretation is Rgb. - - - - - Initializes a new instance of the class. - - The options for the encoder. - The memory allocator. - - - - Gets the photometric interpretation implementation to use when encoding the image. - - - - - Gets or sets the compression implementation to use when encoding the image. - - - - - Gets or sets a value indicating which horizontal predictor to use. This can improve the compression ratio with deflate compression. - - - - - Gets the bits per pixel. - - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - The token to request cancellation. - - - - Writes the TIFF file header. - - The to write data to. - - The marker to write the first IFD offset. - - - - - Writes all data required to define an image. - - The pixel format. - The to write data to. - The tiff frame. - The image metadata (resolution values for each frame). - The image (common metadata for root frame). - The marker to write this IFD offset. - - The next IFD offset value. - - - - - Calculates the number of rows written per strip. - - The height of the image. - The number of bytes per row. - The compression used. - Number of rows per strip. - - - - Writes a TIFF IFD block. - - The to write data to. - The IFD entries to write to the file. - The marker to write the next IFD offset (if present). - - - - Description of extra components. - - - - - The data is unspecified, not supported. - - - - - The extra data is associated alpha data (with pre-multiplied color). - - - - - The extra data is unassociated alpha data is transparency information that logically exists independent of an image; - it is commonly called a soft matte. - - - - - Encapsulates the means to encode and decode Tiff images. - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - - - - The TIFF format type enum. - - - - - The TIFF file format type. - - - - - The BigTIFF format type. - - - - - Provides Tiff specific metadata information for the frame. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The other tiff frame metadata. - - - - Gets or sets the bits per pixel. - - - - - Gets or sets number of bits per component. - - - - - Gets or sets the compression scheme used on the image data. - - - - - Gets or sets the color space of the image data. - - - - - Gets or sets a mathematical operator that is applied to the image data before an encoding scheme is applied. - - - - - Returns a new instance parsed from the given Exif profile. - - The Exif profile containing tiff frame directory tags to parse. - If null, a new instance is created and parsed instead. - The . - - - - Parses the given Exif profile to populate the properties of the tiff frame meta data. - - The tiff frame meta data. - The Exif profile containing tiff frame directory tags. - - - - - - - Detects tiff file headers - - - - - - - - - - - Provides Tiff specific metadata information for the image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the byte order. - - - - - Gets or sets the format type. - - - - - - - - Cold path optimizations for throwing tiff format based exceptions. - - - - - Cold path optimization for throwing -s - - The error message for the exception. - - - - Utility class to read a sequence of bits from an array - - - - - Initializes a new instance of the struct. - - The array to read data from. - - - - Reads the specified number of bits from the array. - - The number of bits to read. - The value read from the array. - - - - Moves the reader to the next row of byte-aligned data. - - - - - Helper methods for TIFF decoding. - - - - - Finds the padding needed to round 'valueToRoundUp' to the next integer multiple of subSampling value. - - The width or height to round up. - The sub sampling. - The padding. - - - - Gets the bits per pixel. - - - - - Gets the bytes per row. - - - - - - - - Adds image format information to the specified IFD. - - The rows per strip. - The strip offsets. - The strip byte counts. - - - - - - - - - - - - - The base class for composite color types: 8-bit gray, 24-bit RGB (4-bit gray, 16-bit (565/555) RGB, 32-bit RGB, CMYK, YCbCr). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Utility class for writing TIFF data to a . - - - - - A scratch buffer to reduce allocations. - - - - - Initializes a new instance of the class. - - The output stream. - - - - Gets a value indicating whether the architecture is little-endian. - - - - - Gets the current position within the stream. - - - - - Gets the base stream. - - - - - Writes an empty four bytes to the stream, returning the offset to be written later. - - The offset to be written later. - - - - Writes an array of bytes to the current stream. - - The bytes to write. - - - - Writes the specified value. - - The bytes to write. - - - - Writes a byte to the current stream. - - The byte to write. - - - - Writes a two-byte unsigned integer to the current stream. - - The two-byte unsigned integer to write. - - - - Writes a four-byte unsigned integer to the current stream. - - The four-byte unsigned integer to write. - - - - Writes an array of bytes to the current stream, padded to four-bytes. - - The bytes to write. - - - - Writes a four-byte unsigned integer to the specified marker in the stream. - - The offset returned when placing the marker - The four-byte unsigned integer to write. - - - - Disposes instance, ensuring any unwritten data is flushed. - - - - - Implements decoding for lossy alpha chunks which may be compressed. - - - - - Initializes a new instance of the class. - - The width of the image. - The height of the image. - The (maybe compressed) alpha data. - The first byte of the alpha image stream contains information on how to decode the stream. - Used for allocating memory during decoding. - The configuration. - - - - Gets the width of the image. - - - - - Gets the height of the image. - - - - - Gets the used filter type. - - - - - Gets or sets the last decoded row. - - - - - Gets or sets the row before the last decoded row. - - - - - Gets information for decoding Vp8L compressed alpha data. - - - - - Gets the decoded alpha data. - - - - - Gets a value indicating whether the alpha channel uses compression. - - - - - Gets the (maybe compressed) alpha data. - - - - - Gets the Vp8L decoder which is used to de compress the alpha channel, if needed. - - - - - Gets a value indicating whether the decoding needs 1 byte per pixel for decoding. - Although Alpha Channel requires only 1 byte per pixel, sometimes Vp8LDecoder may need to allocate - 4 bytes per pixel internally during decode. - - - - - Decodes and filters the maybe compressed alpha data. - - - - - Applies filtering to a set of rows. - - The first row index to start filtering. - The last row index for filtering. - The destination to store the filtered data. - The stride to use. - - - - Once the image-stream is decoded into ARGB color values, the transparency information will be extracted from the green channel of the ARGB quadruplet. - - The VP8L decoder. - - - - Row-processing for the special case when alpha data contains only one - transform (color indexing), and trivial non-green literals. - - The VP8L meta data. - True, if alpha channel needs one byte per pixel, otherwise 4. - - - - - - - Methods for encoding the alpha data of a VP8 image. - - - - - Encodes the alpha channel data. - Data is either compressed as lossless webp image or uncompressed. - - The pixel format. - The to encode from. - The global configuration. - The memory manager. - Indicates, if the data should be compressed with the lossless webp compression. - The size in bytes of the alpha data. - The encoded alpha data. - - - - Store the transparency in the green channel. - - The pixel format. - The to encode from. - A byte sequence of length width * height, containing all the 8-bit transparency values in scan order. - The transparency image. - - - - Extract the alpha data of the image. - - The pixel format. - The to encode from. - The global configuration. - The memory manager. - A byte sequence of length width * height, containing all the 8-bit transparency values in scan order. - - - - - - - Base class for VP8 and VP8L bitreader. - - - - - Gets or sets the raw encoded image data. - - - - - Copies the raw encoded image data from the stream into a byte array. - - The input stream. - Number of bytes to read as indicated from the chunk size. - Used for allocating memory during reading data from the stream. - - - - - - - A bit reader for VP8 streams. - - - - - Current value. - - - - - Current range minus 1. In [127, 254] interval. - - - - - Number of valid bits left. - - - - - Max packed-read position of the buffer. - - - - - True if input is exhausted. - - - - - Byte position in buffer. - - - - - Initializes a new instance of the class. - - The input stream to read from. - The raw image data size in bytes. - Used for allocating memory during reading data from the stream. - The partition length. - Start index in the data array. Defaults to 0. - - - - Initializes a new instance of the class. - - The raw encoded image data. - The partition length. - Start index in the data array. Defaults to 0. - - - - A bit reader for reading lossless webp streams. - - - - - Maximum number of bits (inclusive) the bit-reader can handle. - - - - - Number of bits prefetched. - - - - - Minimum number of bytes ready after VP8LFillBitWindow. - - - - - Pre-fetched bits. - - - - - Buffer length. - - - - - Byte position in buffer. - - - - - Current bit-reading position in value. - - - - - Initializes a new instance of the class. - - Lossless compressed image data. - - - - Initializes a new instance of the class. - - The input stream to read from. - The raw image data size in bytes. - Used for allocating memory during reading data from the stream. - - - - Gets or sets a value indicating whether a bit was read past the end of buffer. - - - - - Reads a unsigned short value from the buffer. The bits of each byte are read in least-significant-bit-first order. - - The number of bits to read (should not exceed 16). - A ushort value. - - - - Reads a single bit from the stream. - - True if the bit read was 1, false otherwise. - - - - For jumping over a number of bits in the bit stream when accessed with PrefetchBits and FillBitWindow. - - The number of bits to advance the position. - - - - Return the pre-fetched bits, so they can be looked up. - - The pre-fetched bits. - - - - Advances the read buffer by 4 bytes to make room for reading next 32 bits. - - - - - Returns true if there was an attempt at reading bit past the end of the buffer. - - True, if end of buffer was reached. - - - - If not at EOS, reload up to Vp8LLbits byte-by-byte. - - - - - Buffer to write to. - - - - - A scratch buffer to reduce allocations. - - - - - Initializes a new instance of the class. - - The expected size in bytes. - - - - Initializes a new instance of the class. - Used internally for cloning. - - - - - Writes the encoded bytes of the image to the stream. Call Finish() before this. - - The stream to write to. - - - - Writes the encoded bytes of the image to the given buffer. Call Finish() before this. - - The destination buffer. - - - - Resizes the buffer to write to. - - The extra size in bytes needed. - - - - Returns the number of bytes of the encoded image data. - - The number of bytes of the image data. - - - - Flush leftover bits. - - - - - Writes the RIFF header to the stream. - - The stream to write to. - The block length. - - - - Calculates the chunk size of EXIF or XMP metadata. - - The metadata profile bytes. - The metadata chunk size in bytes. - - - - Calculates the chunk size of a alpha chunk. - - The alpha chunk bytes. - The alpha data chunk size in bytes. - - - - Writes a metadata profile (EXIF or XMP) to the stream. - - The stream to write to. - The metadata profile's bytes. - The chuck type to write. - - - - Writes the alpha chunk to the stream. - - The stream to write to. - The alpha channel data bytes. - Indicates, if the alpha channel data is compressed. - - - - Writes a VP8X header to the stream. - - The stream to write to. - A exif profile or null, if it does not exist. - A XMP profile or null, if it does not exist. - The width of the image. - The height of the image. - Flag indicating, if a alpha channel is present. - - - - A bit writer for writing lossy webp streams. - - - - - Number of outstanding bits. - - - - - Number of pending bits. - - - - - Initializes a new instance of the class. - - The expected size in bytes. - - - - Initializes a new instance of the class. - - The expected size in bytes. - The Vp8Encoder. - - - - - - - Resizes the buffer to write to. - - The extra size in bytes needed. - - - - - - - Writes the encoded image to the stream. - - The stream to write to. - The exif profile. - The XMP profile. - The width of the image. - The height of the image. - Flag indicating, if a alpha channel is present. - The alpha channel data. - Indicates, if the alpha data is compressed. - - - - A bit writer for writing lossless webp streams. - - - - - A scratch buffer to reduce allocations. - - - - - This is the minimum amount of size the memory buffer is guaranteed to grow when extra space is needed. - - - - - Bit accumulator. - - - - - Number of bits used in accumulator. - - - - - Current write position. - - - - - Initializes a new instance of the class. - - The expected size in bytes. - - - - Initializes a new instance of the class. - Used internally for cloning. - - - - - This function writes bits into bytes in increasing addresses (little endian), - and within a byte least-significant-bit first. This function can write up to 32 bits in one go. - - - - - - - - - - - Writes the encoded image to the stream. - - The stream to write to. - The exif profile. - The XMP profile. - The width of the image. - The height of the image. - Flag indicating, if a alpha channel is present. - - - - Internal function for PutBits flushing 32 bits from the written state. - - - - - Resizes the buffer to write to. - - The extra size in bytes needed. - - - - These five modes are evaluated and their respective entropy is computed. - - - - - Image decoder options for generating an image out of a webp stream. - - - - - Gets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Configuration options for use during webp encoding. - - - - - Gets the webp file format used. Either lossless or lossy. - Defaults to lossy. - - - - - Gets the compression quality. Between 0 and 100. - For lossy, 0 gives the smallest size and 100 the largest. For lossless, - this parameter is the amount of effort put into the compression: 0 is the fastest but gives larger - files compared to the slowest, but best, 100. - Defaults to 75. - - - - - Gets the encoding method to use. Its a quality/speed trade-off (0=fast, 6=slower-better). - Defaults to 4. - - - - - Gets a value indicating whether the alpha plane should be compressed with Webp lossless format. - Defaults to true. - - - - - Gets the number of entropy-analysis passes (in [1..10]). - Defaults to 1. - - - - - Gets the amplitude of the spatial noise shaping. Spatial noise shaping (or sns for short) refers to a general collection of built-in algorithms - used to decide which area of the picture should use relatively less bits, and where else to better transfer these bits. - The possible range goes from 0 (algorithm is off) to 100 (the maximal effect). - Defaults to 50. - - - - - Gets the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). - A value of 0 will turn off any filtering. Higher value will increase the strength of the filtering process applied after decoding the picture. - The higher the value the smoother the picture will appear. - Typical values are usually in the range of 20 to 50. - Defaults to 60. - - - - - Gets a value indicating whether to preserve the exact RGB values under transparent area. Otherwise, discard this invisible - RGB information for better compression. - The default value is Clear. - - - - - Gets a value indicating whether near lossless mode should be used. - This option adjusts pixel values to help compressibility, but has minimal impact on the visual quality. - - - - - Gets the quality of near-lossless image preprocessing. The range is 0 (maximum preprocessing) to 100 (no preprocessing, the default). - The typical value is around 60. Note that lossy with -q 100 can at times yield better results. - - - - - Maximum bit length. - - - - - We want the max value to be attainable and stored in MaxLengthBits bits. - - - - - Minimum number of pixels for which it is cheaper to encode a - distance + length instead of each pixel as a literal. - - - - - Evaluates best possible backward references for specified quality. The input cacheBits to 'GetBackwardReferences' - sets the maximum cache bits to use (passing 0 implies disabling the local color cache). - The optimal cache bits is evaluated and set for the cacheBits parameter. - The return value is the pointer to the best of the two backward refs viz, refs[0] or refs[1]. - - - - - Evaluate optimal cache bits for the local color cache. - The input bestCacheBits sets the maximum cache bits to use (passing 0 implies disabling the local color cache). - The local color cache is also disabled for the lower (smaller then 25) quality. - - Best cache size. - - - - Compute an LZ77 by forcing matches to happen within a given distance cost. - We therefore limit the algorithm to the lowest 32 values in the PlaneCode definition. - - - - - Update (in-place) backward references for the specified cacheBits. - - - - - A small hash-addressed array to store recently used colors, to be able to recall them with shorter codes. - - - - - Gets the color entries. - - - - - Gets the hash shift: 32 - hashBits. - - - - - Gets the hash bits. - - - - - Initializes a new color cache. - - The hashBits determine the size of cache. It will be 1 left shifted by hashBits. - - - - Inserts a new color into the cache. - - The color to insert. - - - - Gets a color for a given key. - - The key to lookup. - The color for the key. - - - - Returns the index of the given color. - - The color to check. - The index of the color in the cache or -1 if its not present. - - - - Gets the index of a color. - - The color. - The index for the color. - - - - Adds a new color to the cache. - - The key. - The color to add. - - - - The GetLengthCost(costModel, k) are cached in a CostCacheInterval. - - - - - To perform backward reference every pixel at index index_ is considered and - the cost for the MAX_LENGTH following pixels computed. Those following pixels - at index index_ + k (k from 0 to MAX_LENGTH) have a cost of: - cost = distance cost at index + GetLengthCost(costModel, k) - and the minimum value is kept. GetLengthCost(costModel, k) is cached in an - array of size MAX_LENGTH. - Instead of performing MAX_LENGTH comparisons per pixel, we keep track of the - minimal values using intervals of constant cost. - An interval is defined by the index_ of the pixel that generated it and - is only useful in a range of indices from start to end (exclusive), i.e. - it contains the minimum value for pixels between start and end. - Intervals are stored in a linked list and ordered by start. When a new - interval has a better value, old intervals are split or removed. There are - therefore no overlapping intervals. - - - - - The CostManager is in charge of managing intervals and costs. - It caches the different CostCacheInterval, caches the different - GetLengthCost(costModel, k) in costCache and the CostInterval's. - - - - - Gets or sets the number of stored intervals. - - - - - Gets the costs cache. Contains the GetLengthCost(costModel, k). - - - - - Update the cost at index i by going over all the stored intervals that overlap with i. - - The index to update. - If 'doCleanIntervals' is true, intervals that end before 'i' will be popped. - - - - Given a new cost interval defined by its start at position, its length value - and distanceCost, add its contributions to the previous intervals and costs. - If handling the interval or one of its sub-intervals becomes to heavy, its - contribution is added to the costs right away. - - - - - Pop an interval from the manager. - - The interval to remove. - - - - Given a current orphan interval and its previous interval, before - it was orphaned (which can be NULL), set it at the right place in the list - of intervals using the start_ ordering and the previous interval as a hint. - - - - - Given two intervals, make 'prev' be the previous one of 'next' in 'manager'. - - - - - Given the cost and the position that define an interval, update the cost at - pixel 'i' if it is smaller than the previously computed value. - - - - - - - - Initializes a new instance of the class. - - The literal array size. - - - - Data container to keep track of cost range for the three dominant entropy symbols. - - - - - Initializes a new instance of the class. - - - - - Position of the histogram that accumulates all histograms with the same binId. - - - - - Number of combine failures per binId. - - - - - Number of partitions for the three dominant (literal, red and blue) symbol costs. - - - - - The size of the bin-hash corresponding to the three dominant costs. - - - - - Maximum number of histograms allowed in greedy combining algorithm. - - - - - Construct the histograms from the backward references. - - - - - Partition histograms to different entropy bins for three dominant (literal, - red and blue) symbol costs and compute the histogram aggregate bitCost. - - - - - Given a Histogram set, the mapping of clusters 'clusterMapping' and the - current assignment of the cells in 'symbols', merge the clusters and assign the smallest possible clusters values. - - - - - Perform histogram aggregation using a stochastic approach. - - true if a greedy approach needs to be performed afterwards, false otherwise. - - - - Create a pair from indices "idx1" and "idx2" provided its cost is inferior to "threshold", a negative entropy. - - The cost of the pair, or 0 if it superior to threshold. - - - - Update the cost diff and combo of a pair of histograms. This needs to be called when the the histograms have been merged with a third one. - - - - - Check whether a pair in the list should be updated as head or not. - - - - - Pair of histograms. Negative Idx1 value means that pair is out-of-date. - - - - - Huffman table group. - Includes special handling for the following cases: - - IsTrivialLiteral: one common literal base for RED/BLUE/ALPHA (not GREEN) - - IsTrivialCode: only 1 code (no bit is read from the bitstream) - - UsePackedTable: few enough literal symbols, so all the bit codes can fit into a small look-up table PackedTable[] - The common literal base, if applicable, is stored in 'LiteralArb'. - - - - - Gets the Huffman trees. This has a maximum of (5) entry's. - - - - - Gets or sets a value indicating whether huffman trees for Red, Blue and Alpha Symbols are trivial (have a single code). - - - - - Gets or sets a the literal argb value of the pixel. - If IsTrivialLiteral is true, this is the ARGB value of the pixel, with Green channel being set to zero. - - - - - Gets or sets a value indicating whether there is only one code. - - - - - Gets or sets a value indicating whether to use packed table below for short literal code. - - - - - Gets or sets table mapping input bits to packed values, or escape case to literal code. - - - - - Five Huffman codes are used at each meta code. - - - - - Green + length prefix codes + color cache codes. - - - - - Red. - - - - - Blue. - - - - - Alpha. - - - - - Distance prefix codes. - - - - - A classic way to do entropy coding where a smaller number of bits are used for more frequent codes. - - - - - Gets or sets the number of bits used for this symbol. - - - - - Gets or sets the symbol value or table offset. - - - - - Represents the Huffman tree. - - - - - Initializes a new instance of the struct. - - The HuffmanTree to create an instance from. - - - - Gets or sets the symbol frequency. - - - - - Gets or sets the symbol value. - - - - - Gets or sets the index for the left sub-tree. - - - - - Gets or sets the index for the right sub-tree. - - - - - Represents the tree codes (depth and bits array). - - - - - Gets or sets the number of symbols. - - - - - Gets or sets the code lengths of the symbols. - - - - - Gets or sets the symbol Codes. - - - - - Holds the tree header in coded form. - - - - - Gets or sets the code. Value (0..15) or escape code (16, 17, 18). - - - - - Gets or sets the extra bits for escape codes. - - - - - Utility functions related to creating the huffman tables. - - - - - Change the population counts in a way that the consequent - Huffman tree compression, especially its RLE-part, give smaller output. - - - - - Create an optimal Huffman tree. - - - The huffman tree. - The histogram. - The size of the histogram. - The tree depth limit. - How many bits are used for the symbol. - - - - Get the actual bit values for a tree of bit depths. - - The huffman tree. - - - - Returns the table width of the next 2nd level table. count is the histogram of bit lengths for the remaining symbols, - len is the code length of the next processed symbol. - - - - - Stores code in table[0], table[step], table[2*step], ..., table[end-step]. - Assumes that end is an integer multiple of step. - - - - - Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the - bit-wise reversal of the len least significant bits of key. - - - - - Heuristics for selecting the stride ranges to collapse. - - - - - Utility functions for the lossless decoder. - - - - - Returns the exact index where array1 and array2 are different. For an index - inferior or equal to bestLenMatch, the return value just has to be strictly - inferior to bestLenMatch match. The current behavior is to return 0 if this index - is bestLenMatch, and the index itself otherwise. - If no two elements are the same, it returns maxLimit. - - - - - Add green to blue and red channels (i.e. perform the inverse transform of 'subtract green'). - - The pixel data to apply the transformation. - - - - If there are not many unique pixel values, it is more efficient to create a color index array and replace the pixel values by the array's indices. - This will reverse the color index transform. - - The transform data contains color table size and the entries in the color table. - The pixel data to apply the reverse transform on. - - - - The goal of the color transform is to de-correlate the R, G and B values of each pixel. - Color transform keeps the green (G) value as it is, transforms red (R) based on green and transforms blue (B) based on green and then based on red. - - The transform data. - The pixel data to apply the inverse transform on. - - - - Color transform keeps the green (G) value as it is, transforms red (R) based on green and transforms blue (B) based on green and then based on red. - - The Vp8LMultipliers. - The pixel data to transform. - The number of pixels to process. - - - - Reverses the color space transform. - - The color transform element. - The pixel data to apply the inverse transform on. - - - - This will reverse the predictor transform. - The predictor transform can be used to reduce entropy by exploiting the fact that neighboring pixels are often correlated. - In the predictor transform, the current pixel value is predicted from the pixels already decoded (in scan-line order) and only the residual value (actual - predicted) is encoded. - The prediction mode determines the type of prediction to use. The image is divided into squares and all the pixels in a square use same prediction mode. - - The transform data. - The pixel data to apply the inverse transform. - The resulting pixel data with the reversed transformation data. - - - - Difference of each component, mod 256. - - - - - Bundles multiple (1, 2, 4 or 8) pixels into a single pixel. - - - - - Compute the combined Shanon's entropy for distribution {X} and {X+Y}. - - Shanon entropy. - - - - Fast calculation of log2(v) for integer input. - - - - - Fast calculation of v * log2(v) for integer input. - - - - - Splitting of distance and length codes into prefixes and - extra bits. The prefixes are encoded with an entropy code - while the extra bits are stored just as normal bits. - - - - - Computes sampled size of 'size' when sampling using 'sampling bits'. - - - - - Sum of each component, mod 256. - - - - - Near-lossless image preprocessing adjusts pixel values to help compressibility with a guarantee - of maximum deviation between original and resulting pixel values. - - - - - Image transform methods for the lossless webp encoder. - - - - - Finds the best predictor for each tile, and converts the image to residuals - with respect to predictions. If nearLosslessQuality < 100, applies - near lossless processing, shaving off more bits of residuals for lower qualities. - - - - - Returns best predictor and updates the accumulated histogram. - If maxQuantization > 1, assumes that near lossless processing will be - applied, quantizing residuals to multiples of quantization levels up to - maxQuantization (the actual quantization level depends on smoothness near - the given pixel). - - Best predictor. - - - - Stores the difference between the pixel and its prediction in "output". - In case of a lossy encoding, updates the source image to avoid propagating - the deviation further to pixels which depend on the current pixel for their - predictions. - - - - - Quantize every component of the difference between the actual pixel value and - its prediction to a multiple of a quantization (a power of 2, not larger than - maxQuantization which is a power of 2, smaller than maxDiff). Take care if - value and predict have undergone subtract green, which means that red and - blue are represented as offsets from green. - - - - - Quantize the difference between the actual component value and its prediction - to a multiple of quantization, working modulo 256, taking care not to cross - a boundary (inclusive upper limit). - - - - - Converts pixels of the image to residuals with respect to predictions. - If max_quantization > 1, applies near lossless processing, quantizing - residuals to multiples of quantization levels up to max_quantization - (the actual quantization level depends on smoothness near the given pixel). - - - - - Gets or sets the common block-size. - - - - - Gets the backward references. - - - - - Holds bit entropy results and entropy-related functions. - - - - - Not a trivial literal symbol. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the entropy. - - - - - Gets or sets the sum of the population. - - - - - Gets or sets the number of non-zero elements in the population. - - - - - Gets or sets the maximum value in the population. - - - - - Gets or sets the index of the last non-zero in the population. - - - - - Get the entropy for the distribution 'X'. - - - - - Holds information for decoding a lossless webp image. - - - - - Initializes a new instance of the class. - - The width of the image. - The height of the image. - Used for allocating memory for the pixel data output. - - - - Gets or sets the width of the image to decode. - - - - - Gets or sets the height of the image to decode. - - - - - Gets or sets the necessary VP8L metadata (like huffman tables) to decode the image. - - - - - Gets or sets the transformations which needs to be reversed. - - - - - Gets the pixel data. - - - - - - - - Encoder for lossless webp images. - - - - - Scratch buffer to reduce allocations. - - - - - The to use for buffer allocations. - - - - - The global configuration. - - - - - Maximum number of reference blocks the image will be segmented into. - - - - - Minimum block size for backward references. - - - - - A bit writer for writing lossless webp streams. - - - - - The quality, that will be used to encode the image. - - - - - Quality/speed trade-off (0=fast, 6=slower-better). - - - - - Flag indicating whether to preserve the exact RGB values under transparent area. Otherwise, discard this invisible - RGB information for better compression. - - - - - Indicating whether near lossless mode should be used. - - - - - The near lossless quality. The range is 0 (maximum preprocessing) to 100 (no preprocessing, the default). - - - - - Initializes a new instance of the class. - - The memory allocator. - The global configuration. - The width of the input image. - The height of the input image. - The encoding quality. - Quality/speed trade-off (0=fast, 6=slower-better). - Flag indicating whether to preserve the exact RGB values under transparent area. - Otherwise, discard this invisible RGB information for better compression. - Indicating whether near lossless mode should be used. - The near lossless quality. The range is 0 (maximum preprocessing) to 100 (no preprocessing, the default). - - - - Gets the memory for the image data as packed bgra values. - - - - - Gets the memory for the encoded output image data. - - - - - Gets or sets the scratch memory for bgra rows used for predictions. - - - - - Gets or sets the packed image width. - - - - - Gets or sets the huffman image bits. - - - - - Gets or sets the bits used for the transformation. - - - - - Gets or sets the transform data. - - - - - Gets or sets the cache bits. If equal to 0, don't use color cache. - - - - - Gets or sets a value indicating whether to use the cross color transform. - - - - - Gets or sets a value indicating whether to use the subtract green transform. - - - - - Gets or sets a value indicating whether to use the predictor transform. - - - - - Gets or sets a value indicating whether to use color indexing transform. - - - - - Gets or sets the palette size. - - - - - Gets the palette. - - - - - Gets the backward references. - - - - - Gets the hash chain. - - - - - Encodes the image as lossless webp to the specified stream. - - The pixel format. - The to encode from. - The to encode the image data to. - - - - Encodes the alpha image data using the webp lossless compression. - - The type of the pixel. - The to encode from. - The destination buffer to write the encoded alpha data to. - The size of the compressed data in bytes. - If the size of the data is the same as the pixel count, the compression would not yield in smaller data and is left uncompressed. - - - - - Writes the image size to the bitwriter buffer. - - The input image width. - The input image height. - - - - Writes a flag indicating if alpha channel is used and the VP8L version to the bitwriter buffer. - - Indicates if a alpha channel is present. - - - - Encodes the image stream using lossless webp format. - - The pixel type. - The image to encode. - - - - Converts the pixels of the image to bgra. - - The type of the pixels. - The image to convert. - The width of the image. - The height of the image. - true, if the image is non opaque. - - - - Analyzes the image and decides which transforms should be used. - - The image as packed bgra values. - The image width. - The image height. - Indicates if red and blue are always zero. - - - - Save the palette to the bitstream. - - - - - Applies the subtract green transformation to the pixel data of the image. - - - - - Analyzes the entropy of the input image to determine which transforms to use during encoding the image. - - The image to analyze as a bgra span. - The image width. - The image height. - Indicates whether a palette should be used. - The palette size. - The transformation bits. - Indicates if red and blue are always zero. - The entropy mode to use. - - - - If number of colors in the image is less than or equal to MaxPaletteSize, - creates a palette and returns true, else returns false. - - The image as packed bgra values. - The image width. - The image height. - true, if a palette should be used. - - - - Gets the color palette. - - The image to get the palette from as packed bgra values. - The image width. - The image height. - The span to store the palette into. - The number of palette entries. - - - - Remap bgra values in src[] to packed palettes entries in dst[] - using 'row' as a temporary buffer of size 'width'. - We assume that all src[] values have a corresponding entry in the palette. - Note: src[] can be the same as dst[] - - - - - Sort palette in increasing order and prepare an inverse mapping array. - - - - - The palette has been sorted by alpha. This function checks if the other components of the palette - have a monotonic development with regards to position in the palette. - If all have monotonic development, there is no benefit to re-organize them greedily. A monotonic development - would be spotted in green-only situations (like lossy alpha) or gray-scale images. - - The palette. - Number of colors in the palette. - True, if the palette has no monotonous deltas. - - - - Find greedily always the closest color of the predicted color to minimize - deltas in the palette. This reduces storage needs since the palette is stored with delta encoding. - - The palette. - The number of colors in the palette. - - - - Computes a value that is related to the entropy created by the palette entry diff. - - First color. - Second color. - The color distance. - - - - Calculates the huffman image bits. - - - - - Bundles multiple (1, 2, 4 or 8) pixels into a single pixel. - - - - - Calculates the bits used for the transformation. - - - - - Clears the backward references. - - - - - - - - The number of bits for the window size. - - - - - 1M window (4M bytes) minus 120 special codes for short distances. - - - - - Initializes a new instance of the class. - - The memory allocator. - The size off the chain. - - - - Gets the offset length. - The 20 most significant bits contain the offset at which the best match is found. - These 20 bits are the limit defined by GetWindowSizeForHashChain (through WindowSize = 1 << 20). - The lower 12 bits contain the length of the match. - - - - - Gets the size of the hash chain. - This is the maximum size of the hashchain that can be constructed. - Typically this is the pixel count (width x height) for a given image. - - - - - Calculates the hash for a pixel pair. - - An Span with two pixels. - The hash. - - - - Returns the maximum number of hash chain lookups to do for a - given compression quality. Return value in range [8, 86]. - - The quality. - Number of hash chain lookups. - - - - - - - Initializes a new instance of the class. - - The histogram to create an instance from. - - - - Initializes a new instance of the class. - - The backward references to initialize the histogram with. - The palette code bits. - - - - Initializes a new instance of the class. - - The palette code bits. - - - - Gets or sets the palette code bits. - - - - - Gets or sets the cached value of bit cost. - - - - - Gets or sets the cached value of literal entropy costs. - - - - - Gets or sets the cached value of red entropy costs. - - - - - Gets or sets the cached value of blue entropy costs. - - - - - - - - Collect all the references into a histogram (without reset). - - The backward references. - - - - Accumulate a token 'v' into a histogram. - - The token to add. - Indicates whether to use the distance modifier. - xSize is only used when useDistanceModifier is true. - - - - Estimate how many bits the combined entropy of literals and distance approximately maps to. - - Estimated bits. - - - - Performs output = a + b, computing the cost C(a+b) - C(a) - C(b) while comparing - to the threshold value 'costThreshold'. The score returned is - Score = C(a+b) - C(a) - C(b), where C(a) + C(b) is known and fixed. - Since the previous score passed is 'costThreshold', we only need to compare - the partial cost against 'costThreshold + C(a) + C(b)' to possibly bail-out early. - - - - - Get the symbol entropy for the distribution 'population'. - - - - - Initializes a new instance of the class. - - - - - Gets the streak count. - index: 0=zero streak, 1=non-zero streak. - - - - - Gets the streaks. - [zero/non-zero][streak < 3 / streak >= 3]. - - - - - Data associated with a VP8L transformation to reduce the entropy. - - - - - Gets the transform type. - - - - - Gets or sets the subsampling bits defining the transform window. - - - - - Gets or sets the transform window X index. - - - - - Gets the transform window Y index. - - - - - Gets or sets the transform data. - - - - - Enum for the different transform types. Transformations are reversible manipulations of the image data - that can reduce the remaining symbolic entropy by modeling spatial and color correlations. - Transformations can make the final compression more dense. - - - - - The predictor transform can be used to reduce entropy by exploiting the fact that neighboring pixels are often correlated. - - - - - The goal of the color transform is to de-correlate the R, G and B values of each pixel. - Color transform keeps the green (G) value as it is, transforms red (R) based on green and transforms blue (B) based on green and then based on red. - - - - - The subtract green transform subtracts green values from red and blue values of each pixel. - When this transform is present, the decoder needs to add the green value to both red and blue. - There is no data associated with this transform. - - - - - If there are not many unique pixel values, it may be more efficient to create a color index array and replace the pixel values by the array's indices. - The color indexing transform achieves this. - - - - - Decoder for lossless webp images. This code is a port of libwebp, which can be found here: https://chromium.googlesource.com/webm/libwebp - - - The lossless specification can be found here: - https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification - - - - - A bit reader for reading lossless webp streams. - - - - - The global configuration. - - - - - Used for allocating memory during processing operations. - - - - - Initializes a new instance of the class. - - Bitreader to read from the stream. - Used for allocating memory during processing operations. - The configuration. - - - - Decodes the image from the stream using the bitreader. - - The pixel format. - The pixel buffer to store the decoded data. - The width of the image. - The height of the image. - - - - Reads the transformations, if any are present. - - The width of the image. - The height of the image. - Vp8LDecoder where the transformations will be stored. - - - - A Webp lossless image can go through four different types of transformation before being entropy encoded. - This will reverse the transformations, if any are present. - - The decoder holding the transformation infos. - The pixel data to apply the transformation. - The memory allocator is needed to allocate memory during the predictor transform. - - - - The alpha channel of a lossy webp image can be compressed using the lossless webp compression. - This method will undo the compression. - - The alpha decoder. - - - - Decodes the next Huffman code from the bit-stream. - FillBitWindow() needs to be called at minimum every second call to ReadSymbol, in order to pre-fetch enough bits. - - - - - Copies pixels when a backward reference is used. - Copy 'length' number of pixels (in scan-line order) from the sequence of pixels prior to them by 'dist' pixels. - - The pixel data. - The number of so far decoded pixels. - The backward reference distance prior to the current decoded pixel. - The number of pixels to copy. - - - - Copies alpha values when a backward reference is used. - Copy 'length' number of alpha values from the sequence of alpha values prior to them by 'dist'. - - The alpha values. - The position of the so far decoded pixels. - The backward reference distance prior to the current decoded pixel. - The number of pixels to copy. - - - - Predict DC using row above and column to the left. - - - - - Propagate second differences a la "True Motion". - - - - - Predict rows using row above. - - - - - Predict columns using column to the left. - - - - - Enum for the different loop filters used. VP8 supports two types of loop filters. - - - - - No filter is used. - - - - - Simple loop filter. - - - - - Complex loop filter. - - - - - Paragraph 14.3: Implementation of the Walsh-Hadamard transform inversion. - - - - - Hadamard transform - Returns the weighted sum of the absolute value of transformed coefficients. - w[] contains a row-major 4 by 4 symmetric matrix. - - - - - Class for organizing convergence in either size or PSNR. - - - - - Quantization methods. - - - - - All the probabilities associated to one band. - - - - - Initializes a new instance of the class. - - - - - Gets the Probabilities. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Gets the Costs. - - - - - Holds information for decoding a lossy webp image. - - - - - Initializes a new instance of the class. - - The frame header. - The picture header. - The segment header. - The probabilities. - Used for allocating memory for the pixel data output and the temporary buffers. - - - - Gets the frame header. - - - - - Gets the picture header. - - - - - Gets the filter header. - - - - - Gets the segment header. - - - - - Gets or sets the number of partitions minus one. - - - - - Gets the per-partition boolean decoders. - - - - - Gets the dequantization matrices (one set of DC/AC dequant factor per segment). - - - - - Gets or sets a value indicating whether to use the skip probabilities. - - - - - Gets or sets the skip probability. - - - - - Gets or sets the Probabilities. - - - - - Gets or sets the top intra modes values: 4 * MbWidth. - - - - - Gets the left intra modes values. - - - - - Gets the width in macroblock units. - - - - - Gets the height in macroblock units. - - - - - Gets or sets the top-left x index of the macroblock that must be in-loop filtered. - - - - - Gets or sets the top-left y index of the macroblock that must be in-loop filtered. - - - - - Gets or sets the last bottom-right x index of the macroblock that must be decoded. - - - - - Gets or sets the last bottom-right y index of the macroblock that must be decoded. - - - - - Gets or sets the current x position in macroblock units. - - - - - Gets or sets the current y position in macroblock units. - - - - - Gets the parsed reconstruction data. - - - - - Gets the contextual macroblock info. - - - - - Gets or sets the loop filter used. The purpose of the loop filter is to eliminate (or at least reduce) - visually objectionable artifacts. - - - - - Gets the pre-calculated per-segment filter strengths. - - - - - Gets the pixel buffer where the decoded pixel data will be stored. - - - - - Gets or sets filter info. - - - - - - - - Iterator structure to iterate through macroblocks, pointing to the - right neighbouring data (samples, predictions, contexts, ...) - - - - - Stride of the prediction plane(=4*mbw + 1). - - - - - Gets or sets the current macroblock X value. - - - - - Gets or sets the current macroblock Y. - - - - - Gets the input samples. - - - - - Gets or sets the output samples. - - - - - Gets or sets the secondary buffer swapped with YuvOut. - - - - - Gets the scratch buffer for prediction. - - - - - Gets the left luma samples. - - - - - Gets the left uv samples. - - - - - Gets the left error diffusion (u/v). - - - - - Gets the top luma samples at position 'X'. - - - - - Gets the top u/v samples at position 'X', packed as 16 bytes. - - - - - Gets the intra mode predictors (4x4 blocks). - - - - - Gets the current start index of the intra mode predictors. - - - - - Gets the non-zero pattern. - - - - - Gets the top diffusion error. - - - - - Gets 32+5 boundary samples needed by intra4x4. - - - - - Gets or sets the index to the current top boundary sample. - - - - - Gets or sets the current intra4x4 mode being tested. - - - - - Gets the top-non-zero context. - - - - - Gets the left-non-zero. leftNz[8] is independent. - - - - - Gets or sets the macroblock bit-cost for luma. - - - - - Gets the bit counters for coded levels. - - - - - Gets or sets the macroblock bit-cost for chroma. - - - - - Gets or sets the number of mb still to be processed. - - - - - Gets the byte scratch buffer. - - - - - Gets the short scratch buffer. - - - - - Gets the int scratch buffer. - - - - - Returns true if iteration is finished. - - True if iterator is finished. - - - - Go to next macroblock. - - Returns false if not finished. - - - - Restart a scan. - - - - - Reset iterator position to row 'y'. - - The y position. - - - - Set count down. - - Number of iterations to go. - - - - Encoder for lossy webp images. - - - - - The to use for buffer allocations. - - - - - The global configuration. - - - - - The quality, that will be used to encode the image. - - - - - Quality/speed trade-off (0=fast, 6=slower-better). - - - - - Number of entropy-analysis passes (in [1..10]). - - - - - Specify the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). A value of 0 will turn off any filtering. - - - - - The spatial noise shaping. 0=off, 100=maximum. - - - - - A bit writer for writing lossy webp streams. - - - - - Global susceptibility. - - - - - U/V quantization susceptibility. - - - - - Initializes a new instance of the class. - - The memory allocator. - The global configuration. - The width of the input image. - The height of the input image. - The encoding quality. - Quality/speed trade-off (0=fast, 6=slower-better). - Number of entropy-analysis passes (in [1..10]). - The filter the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). - The spatial noise shaping. 0=off, 100=maximum. - If true, the alpha channel will be compressed with the lossless compression. - - - - Gets the probabilities. - - - - - Gets the segment features. - - - - - Gets the segment infos. - - - - - Gets the macro block info's. - - - - - Gets the filter header. - - - - - Gets or sets the global susceptibility. - - - - - Gets the width of the image. - - - - - Gets the height of the image. - - - - - Gets the stride of the prediction plane (=4*mb_w + 1) - - - - - Gets the macroblock width. - - - - - Gets the macroblock height. - - - - - Gets the luma component. - - - - - Gets the chroma U component. - - - - - Gets the chroma U component. - - - - - Gets the top luma samples. - - - - - Gets the top u/v samples. U and V are packed into 16 bytes (8 U + 8 V). - - - - - Gets the non-zero pattern. - - - - - Gets the prediction modes: (4*mbw+1) * (4*mbh+1). - - - - - Gets the diffusion error. - - - - - Gets a rough limit for header bits per MB. - - - - - Encodes the image to the specified stream from the . - - The pixel format. - The to encode from. - The to encode the image data to. - - - - - - - Only collect statistics(number of skips, token usage, ...). - This is used for deciding optimal probabilities. It also modifies the - quantizer value if some target (size, PSNR) was specified. - - - - - Same as CodeResiduals, but doesn't actually write anything. - Instead, it just records the event distribution. - - - - - We want to emulate jpeg-like behaviour where the expected "good" quality - is around q=75. Internally, our "good" middle is around c=50. So we - map accordingly using linear piece-wise function - - - - - Methods for encoding a VP8 frame. - - - - - Last (inclusive) level with variable cost. - - - - - Value below which using skipProba is OK. - - - - - Initializes a new instance of the class. - - - - - Gets the probabilities for segment tree. - - - - - Gets or sets the final probability of being skipped. - - - - - Gets or sets a value indicating whether to use the skip probability. - - - - - Gets or sets the number of skipped blocks. - - - - - Gets or sets a value indicating whether CalculateLevelCosts() needs to be called. - - - - - Initializes a new instance of the class. - - Number of segments. - - - - Gets the actual number of segments. 1 segment only = unused. - - - - - Gets or sets a value indicating whether to update the segment map or not. Must be false if there's only 1 segment. - - - - - Gets or sets the bit-cost for transmitting the segment map. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the loop filter. - - - - - Gets or sets the filter level. Valid values are [0..63]. - - - - - Gets or sets the filter sharpness. Valid values are [0..7]. - - - - - Gets or sets a value indicating whether the filtering type is: 0=complex, 1=simple. - - - - - Gets or sets delta filter level for i4x4 relative to i16x16. - - - - - Filter information. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The filter info to create a copy from. - - - - Gets or sets the filter limit in [3..189], or 0 if no filtering. - - - - - Gets or sets the inner limit in [1..63], or 0 if no filtering. - - - - - Gets or sets a value indicating whether to do inner filtering. - - - - - Gets or sets the high edge variance threshold in [0..2]. - - - - - - - - Vp8 frame header information. - - - - - Gets or sets a value indicating whether this is a key frame. - - - - - Gets or sets Vp8 profile [0..3]. - - - - - Gets or sets the partition length. - - - - - Size of histogram used by CollectHistogram. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the picture width in pixels (invariable). - The actual area passed to put() is stored in /> field. - - - - - Gets or sets the picture height in pixels (invariable). - The actual area passed to put() is stored in /> field. - - - - - Gets or sets the y-position of the current macroblock. - - - - - Gets or sets number of columns in the sample. - - - - - Gets or sets number of rows in the sample. - - - - - Gets or sets the luma component. - - - - - Gets or sets the U chroma component. - - - - - Gets or sets the V chroma component. - - - - - Gets or sets the row stride for luma. - - - - - Gets or sets the row stride for chroma. - - - - - Contextual macroblock information. - - - - - Gets or sets non-zero AC/DC coeffs (4bit for luma + 4bit for chroma). - - - - - Gets or sets non-zero DC coeff (1bit). - - - - - Data needed to reconstruct a macroblock. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the coefficients. 384 coeffs = (16+4+4) * 4*4. - - - - - Gets or sets a value indicating whether its intra4x4. - - - - - Gets the modes. One 16x16 mode (#0) or sixteen 4x4 modes. - - - - - Gets or sets the chroma prediction mode. - - - - - Gets or sets bit-wise info about the content of each sub-4x4 blocks (in decoding order). - Each of the 4x4 blocks for y/u/v is associated with a 2b code according to: - code=0 -> no coefficient - code=1 -> only DC - code=2 -> first three coefficients are non-zero - code=3 -> more than three coefficients are non-zero - This allows to call specialized transform functions. - - - - - Gets or sets bit-wise info about the content of each sub-4x4 blocks (in decoding order). - Each of the 4x4 blocks for y/u/v is associated with a 2b code according to: - code=0 -> no coefficient - code=1 -> only DC - code=2 -> first three coefficients are non-zero - code=3 -> more than three coefficients are non-zero - This allows to call specialized transform functions. - - - - - Number of descaling bits for sharpening bias. - - - - - The quantizer steps. - - - - - The reciprocals, fixed point. - - - - - The rounding bias. - - - - - The value below which a coefficient is zeroed. - - - - - The frequency boosters for slight sharpening. - - - - - Returns the average quantizer. - - The average quantizer. - - - - Class to accumulate score and info during RD-optimization and mode evaluation. - - - - - Distortion multiplier (equivalent of lambda). - - - - - Initializes a new instance of the class. - - - - - Gets or sets the distortion. - - - - - Gets or sets the spectral distortion. - - - - - Gets or sets the header bits. - - - - - Gets or sets the rate. - - - - - Gets or sets the score. - - - - - Gets the quantized levels for luma-DC. - - - - - Gets the quantized levels for luma-AC. - - - - - Gets the quantized levels for chroma. - - - - - Gets or sets the mode number for intra16 prediction. - - - - - Gets the mode numbers for intra4 predictions. - - - - - Gets or sets the mode number of chroma prediction. - - - - - Gets or sets the Non-zero blocks. - - - - - Gets the diffusion errors. - - - - - Gets or sets the width of the image. - - - - - Gets or sets the Height of the image. - - - - - Gets or sets the horizontal scale. - - - - - Gets or sets the vertical scale. - - - - - Gets or sets the colorspace. - 0 - YUV color space similar to the YCrCb color space defined in. - 1 - Reserved for future use. - - - - - Gets or sets the clamp type. - 0 - Decoders are required to clamp the reconstructed pixel values to between 0 and 255 (inclusive). - 1 - Reconstructed pixel values are guaranteed to be between 0 and 255; no clamping is necessary. - - - - - Data for all frame-persistent probabilities. - - - - - Initializes a new instance of the class. - - - - - Probabilities associated to one of the contexts. - - - - - Initializes a new instance of the class. - - - - - Gets the probabilities. - - - - - Gets or sets the U/V quantizer value. - - - - - Gets or sets the dithering amplitude (0 = off, max=255). - - - - - Rate-distortion optimization levels - - - - - No rd-opt. - - - - - Basic scoring (no trellis). - - - - - Perform trellis-quant on the final decision only. - - - - - Trellis-quant for every scoring (much slower). - - - - - On-the-fly info about the current set of residuals. - - - - - Segment features. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value indicating whether to update the segment map or not. - - - - - Gets or sets a value indicating whether to use delta values for quantizer and filter. - If this value is false, absolute values are used. - - - - - Gets quantization changes. - - - - - Gets the filter strength for segments. - - - - - Gets the quantization matrix y1. - - - - - Gets the quantization matrix y2. - - - - - Gets the quantization matrix uv. - - - - - Gets or sets the quant-susceptibility, range [-127,127]. Zero is neutral. Lower values indicate a lower risk of blurriness. - - - - - Gets or sets the filter-susceptibility, range [0,255]. - - - - - Gets or sets the final segment quantizer. - - - - - Gets or sets the final in-loop filtering strength. - - - - - Gets or sets the max edge delta (for filtering strength). - - - - - Gets or sets the penalty for using Intra4. - - - - - Gets or sets the minimum distortion required to trigger filtering record. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Decoder for lossy webp images. This code is a port of libwebp, which can be found here: https://chromium.googlesource.com/webm/libwebp - - - The lossy specification can be found here: https://tools.ietf.org/html/rfc6386 - - - - - A bit reader for reading lossy webp streams. - - - - - Used for allocating memory during processing operations. - - - - - The global configuration. - - - - - Scratch buffer to reduce allocations. - - - - - Another scratch buffer to reduce allocations. - - - - - Initializes a new instance of the class. - - Bitreader to read from the stream. - Used for allocating memory during processing operations. - The configuration. - - - - Fixed-point precision for RGB->YUV. - - - - - Converts the RGB values of the image to YUV. - - The pixel type of the image. - The image to convert. - The global configuration. - The memory allocator. - Span to store the luma component of the image. - Span to store the u component of the image. - Span to store the v component of the image. - true, if the image contains alpha data. - - - - Converts a rgba pixel row to Y. - - The row span to convert. - The destination span for y. - The width. - - - - Converts a rgb row of pixels to UV. - - The RGB pixel row. - The destination span for u. - The destination span for v. - The width. - - - - No compression. - - - - - Compressed using the Webp lossless format. - - - - - Enum for the different alpha filter types. - - - - - No filtering. - - - - - Horizontal filter. - - - - - Vertical filter. - - - - - Gradient filter. - - - - - Enumerates the available bits per pixel the webp image uses. - - - - - 24 bits per pixel. Each pixel consists of 3 bytes. - - - - - 32 bits per pixel. Each pixel consists of 4 bytes (an alpha channel is present). - - - - - Contains a list of different webp chunk types. - - See Webp Container Specification for more details: https://developers.google.com/speed/webp/docs/riff_container - - - - Header signaling the use of the VP8 format. - - - - - Header signaling the image uses lossless encoding. - - - - - Header for a extended-VP8 chunk. - - - - - Chunk contains information about the alpha channel. - - - - - Chunk which contains a color profile. - - - - - Chunk which contains EXIF metadata about the image. - - - - - Chunk contains XMP metadata about the image. - - - - - For an animated image, this chunk contains the global parameters of the animation. - - - - - For animated images, this chunk contains information about a single frame. If the Animation flag is not set, then this chunk SHOULD NOT be present. - - - - - Utility methods for lossy and lossless webp format. - - - - - Checks if the pixel row is not opaque. - - The row to check. - Returns true if alpha has non-0xff values. - - - - Registers the image encoders, decoders and mime type detectors for the webp format. - - - - - - - - Constants used for encoding and decoding VP8 and VP8L bitstreams. - - - - - The list of file extensions that equate to Webp. - - - - - The list of mimetypes that equate to a jpeg. - - - - - Signature which identifies a VP8 header. - - - - - Signature byte which identifies a VP8L header. - - - - - Signature bytes identifying a lossy image. - - - - - Signature bytes identifying a lossless image. - - - - - Signature bytes identifying a VP8X header. - - - - - The header bytes identifying RIFF file. - - - - - The header bytes identifying a Webp. - - - - - 3 bits reserved for version. - - - - - Bits for width and height infos of a VPL8 image. - - - - - Size of the frame header within VP8 data. - - - - - Size of a VP8X chunk in bytes. - - - - - Size of a chunk header. - - - - - Size of the RIFF header ("RIFFnnnnWEBP"). - - - - - Size of a chunk tag (e.g. "VP8L"). - - - - - The Vp8L version 0. - - - - - Maximum number of histogram images (sub-blocks). - - - - - Minimum number of Huffman bits. - - - - - Maximum number of Huffman bits. - - - - - The maximum number of colors for a paletted images. - - - - - Maximum number of color cache bits is 10. - - - - - The maximum number of allowed transforms in a VP8L bitstream. - - - - - Maximum value of transformBits in VP8LEncoder. - - - - - The bit to be written when next data to be read is a transform. - - - - - The maximum allowed width or height of a webp image. - - - - - 8b of precision for susceptibilities. - - - - - Scaling factor for alpha. - - - - - Neutral value for susceptibility. - - - - - Lowest usable value for susceptibility. - - - - - Higher meaningful value for susceptibility. - - - - - Scaling constant between the sns (Spatial Noise Shaping) value and the QP power-law modulation. Must be strictly less than 1. - - - - - Very small filter-strength values have close to no visual effect. So we can - save a little decoding-CPU by turning filtering off for these. - - - - - Max size of mode partition. - - - - - Distortion multiplier (equivalent of lambda). - - - - - How many extra lines are needed on the MB boundary for caching, given a filtering level. - Simple filter(1): up to 2 luma samples are read and 1 is written. - Complex filter(2): up to 4 luma samples are read and 3 are written. Same for U/V, so it's 8 samples total (because of the 2x upsampling). - - - - - Image decoder for generating an image out of a webp stream. - - - - - Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - - - - - - - - - - Performs the webp decoding operation. - - - - - Reusable buffer. - - - - - Used for allocating memory during processing operations. - - - - - The stream to decode from. - - - - - The webp specific metadata. - - - - - Information about the webp image. - - - - - Initializes a new instance of the class. - - The configuration. - The options. - - - - Gets a value indicating whether the metadata should be ignored when the image is being decoded. - - - - - Gets the decoded by this decoder instance. - - - - - - - - Gets the dimensions of the image. - - - - - - - - - - - Reads and skips over the image header. - - The file size in bytes. - - - - Reads information present in the image header, about the image content and how to decode the image. - - Information about the webp image. - - - - Reads an the extended webp file header. An extended file header consists of: - - A 'VP8X' chunk with information about features used in the file. - - An optional 'ICCP' chunk with color profile. - - An optional 'XMP' chunk with metadata. - - An optional 'ANIM' chunk with animation control data. - - An optional 'ALPH' chunk with alpha channel data. - After the image header, image data will follow. After that optional image metadata chunks (EXIF and XMP) can follow. - - Information about this webp image. - - - - Reads the header of a lossy webp image. - - Webp features. - Information about this webp image. - - - - Reads the header of a lossless webp image. - - Webp image features. - Information about this image. - - - - Parses optional VP8X chunks, which can be ICCP, XMP, ANIM or ALPH chunks. - - The chunk type. - The webp image features. - - - - Parses optional metadata chunks. There SHOULD be at most one chunk of each type ('EXIF' and 'XMP '). - If there are more such chunks, readers MAY ignore all except the first one. - Also, a file may possibly contain both 'EXIF' and 'XMP ' chunks. - - The webp features. - - - - Identifies the chunk type from the chunk. - - - Thrown if the input stream is not valid. - - - - - Reads the chunk size. If Chunk Size is odd, a single padding byte will be added to the payload, - so the chunk size will be increased by 1 in those cases. - - The chunk size in bytes. - - - - Determines if the chunk type is an optional VP8X chunk. - - The chunk type. - True, if its an optional chunk type. - - - - Image encoder for writing an image to a stream in the Webp format. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Image encoder for writing an image to a stream in the Webp format. - - - - - Used for allocating memory during processing operations. - - - - - Indicating whether the alpha plane should be compressed with Webp lossless format. - Defaults to true. - - - - - Compression quality. Between 0 and 100. - - - - - Quality/speed trade-off (0=fast, 6=slower-better). - - - - - The number of entropy-analysis passes (in [1..10]). - - - - - Spatial Noise Shaping. 0=off, 100=maximum. - - - - - The filter the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). - - - - - Flag indicating whether to preserve the exact RGB values under transparent area. Otherwise, discard this invisible - RGB information for better compression. - - - - - Indicating whether near lossless mode should be used. - - - - - The near lossless quality. The range is 0 (maximum preprocessing) to 100 (no preprocessing, the default). - - - - - Indicating what file format compression should be used. - Defaults to lossy. - - - - - The global configuration. - - - - - Initializes a new instance of the class. - - The encoder options. - The memory manager. - - - - Encodes the image as webp to the specified stream. - - The pixel format. - The to encode from. - The to encode the image data to. - The token to monitor for cancellation requests. - - - - Quality/speed trade-off for the encoding process (0=fast, 6=slower-better). - - - - - Fastest, but quality compromise. Equivalent to . - - - - - Fastest, but quality compromise. - - - - - Level1. - - - - - Level 2. - - - - - Level 3. - - - - - Level 4. Equivalent to . - - - - - BestQuality trade off between speed and quality. - - - - - Level 5. - - - - - Slowest option, but best quality. Equivalent to . - - - - - Slowest option, but best quality. - - - - - Image features of a VP8X image. - - - - - Gets or sets a value indicating whether this image has an ICC Profile. - - - - - Gets or sets a value indicating whether this image has an alpha channel. - - - - - Gets or sets the alpha data, if an ALPH chunk is present. - - - - - Gets or sets the alpha chunk header. - - - - - Gets or sets a value indicating whether this image has an EXIF Profile. - - - - - Gets or sets a value indicating whether this image has XMP Metadata. - - - - - Gets or sets a value indicating whether this image is an animation. - - - - - - - - Info about the webp file format used. - - - - - The lossless webp format. - - - - - The lossy webp format. - - - - - Registers the image encoders, decoders and mime type detectors for the Webp format - - - - - Gets the current instance. - - - - - - - - - - - - - - - - - - - - Detects Webp file headers. - - - - - - - - - - - Checks, if the header starts with a valid RIFF FourCC. - - The header bytes. - True, if its a valid RIFF FourCC. - - - - Checks if 'WEBP' is present in the header. - - The header bytes. - True, if its a webp file. - - - - Gets or sets the bitmap width in pixels. - - - - - Gets or sets the bitmap height in pixels. - - - - - Gets or sets the bits per pixel. - - - - - Gets or sets a value indicating whether this image uses lossless compression. - - - - - Gets or sets additional features present in a VP8X image. - - - - - Gets or sets the VP8 profile / version. Valid values are between 0 and 3. Default value will be the invalid value -1. - - - - - Gets or sets the VP8 frame header. - - - - - Gets or sets the VP8L bitreader. Will be null, if its not a lossless image. - - - - - Gets or sets the VP8 bitreader. Will be null, if its not a lossy image. - - - - - - - - Lookup table for small values of log2(int). - - - - - Provides Webp specific metadata information for the image. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The metadata to create an instance from. - - - - Gets or sets the webp file format used. Either lossless or lossy. - - - - - - - - Cold path optimization for throwing -s - - The error message for the exception. - - - - Cold path optimization for throwing -s - - The error message for the exception. - - - - Cold path optimization for throwing -s - - The error message for the exception. - - - - Enum indicating how the transparency should be handled on encoding. - - - - - Discard the transparency information for better compression. - - - - - The transparency will be kept as is. - - - - - Extension methods for the type. - - - Extension methods for the type. - - - Extension methods for the type. - - - Extension methods for the type. - - - Extension methods for the type. - - - Extension methods for the type. - - - Extension methods for the type. - - - Extension methods for the type. - - - - - Gets the bmp format specific metadata for the image. - - The metadata this method extends. - The . - - - - Gets the gif format specific metadata for the image. - - The metadata this method extends. - The . - - - - Gets the gif format specific metadata for the image frame. - - The metadata this method extends. - The . - - - - Gets the jpeg format specific metadata for the image. - - The metadata this method extends. - The . - - - - Gets the pbm format specific metadata for the image. - - The metadata this method extends. - The . - - - - Gets the png format specific metadata for the image. - - The metadata this method extends. - The . - - - - Gets the tga format specific metadata for the image. - - The metadata this method extends. - The . - - - - Gets the tiff format specific metadata for the image. - - The metadata this method extends. - The . - - - - Gets the tiff format specific metadata for the image frame. - - The metadata this method extends. - The . - - - - Gets the webp format specific metadata for the image. - - The metadata this method extends. - The . - - - - Extension methods for the type. - - - Extension methods for the type. - - - Contains internal extensions for - - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Bmp format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Gif format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Jpeg format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Pbm format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Png format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Tga format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Webp format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The file path to save the image to. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The file path to save the image to. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - Thrown if the path is null. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the path is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The stream to save the image to. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The stream to save the image to. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream is null. - - - - Saves the image to the given stream with the Tiff format. - - The image this method extends. - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream is null. - A representing the asynchronous operation. - - - - Writes the image to the given file path using an encoder detected from the path. - - The source image. - The file path to save the image to. - The path is null. - No encoder available for provided path. - - - - Writes the image to the given file path using an encoder detected from the path. - - The source image. - The file path to save the image to. - The token to monitor for cancellation requests. - The path is null. - No encoder available for provided path. - A representing the asynchronous operation. - - - - Writes the image to the given file path using the given image encoder. - - The source image. - The file path to save the image to. - The encoder to save the image with. - The path is null. - The encoder is null. - - - - Writes the image to the given file path using the given image encoder. - - The source image. - The file path to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - The path is null. - The encoder is null. - A representing the asynchronous operation. - - - - Writes the image to the given stream using the given image format. - - The source image. - The stream to save the image to. - The format to save the image in. - The stream is null. - The format is null. - The stream is not writable. - No encoder available for provided format. - - - - Writes the image to the given stream using the given image format. - - The source image. - The stream to save the image to. - The format to save the image in. - The token to monitor for cancellation requests. - The stream is null. - The format is null. - The stream is not writable. - No encoder available for provided format. - A representing the asynchronous operation. - - - - Returns a Base64 encoded string from the given image. - The result is prepended with a Data URI - - - For example: - - - - - The source image - The format. - The format is null. - The - - - - Locks the image providing access to the pixels. - - It is imperative that the accessor is correctly disposed off after use. - - - The type of the pixel. - The image. - - The - - - - - Utility class for common geometric functions. - - - - - Converts a degree (360-periodic) angle to a radian (2*Pi-periodic) angle. - - The angle in degrees. - - The representing the degree as radians. - - - - - Converts a radian (2*Pi-periodic) angle to a degree (360-periodic) angle. - - The angle in radians. - - The representing the degree as radians. - - - - - Adds extensions that allow the processing of images to the type. - - - - - Sets the default options against the image processing context. - - The image processing context to store default against. - The action to update instance of the default options used. - The passed in to allow chaining. - - - - Sets the default options against the configuration. - - The configuration to store default against. - The default options to use. - - - - Sets the default options against the image processing context. - - The image processing context to store default against. - The default options to use. - The passed in to allow chaining. - - - - Sets the default options against the configuration. - - The configuration to store default against. - The default options to use. - - - - Gets the default options against the image processing context. - - The image processing context to retrieve defaults from. - The globaly configued default options. - - - - Gets the default options against the image processing context. - - The configuration to retrieve defaults from. - The globaly configued default options. - - - - Options for influencing the drawing functions. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value indicating whether antialiasing should be applied. - Defaults to true. - - - - - Gets or sets a value indicating the number of subpixels to use while rendering with antialiasing enabled. - Defaults to 16. - - - - - Gets or sets a value between indicating the blending percentage to apply to the drawing operation. - Range 0..1; Defaults to 1. - - - - - Gets or sets a value indicating the color blending mode to apply to the drawing operation. - Defaults to . - - - - - Gets or sets a value indicating the alpha composition mode to apply to the drawing operation - Defaults to . - - - - - - - - Represents an interface that can register image encoders, decoders and image format detectors. - - - - - Called when loaded into a configuration object so the module can register items into the configuration. - - The configuration that will retain the encoders, decodes and mime type detectors. - - - - A generic interface for a deeply cloneable type. - - The type of object to clone. - - - - Creates a new that is a deep copy of the current instance. - - The . - - - - An interface for objects that can be cloned. This creates a deep copy of the object. - - - - - Creates a new object that is a deep copy of the current instance. - - The . - - - - Encapsulates the properties and methods that describe an image. - - - - - Encapsulates properties that describe basic image information including dimensions, pixel type information - and additional metadata. - - - - - Gets information about the image pixels. - - - - - Gets the width. - - - - - Gets the height. - - - - - Gets the metadata of the image. - - - - - Encapsulates an image, which consists of the pixel data for a graphics image and its attributes. - For the non-generic type, the pixel type is only known at runtime. - is always implemented by a pixel-specific instance. - - - Adds static methods allowing the decoding of new images. - - - Adds static methods allowing the creation of new image from a byte array. - - - Adds static methods allowing the creation of new image from a given file. - - - Adds static methods allowing the creation of new image from a given stream. - - - Adds static methods allowing the creation of new image from raw pixel data. - - - Adds static methods allowing wrapping an existing memory area as an image. - - - - - Initializes a new instance of the class. - - - The configuration which allows altering default behaviour or extending the library. - - The . - The . - The . - - - - Initializes a new instance of the class. - - - - - Gets the implementing the public property. - - - - - - - - - - - - - - - - - Gets the frames of the image as (non-generic) . - - - - - - - - - - - Saves the image to the given stream using the given image encoder. - - The stream to save the image to. - The encoder to save the image with. - Thrown if the stream or encoder is null. - - - - Saves the image to the given stream using the given image encoder. - - The stream to save the image to. - The encoder to save the image with. - The token to monitor for cancellation requests. - Thrown if the stream or encoder is null. - A representing the asynchronous operation. - - - - Returns a copy of the image in the given pixel format. - - The pixel format. - The - - - - Returns a copy of the image in the given pixel format. - - The pixel format. - The configuration providing initialization code which allows extending the library. - The . - - - - Update the size of the image after mutation. - - The . - - - - Disposes the object and frees resources for the Garbage Collector. - - Whether to dispose of managed and unmanaged objects. - - - - Throws if the image is disposed. - - - - - Accepts a . - Implemented by invoking - with the pixel type of the image. - - The visitor. - - - - Accepts a . - Implemented by invoking - with the pixel type of the image. - - The visitor. - The token to monitor for cancellation requests. - - - - Creates an instance backed by an uninitialized memory buffer. - This is an optimized creation method intended to be used by decoders. - The image might be filled with memory garbage. - - The pixel type - The - The width of the image - The height of the image - The - The result - - - - By reading the header on the provided stream this calculates the images format. - - The image stream to read the header from. - The configuration. - The mime type or null if none found. - - - - By reading the header on the provided stream this calculates the images format. - - The image stream to read the header from. - The configuration. - The IImageFormat. - The image format or null if none found. - - - - Decodes the image stream to the current image. - - The stream. - the configuration. - The token to monitor for cancellation requests. - The pixel format. - - A new . - - - - - Reads the raw image information from the specified stream. - - The stream. - the configuration. - The token to monitor for cancellation requests. - - The or null if a suitable info detector is not found. - - - - - By reading the header on the provided byte array this calculates the images format. - - The byte array containing encoded image data to read the header from. - The data is null. - The format or null if none found. - - - - By reading the header on the provided byte array this calculates the images format. - - The configuration. - The byte array containing encoded image data to read the header from. - The configuration is null. - The data is null. - The mime type or null if none found. - - - - Reads the raw image information from the specified stream without fully decoding it. - - The byte array containing encoded image data to read the header from. - The data is null. - The data is not readable. - - The or null if suitable info detector not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The byte array containing encoded image data to read the header from. - The format type of the decoded image. - The data is null. - The data is not readable. - - The or null if suitable info detector not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The byte array containing encoded image data to read the header from. - The format type of the decoded image. - The configuration is null. - The data is null. - The data is not readable. - - The or null if suitable info detector is not found. - - - - - Load a new instance of from the given encoded byte array. - - The byte array containing image data. - The configuration is null. - The data is null. - A new . - - - - Load a new instance of from the given encoded byte array. - - The byte array containing encoded image data. - The pixel format. - The data is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A new . - - - - Load a new instance of from the given encoded byte array. - - The byte array containing image data. - The mime type of the decoded image. - The pixel format. - The data is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A new . - - - - Load a new instance of from the given encoded byte array. - - The configuration options. - The byte array containing encoded image data. - The pixel format. - The configuration is null. - The data is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A new . - - - - Load a new instance of from the given encoded byte array. - - The configuration options. - The byte array containing encoded image data. - The of the decoded image. - The pixel format. - The configuration is null. - The data is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A new . - - - - Load a new instance of from the given encoded byte array. - - The byte array containing encoded image data. - The decoder. - The pixel format. - The data is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A new . - - - - Load a new instance of from the given encoded byte array. - - The Configuration. - The byte array containing encoded image data. - The decoder. - The pixel format. - The configuration is null. - The data is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A new . - - - - By reading the header on the provided byte span this calculates the images format. - - The byte span containing encoded image data to read the header from. - The format or null if none found. - - - - By reading the header on the provided byte span this calculates the images format. - - The configuration. - The byte span containing encoded image data to read the header from. - The configuration is null. - The mime type or null if none found. - - - - Load a new instance of from the given encoded byte span. - - The byte span containing encoded image data. - The pixel format. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - A new . - - - - Load a new instance of from the given encoded byte span. - - The byte span containing image data. - The mime type of the decoded image. - The pixel format. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - A new . - - - - Load a new instance of from the given encoded byte span. - - The byte span containing encoded image data. - The decoder. - The pixel format. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - A new . - - - - Load a new instance of from the given encoded byte span. - - The configuration options. - The byte span containing encoded image data. - The pixel format. - The configuration is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - A new . - - - - Load a new instance of from the given encoded byte span. - - The Configuration. - The byte span containing image data. - The decoder. - The pixel format. - The configuration is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - A new . - - - - Load a new instance of from the given encoded byte span. - - The configuration options. - The byte span containing image data. - The of the decoded image. - The pixel format. - The configuration is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - A new . - - - - Load a new instance of from the given encoded byte array. - - The byte array containing image data. - The detected format. - The configuration is null. - The data is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Load a new instance of from the given encoded byte array. - - The byte array containing encoded image data. - The decoder. - The data is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Load a new instance of from the given encoded byte array. - - The configuration for the decoder. - The byte array containing encoded image data. - The configuration is null. - The data is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Load a new instance of from the given encoded byte array. - - The configuration for the decoder. - The byte array containing image data. - The decoder. - The configuration is null. - The data is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Load a new instance of from the given encoded byte array. - - The configuration for the decoder. - The byte array containing image data. - The mime type of the decoded image. - The configuration is null. - The data is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Load a new instance of from the given encoded byte span. - - The byte span containing image data. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Load a new instance of from the given encoded byte span. - - The byte span containing image data. - The decoder. - The data is null. - The decoder is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Load a new instance of from the given encoded byte array. - - The byte span containing image data. - The detected format. - The decoder is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - Decodes a new instance of from the given encoded byte span. - - The configuration options. - The byte span containing image data. - The . - - - - Load a new instance of from the given encoded byte span. - - The Configuration. - The byte span containing image data. - The decoder. - The configuration is null. - The decoder is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The . - - - - Load a new instance of from the given encoded byte span. - - The configuration options. - The byte span containing image data. - The of the decoded image.> - The configuration is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The . - - - - By reading the header on the provided file this calculates the images mime type. - - The image file to open and to read the header from. - The mime type or null if none found. - - - - By reading the header on the provided file this calculates the images mime type. - - The configuration. - The image file to open and to read the header from. - The configuration is null. - The mime type or null if none found. - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image file to open and to read the header from. - - The or null if suitable info detector not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image file to open and to read the header from. - The format type of the decoded image. - - The or null if suitable info detector not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The image file to open and to read the header from. - The format type of the decoded image. - The configuration is null. - - The or null if suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image file to open and to read the header from. - The token to monitor for cancellation requests. - The configuration is null. - - The representing the asynchronous operation with the parameter type - property set to null if suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The image file to open and to read the header from. - The token to monitor for cancellation requests. - The configuration is null. - - The representing the asynchronous operation with the parameter type - property set to null if suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image file to open and to read the header from. - The token to monitor for cancellation requests. - The configuration is null. - - The representing the asynchronous operation with the parameter type - property set to null if suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The image file to open and to read the header from. - The token to monitor for cancellation requests. - The configuration is null. - - The representing the asynchronous operation with the parameter type - property set to null if suitable info detector is not found. - - - - - Create a new instance of the class from the given file. - - The file path to the image. - - Thrown if the stream is not readable nor seekable. - - The . - - - - Create a new instance of the class from the given file. - - The file path to the image. - The mime type of the decoded image. - - Thrown if the stream is not readable nor seekable. - - A new . - - - - Create a new instance of the class from the given file. - - The configuration for the decoder. - The file path to the image. - The configuration is null. - The path is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The . - - - - Create a new instance of the class from the given file. - - The configuration for the decoder. - The file path to the image. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The Configuration. - The file path to the image. - The decoder. - The configuration is null. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The . - - - - Create a new instance of the class from the given file. - - The file path to the image. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The file path to the image. - The decoder. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The file path to the image. - The decoder. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The Configuration. - The file path to the image. - The decoder. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The Configuration. - The file path to the image. - The decoder. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The file path to the image. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The configuration for the decoder. - The file path to the image. - The token to monitor for cancellation requests. - The configuration is null. - The path is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given file. - - The file path to the image. - The decoder. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The . - - - - Create a new instance of the class from the given file. - - The file path to the image. - The path is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The pixel format. - A new . - - - - Create a new instance of the class from the given file. - - The file path to the image. - The mime type of the decoded image. - The path is null. - Image format not recognised. - Image contains invalid content. - Image format is not supported. - The pixel format. - A new . - - - - Create a new instance of the class from the given file. - - The configuration options. - The file path to the image. - The configuration is null. - The path is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given file. - - The configuration options. - The file path to the image. - The mime type of the decoded image. - The configuration is null. - The path is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given file. - The pixel type is selected by the decoder. - - The configuration options. - The file path to the image. - The mime type of the decoded image. - The configuration is null. - The path is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - A new . - - - - Create a new instance of the class from the given file. - - The file path to the image. - The decoder. - The path is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given file. - - The Configuration. - The file path to the image. - The decoder. - The configuration is null. - The path is null. - The decoder is null. - Image format not recognised. - Image format is not supported. - Image contains invalid content. - The pixel format. - A new . - - - - By reading the header on the provided stream this calculates the images format type. - - The image stream to read the header from. - The stream is null. - The stream is not readable. - The format type or null if none found. - - - - By reading the header on the provided stream this calculates the images format type. - - The configuration. - The image stream to read the header from. - The configuration is null. - The stream is null. - The stream is not readable. - The format type or null if none found. - - - - By reading the header on the provided stream this calculates the images format type. - - The image stream to read the header from. - The token to monitor for cancellation requests. - The stream is null. - The stream is not readable. - A representing the asynchronous operation or null if none is found. - - - - By reading the header on the provided stream this calculates the images format type. - - The configuration. - The image stream to read the header from. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable. - A representing the asynchronous operation. - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image stream to read the header from. - The stream is null. - The stream is not readable. - Image contains invalid content. - - The or null if a suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image stream to read the header from. - The token to monitor for cancellation requests. - The stream is null. - The stream is not readable. - Image contains invalid content. - - A representing the asynchronous operation or null if - a suitable detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image stream to read the header from. - The format type of the decoded image. - The stream is null. - The stream is not readable. - Image contains invalid content. - - The or null if a suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The image stream to read the information from. - The configuration is null. - The stream is null. - The stream is not readable. - Image contains invalid content. - - The or null if a suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The image stream to read the information from. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable. - Image contains invalid content. - - A representing the asynchronous operation or null if - a suitable detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The image stream to read the information from. - The format type of the decoded image. - The configuration is null. - The stream is null. - The stream is not readable. - Image contains invalid content. - - The or null if a suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The image stream to read the information from. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable. - Image contains invalid content. - - The representing the asynchronous operation with the parameter type - property set to null if suitable info detector is not found. - - - - - Reads the raw image information from the specified stream without fully decoding it. - - The configuration. - The image stream to read the information from. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable. - Image contains invalid content. - - The representing the asynchronous operation with the parameter type - property set to null if suitable info detector is not found. - - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The stream containing image information. - The format type of the decoded image. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The . - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The stream containing image information. - The token to monitor for cancellation requests. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A representing the asynchronous operation. - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The stream containing image information. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The . - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The stream containing image information. - The token to monitor for cancellation requests. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A representing the asynchronous operation. - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The stream containing image information. - The decoder. - The stream is null. - The decoder is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The . - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The stream containing image information. - The decoder. - The token to monitor for cancellation requests. - The stream is null. - The decoder is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A representing the asynchronous operation. - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The configuration for the decoder. - The stream containing image information. - The decoder. - The configuration is null. - The stream is null. - The decoder is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A new . - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The configuration for the decoder. - The stream containing image information. - The decoder. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The decoder is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A representing the asynchronous operation. - - - - Decode a new instance of the class from the given stream. - - The configuration for the decoder. - The stream containing image information. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A new . - - - - Decode a new instance of the class from the given stream. - - The configuration for the decoder. - The stream containing image information. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The stream containing image information. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given stream. - - The stream containing image information. - The token to monitor for cancellation requests. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The stream containing image information. - The format type of the decoded image. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given stream. - - The stream containing image information. - The token to monitor for cancellation requests. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The stream containing image information. - The decoder. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given stream. - - The stream containing image information. - The decoder. - The token to monitor for cancellation requests. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The Configuration. - The stream containing image information. - The decoder. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given stream. - - The Configuration. - The stream containing image information. - The decoder. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The configuration options. - The stream containing image information. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A new . - - - - Create a new instance of the class from the given stream. - - The configuration options. - The stream containing image information. - The format type of the decoded image. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The configuration options. - The stream containing image information. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The configuration options. - The stream containing image information. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Create a new instance of the class from the given stream. - - The configuration options. - The stream containing image information. - The token to monitor for cancellation requests. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - The pixel format. - A representing the asynchronous operation. - - - - Decode a new instance of the class from the given stream. - The pixel format is selected by the decoder. - - The configuration options. - The stream containing image information. - The format type of the decoded image. - The configuration is null. - The stream is null. - The stream is not readable or the image format is not supported. - Image format not recognised. - Image contains invalid content. - A new . - - - - Performs the given action against the stream ensuring that it is seekable. - - The type of object returned from the action. - The configuration. - The input stream. - The action to perform. - The . - - - - Performs the given action asynchronously against the stream ensuring that it is seekable. - - The type of object returned from the action. - The configuration. - The input stream. - The action to perform. - The cancellation token. - The . - - - - Create a new instance of the class from the raw data. - - The byte array containing image data. - The width of the final image. - The height of the final image. - The pixel format. - The data length is incorrect. - A new . - - - - Create a new instance of the class from the raw data. - - The byte array containing image data. - The width of the final image. - The height of the final image. - The pixel format. - The data length is incorrect. - A new . - - - - Create a new instance of the class from the given byte array in format. - - The byte array containing image data. - The width of the final image. - The height of the final image. - The pixel format. - The data length is incorrect. - A new . - - - - Create a new instance of the class from the given byte array in format. - - The byte array containing image data. - The width of the final image. - The height of the final image. - The pixel format. - The data length is incorrect. - A new . - - - - Create a new instance of the class from the given byte array in format. - - The configuration for the decoder. - The byte array containing image data. - The width of the final image. - The height of the final image. - The pixel format. - The configuration is null. - The data length is incorrect. - A new . - - - - Create a new instance of the class from the given byte array in format. - - The configuration for the decoder. - The byte array containing image data. - The width of the final image. - The height of the final image. - The pixel format. - The configuration is null. - The data length is incorrect. - A new . - - - - Create a new instance of the class from the raw data. - - The configuration for the decoder. - The Span containing the image Pixel data. - The width of the final image. - The height of the final image. - The pixel format. - The configuration is null. - The data length is incorrect. - A new . - - - - Create a new instance of the class from the raw data. - - The configuration for the decoder. - The Span containing the image Pixel data. - The width of the final image. - The height of the final image. - The configuration is null. - The data length is incorrect. - The pixel format. - A new . - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: using this method does not transfer the ownership of the underlying buffer of the input - to the new instance. This means that consumers of this method must ensure that the input buffer - is either self-contained, (for example, a instance wrapping a new array that was - created), or that the owning object is not disposed until the returned is disposed. - - - If the input instance is one retrieved from an instance - rented from a memory pool (such as ), and that owning instance is disposed while the image is still - in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other - consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately. - - - The pixel type - The - The pixel memory. - The width of the memory image. - The height of the memory image. - The . - The configuration is null. - The metadata is null. - An instance - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: using this method does not transfer the ownership of the underlying buffer of the input - to the new instance. This means that consumers of this method must ensure that the input buffer - is either self-contained, (for example, a instance wrapping a new array that was - created), or that the owning object is not disposed until the returned is disposed. - - - If the input instance is one retrieved from an instance - rented from a memory pool (such as ), and that owning instance is disposed while the image is still - in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other - consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately. - - - The pixel type - The - The pixel memory. - The width of the memory image. - The height of the memory image. - The configuration is null. - An instance. - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: using this method does not transfer the ownership of the underlying buffer of the input - to the new instance. This means that consumers of this method must ensure that the input buffer - is either self-contained, (for example, a instance wrapping a new array that was - created), or that the owning object is not disposed until the returned is disposed. - - - If the input instance is one retrieved from an instance - rented from a memory pool (such as ), and that owning instance is disposed while the image is still - in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other - consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately. - - - The pixel type. - The pixel memory. - The width of the memory image. - The height of the memory image. - An instance. - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, - allowing to view/manipulate it as an instance. - The ownership of the is being transferred to the new instance, - meaning that the caller is not allowed to dispose . - It will be disposed together with the result image. - - The pixel type - The - The that is being transferred to the image - The width of the memory image. - The height of the memory image. - The - The configuration is null. - The metadata is null. - An instance - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, - allowing to view/manipulate it as an instance. - The ownership of the is being transferred to the new instance, - meaning that the caller is not allowed to dispose . - It will be disposed together with the result image. - - The pixel type. - The - The that is being transferred to the image. - The width of the memory image. - The height of the memory image. - The configuration is null. - An instance - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, - allowing to view/manipulate it as an instance. - The ownership of the is being transferred to the new instance, - meaning that the caller is not allowed to dispose . - It will be disposed together with the result image. - - The pixel type - The that is being transferred to the image. - The width of the memory image. - The height of the memory image. - An instance. - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: using this method does not transfer the ownership of the underlying buffer of the input - to the new instance. This means that consumers of this method must ensure that the input buffer - is either self-contained, (for example, a instance wrapping a new array that was - created), or that the owning object is not disposed until the returned is disposed. - - - If the input instance is one retrieved from an instance - rented from a memory pool (such as ), and that owning instance is disposed while the image is still - in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other - consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately. - - - The pixel type - The - The byte memory representing the pixel data. - The width of the memory image. - The height of the memory image. - The . - The configuration is null. - The metadata is null. - An instance - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: using this method does not transfer the ownership of the underlying buffer of the input - to the new instance. This means that consumers of this method must ensure that the input buffer - is either self-contained, (for example, a instance wrapping a new array that was - created), or that the owning object is not disposed until the returned is disposed. - - - If the input instance is one retrieved from an instance - rented from a memory pool (such as ), and that owning instance is disposed while the image is still - in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other - consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately. - - - The pixel type - The - The byte memory representing the pixel data. - The width of the memory image. - The height of the memory image. - The configuration is null. - An instance. - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: using this method does not transfer the ownership of the underlying buffer of the input - to the new instance. This means that consumers of this method must ensure that the input buffer - is either self-contained, (for example, a instance wrapping a new array that was - created), or that the owning object is not disposed until the returned is disposed. - - - If the input instance is one retrieved from an instance - rented from a memory pool (such as ), and that owning instance is disposed while the image is still - in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other - consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately. - - - The pixel type. - The byte memory representing the pixel data. - The width of the memory image. - The height of the memory image. - An instance. - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, - allowing to view/manipulate it as an instance. - The ownership of the is being transferred to the new instance, - meaning that the caller is not allowed to dispose . - It will be disposed together with the result image. - - The pixel type - The - The that is being transferred to the image - The width of the memory image. - The height of the memory image. - The - The configuration is null. - The metadata is null. - An instance - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, - allowing to view/manipulate it as an instance. - The ownership of the is being transferred to the new instance, - meaning that the caller is not allowed to dispose . - It will be disposed together with the result image. - - The pixel type. - The - The that is being transferred to the image. - The width of the memory image. - The height of the memory image. - The configuration is null. - An instance - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, - allowing to view/manipulate it as an instance. - The ownership of the is being transferred to the new instance, - meaning that the caller is not allowed to dispose . - It will be disposed together with the result image. - - The pixel type - The that is being transferred to the image. - The width of the memory image. - The height of the memory image. - An instance. - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: this method relies on callers to carefully manage the target memory area being referenced by the - pointer and that the lifetime of such a memory area is at least equal to that of the returned - instance. For example, if the input pointer references an unmanaged memory area, - callers must ensure that the memory area is not freed as long as the returned is - in use and not disposed. The same applies if the input memory area points to a pinned managed object, as callers - must ensure that objects will remain pinned as long as the instance is in use. - Failing to do so constitutes undefined behavior and will likely lead to memory corruption and runtime crashes. - - - Note also that if you have a or an array (which can be cast to ) of - either or values, it is highly recommended to use one of the other - available overloads of this method instead (such as - or , to make the resulting code less error - prone and avoid having to pin the underlying memory buffer in use. This method is primarily meant to be used when - doing interop or working with buffers that are located in unmanaged memory. - - - The pixel type - The - The pointer to the target memory buffer to wrap. - The width of the memory image. - The height of the memory image. - The . - The configuration is null. - The metadata is null. - An instance - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: this method relies on callers to carefully manage the target memory area being referenced by the - pointer and that the lifetime of such a memory area is at least equal to that of the returned - instance. For example, if the input pointer references an unmanaged memory area, - callers must ensure that the memory area is not freed as long as the returned is - in use and not disposed. The same applies if the input memory area points to a pinned managed object, as callers - must ensure that objects will remain pinned as long as the instance is in use. - Failing to do so constitutes undefined behavior and will likely lead to memory corruption and runtime crashes. - - - Note also that if you have a or an array (which can be cast to ) of - either or values, it is highly recommended to use one of the other - available overloads of this method instead (such as - or , to make the resulting code less error - prone and avoid having to pin the underlying memory buffer in use. This method is primarily meant to be used when - doing interop or working with buffers that are located in unmanaged memory. - - - The pixel type - The - The pointer to the target memory buffer to wrap. - The width of the memory image. - The height of the memory image. - The configuration is null. - An instance. - - - - - Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as - an instance. - - - Please note: this method relies on callers to carefully manage the target memory area being referenced by the - pointer and that the lifetime of such a memory area is at least equal to that of the returned - instance. For example, if the input pointer references an unmanaged memory area, - callers must ensure that the memory area is not freed as long as the returned is - in use and not disposed. The same applies if the input memory area points to a pinned managed object, as callers - must ensure that objects will remain pinned as long as the instance is in use. - Failing to do so constitutes undefined behavior and will likely lead to memory corruption and runtime crashes. - - - Note also that if you have a or an array (which can be cast to ) of - either or values, it is highly recommended to use one of the other - available overloads of this method instead (such as - or , to make the resulting code less error - prone and avoid having to pin the underlying memory buffer in use. This method is primarily meant to be used when - doing interop or working with buffers that are located in unmanaged memory. - - - The pixel type. - The pointer to the target memory buffer to wrap. - The width of the memory image. - The height of the memory image. - An instance. - - - - Represents a pixel-agnostic image frame containing all pixel data and . - In case of animated formats like gif, it contains the single frame in a animation. - In all other cases it is the only frame of the image. - - - Contains methods for loading raw pixel data. - - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The frame width. - The frame height. - The . - - - - Gets the width. - - - - - Gets the height. - - - - - Gets the metadata of the frame. - - - - - - - - Gets the size of the frame. - - The - - - - Gets the bounds of the frame. - - The - - - - - - - Disposes the object and frees resources for the Garbage Collector. - - Whether to dispose of managed and unmanaged objects. - - - - Updates the size of the image frame. - - - - - Create a new instance of the class from the given byte array in format. - - The configuration which allows altering default behaviour or extending the library. - The byte array containing image data. - The width of the final image. - The height of the final image. - The pixel format. - A new . - - - - Create a new instance of the class from the raw data. - - The configuration which allows altering default behaviour or extending the library. - The Span containing the image Pixel data. - The width of the final image. - The height of the final image. - The pixel format. - A new . - - - - Encapsulates a pixel-agnostic collection of instances - that make up an . - - - - - Gets the number of frames. - - - - - Gets the root frame. - - - - - Gets the root frame. (Implements .) - - - - - Gets the at the specified index. - - - The . - - The index. - The at the specified index. - - - - Determines the index of a specific in the . - - The to locate in the . - The index of item if found in the list; otherwise, -1. - - - - Clones and inserts the into the at the specified . - - The zero-based index to insert the frame at. - The to clone and insert into the . - Frame must have the same dimensions as the image. - The cloned . - - - - Clones the frame and appends the clone to the end of the collection. - - The raw pixel data to generate the from. - The cloned . - - - - Removes the frame at the specified index and frees all freeable resources associated with it. - - The zero-based index of the frame to remove. - Cannot remove last frame. - - - - Determines whether the contains the . - - The frame. - - true if the contains the specified frame; otherwise, false. - - - - - Moves an from to . - - The zero-based index of the frame to move. - The index to move the frame to. - - - - Removes the frame at the specified index and creates a new image with only the removed frame - with the same metadata as the original image. - - The zero-based index of the frame to export. - Cannot remove last frame. - The new with the specified frame. - - - - Creates an with only the frame at the specified index - with the same metadata as the original image. - - The zero-based index of the frame to clone. - The new with the specified frame. - - - - Creates a new and appends it to the end of the collection. - - - The new . - - - - - Creates a new and appends it to the end of the collection. - - The background color to initialize the pixels with. - - The new . - - - - - - - - - - - - - - Throws if the image frame is disposed. - - - - - Disposes the object and frees resources for the Garbage Collector. - - Whether to dispose of managed and unmanaged objects. - - - - Implements . - - The enumerator. - - - - Implements the getter of the indexer. - - The index. - The frame. - - - - Implements . - - The index. - The frame. - The new frame. - - - - Implements . - - The frame. - The new frame. - - - - Implements . - - The index. - The new image. - - - - Implements . - - The index. - The new image. - - - - Implements . - - The new frame. - - - - Implements . - - The background color. - The new frame. - - - - Encapsulates a pixel-specific collection of instances - that make up an . - - The type of the pixel. - - - - Gets the number of frames. - - - - - Gets the root frame. - - - - - Gets root frame accessor in unsafe manner without any checks. - - - This property is most likely to be called from for indexing pixels. - already checks if it was disposed before querying for root frame. - - - - - - - - Gets the at the specified index. - - - The . - - The index. - The at the specified index. - - - - - - - Determines the index of a specific in the . - - The to locate in the . - The index of item if found in the list; otherwise, -1. - - - - Clones and inserts the into the at the specified . - - The zero-based index to insert the frame at. - The to clone and insert into the . - Frame must have the same dimensions as the image. - The cloned . - - - - Clones the frame and appends the clone to the end of the collection. - - The raw pixel data to generate the from. - The cloned . - - - - Creates a new frame from the pixel data with the same dimensions as the other frames and inserts the - new frame at the end of the collection. - - The raw pixel data to generate the from. - The new . - - - - Creates a new frame from the pixel data with the same dimensions as the other frames and inserts the - new frame at the end of the collection. - - The raw pixel data to generate the from. - The new . - - - - Removes the frame at the specified index and frees all freeable resources associated with it. - - The zero-based index of the frame to remove. - Cannot remove last frame. - - - - - - - Determines whether the contains the . - - The frame. - - true if the contains the specified frame; otherwise, false. - - - - - Moves an from to . - - The zero-based index of the frame to move. - The index to move the frame to. - - - - Removes the frame at the specified index and creates a new image with only the removed frame - with the same metadata as the original image. - - The zero-based index of the frame to export. - Cannot remove last frame. - The new with the specified frame. - - - - Creates an with only the frame at the specified index - with the same metadata as the original image. - - The zero-based index of the frame to clone. - The new with the specified frame. - - - - Creates a new and appends it to the end of the collection. - - - The new . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Creates a new and appends it to the end of the collection. - - The background color to initialize the pixels with. - - The new . - - - - - - - - - - - - - - Represents a pixel-specific image frame containing all pixel data and . - In case of animated formats like gif, it contains the single frame in a animation. - In all other cases it is the only frame of the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The width of the image in pixels. - The height of the image in pixels. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The of the frame. - The metadata. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The width of the image in pixels. - The height of the image in pixels. - The metadata. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The width of the image in pixels. - The height of the image in pixels. - The color to clear the image with. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The width of the image in pixels. - The height of the image in pixels. - The color to clear the image with. - The metadata. - - - - Initializes a new instance of the class wrapping an existing buffer. - - The configuration providing initialization code which allows extending the library. - The width of the image in pixels. - The height of the image in pixels. - The memory source. - - - - Initializes a new instance of the class wrapping an existing buffer. - - The configuration providing initialization code which allows extending the library. - The width of the image in pixels. - The height of the image in pixels. - The memory source. - The metadata. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The source. - - - - - - - Gets or sets the pixel at the specified position. - - The x-coordinate of the pixel. Must be greater than or equal to zero and less than the width of the image. - The y-coordinate of the pixel. Must be greater than or equal to zero and less than the height of the image. - The at the specified position. - Thrown when the provided (x,y) coordinates are outside the image boundary. - - - - Execute to process image pixels in a safe and efficient manner. - - The defining the pixel operations. - - - - Execute to process pixels of multiple image frames in a safe and efficient manner. - - The second image frame. - The defining the pixel operations. - The pixel type of the second image frame. - - - - Execute to process pixels of multiple image frames in a safe and efficient manner. - - The second image frame. - The third image frame. - The defining the pixel operations. - The pixel type of the second image frame. - The pixel type of the third image frame. - - - - Copy image pixels to . - - The to copy image pixels to. - - - - Copy image pixels to . - - The of to copy image pixels to. - - - - Gets the representation of the pixels as a in the source image's pixel format - stored in row major order, if the backing buffer is contiguous. - - To ensure the memory is contiguous, should be set - to true, preferably on a non-global configuration instance (not ). - - WARNING: Disposing or leaking the underlying image while still working with the 's - might lead to memory corruption. - - The referencing the image buffer. - The indicating the success. - - - - Gets a reference to the pixel at the specified position. - - The x-coordinate of the pixel. Must be greater than or equal to zero and less than the width of the image. - The y-coordinate of the pixel. Must be greater than or equal to zero and less than the height of the image. - The at the specified position. - - - - Copies the pixels to a of the same size. - - The target pixel buffer accessor. - - - - Switches the buffers used by the image and the pixelSource meaning that the Image will "own" the buffer from the pixelSource and the pixelSource will now own the Images buffer. - - The pixel source. - - - - - - - - - - Clones the current instance. - - The - - - - Clones the current instance. - - The configuration providing initialization code which allows extending the library. - The - - - - Returns a copy of the image frame in the given pixel format. - - The pixel format. - The - - - - Returns a copy of the image frame in the given pixel format. - - The pixel format. - The configuration providing initialization code which allows extending the library. - The - - - - Clears the bitmap. - - The value to initialize the bitmap with. - - - - A implementing the clone logic for . - - - - - - - - Contains information about the image including dimensions, pixel type information and additional metadata - - - - - Initializes a new instance of the class. - - The image pixel type information. - The width of the image in pixels. - The height of the image in pixels. - The images metadata. - - - - - - - - - - - - - - - - Extension methods that allow the addition of geometry calculating methods to the type - - - - - Gets the bounds of the image. - - The image info - The - - - - Gets the bounds of the image. - - The image info - The - - - - Encapsulates an image, which consists of the pixel data for a graphics image and its attributes. - For generic -s the pixel type is known at compile time. - - The pixel format. - - - - Initializes a new instance of the class - with the height and the width of the image. - - The configuration providing initialization code which allows extending the library. - The width of the image in pixels. - The height of the image in pixels. - - - - Initializes a new instance of the class - with the height and the width of the image. - - The configuration providing initialization code which allows extending the library. - The width of the image in pixels. - The height of the image in pixels. - The color to initialize the pixels with. - - - - Initializes a new instance of the class - with the height and the width of the image. - - The width of the image in pixels. - The height of the image in pixels. - The color to initialize the pixels with. - - - - Initializes a new instance of the class - with the height and the width of the image. - - The width of the image in pixels. - The height of the image in pixels. - - - - Initializes a new instance of the class - with the height and the width of the image. - - The configuration providing initialization code which allows extending the library. - The width of the image in pixels. - The height of the image in pixels. - The images metadata. - - - - Initializes a new instance of the class - wrapping an external pixel bufferx. - - The configuration providing initialization code which allows extending the library. - Pixel buffer. - The images metadata. - - - - Initializes a new instance of the class - wrapping an external . - - The configuration providing initialization code which allows extending the library. - The memory source. - The width of the image in pixels. - The height of the image in pixels. - The images metadata. - - - - Initializes a new instance of the class - with the height and the width of the image. - - The configuration providing initialization code which allows extending the library. - The width of the image in pixels. - The height of the image in pixels. - The color to initialize the pixels with. - The images metadata. - - - - Initializes a new instance of the class - with the height and the width of the image. - - The configuration providing initialization code which allows extending the library. - The images metadata. - The frames that will be owned by this image instance. - - - - - - - Gets the collection of image frames. - - - - - Gets the root frame. - - - - - Gets or sets the pixel at the specified position. - - The x-coordinate of the pixel. Must be greater than or equal to zero and less than the width of the image. - The y-coordinate of the pixel. Must be greater than or equal to zero and less than the height of the image. - The at the specified position. - Thrown when the provided (x,y) coordinates are outside the image boundary. - - - - Execute to process image pixels in a safe and efficient manner. - - The defining the pixel operations. - - - - Execute to process pixels of multiple images in a safe and efficient manner. - - The second image. - The defining the pixel operations. - The pixel type of the second image. - - - - Execute to process pixels of multiple images in a safe and efficient manner. - - The second image. - The third image. - The defining the pixel operations. - The pixel type of the second image. - The pixel type of the third image. - - - - Copy image pixels to . - - The to copy image pixels to. - - - - Copy image pixels to . - - The of to copy image pixels to. - - - - Gets the representation of the pixels as a in the source image's pixel format - stored in row major order, if the backing buffer is contiguous. - - To ensure the memory is contiguous, should be set - to true, preferably on a non-global configuration instance (not ). - - WARNING: Disposing or leaking the underlying image while still working with the 's - might lead to memory corruption. - - The referencing the image buffer. - The indicating the success. - - - - Clones the current image - - Returns a new image with all the same metadata as the original. - - - - Clones the current image with the given configuration. - - The configuration providing initialization code which allows extending the library. - Returns a new with all the same pixel data as the original. - - - - Returns a copy of the image in the given pixel format. - - The pixel format. - The configuration providing initialization code which allows extending the library. - The . - - - - - - - - - - - - - - - - Switches the buffers used by the image and the pixelSource meaning that the Image will "own" the buffer from the pixelSource and the pixelSource will now own the Images buffer. - - The pixel source. - - - - A pixel-specific image frame where each pixel buffer value represents an index in a color palette. - - The pixel format. - - - - Initializes a new instance of the class. - - - The configuration which allows altering default behaviour or extending the library. - - The frame width. - The frame height. - The color palette. - - - - Gets the configuration which allows altering default behaviour or extending the library. - - - - - Gets the width of this . - - - - - Gets the height of this . - - - - - Gets the color palette of this . - - - - - - - - Gets the representation of the pixels as a of contiguous memory - at row beginning from the first pixel on that row. - - WARNING: Disposing or leaking the underlying while still working with it's - might lead to memory corruption. - - The row index in the pixel buffer. - The pixel row as a . - - - - - Gets the representation of the pixels as a of contiguous memory - at row beginning from the first pixel on that row. - - - Note: Values written to this span are not sanitized against the palette length. - Care should be taken during assignment to prevent out-of-bounds errors. - - - The row index in the pixel buffer. - The pixel row as a . - - - - - - - A readonly stream that add a secondary level buffer in addition to native stream - buffered reading to reduce the overhead of small incremental reads. - - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The input stream. - - - - Gets the size, in bytes, of the underlying buffer. - - - - - - - - - - - - - - - - - - - - Gets the underlying stream. - - - - - - - - - - - - - - - - - - This operation is not supported in . - - - - - - This operation is not supported in . - - - - - - - - Provides an in-memory stream composed of non-contiguous chunks that doesn't need to be resized. - Chunks are allocated by the assigned via the constructor - and is designed to take advantage of buffer pooling when available. - - - - - Initializes a new instance of the class. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copy entire buffer into an array. - - The . - - - - Write remainder of this stream to another stream. - - The stream to write to. - - - - A simple interface representing the filesystem. - - - - - Returns a readable stream as defined by the path. - - Path to the file to open. - A stream representing the file to open. - - - - Creates or opens a file and returns it as a writable stream as defined by the path. - - Path to the file to open. - A stream representing the file to open. - - - - A wrapper around the local File apis. - - - - - - - - - - - Options for allocating buffers. - - - - - Indicates that the buffer should just be allocated. - - - - - Indicates that the allocated buffer should be cleaned following allocation. - - - - - Wraps an array as an instance. - - - - - - Initializes a new instance of the class. - - The array. - The length of the buffer. - - - - Initializes a new instance of the class. - - The array. - - - - Gets the array. - - - - - Gets the length. - - - - - - - - - - - - - - Defines an common interface for ref-counted objects. - - - - - Increments the reference counter. - - - - - Decrements the reference counter. - - - - - Provides a base class for implementations by implementing pinning logic for adaption. - - The element type. - - - - - - - - - - Gets the object that should be pinned. - - The pinnable . - - - - Implements reference counting lifetime guard mechanism for memory resources - and maintains the value of . - - - - - Rent a single buffer. If the pool is full, return . - - - - - Rent buffers or return 'null' if the pool is full. - - - - - Defines a strategy for managing unmanaged memory ownership. - - - - - Allocates and provides an implementation giving - access to unmanaged buffers allocated by . - - The element type. - - - - - - - - - - - - - Encapsulates the functionality around allocating and releasing unmanaged memory. NOT a . - - - - - Gets the total outstanding handle allocations for testing purposes. - - - - - Gets the total number -s retried. - - - - - Memory managers are used to allocate memory for image processing operations. - - - - - Gets the default platform-specific global instance that - serves as the default value for . - - This is a get-only property, - you should set 's - to change the default allocator used by and it's operations. - - - - - Gets the length of the largest contiguous buffer that can be handled by this allocator instance in bytes. - - The length of the largest contiguous buffer that can be handled by this allocator instance. - - - - Creates a default instance of a optimized for the executing platform. - - The . - - - - Creates the default using the provided options. - - The . - The . - - - - Allocates an , holding a of length . - - Type of the data stored in the buffer. - Size of the buffer to allocate. - The allocation options. - A buffer of values of type . - When length is zero or negative. - When length is over the capacity of the allocator. - - - - Releases all retained resources not being in use. - Eg: by resetting array pools and letting GC to free the arrays. - - - - - Allocates a . - - The total length of the buffer. - The expected alignment (eg. to make sure image rows fit into single buffers). - The . - A new . - Thrown when 'blockAlignment' converted to bytes is greater than the buffer capacity of the allocator. - - - - Defines options for creating the default . - - - - - Gets or sets a value defining the maximum size of the 's internal memory pool - in Megabytes. means platform default. - - - - - Implements by newing up managed arrays on every allocation request. - - - - - - - - - - - - - - - - - - - - A implementation that allocates memory on the unmanaged heap - without any pooling. - - - - - Defines extension methods for . - - - - - Gets the backing . - - The buffer. - The element type. - The MemoryGroup. - - - - TODO: Does not work with multi-buffer groups, should be specific to Resize. - Copy columns of inplace, - from positions starting at to positions at . - - - - - Returns a representing the full area of the buffer. - - The element type - The - The - - - - Return a to the subregion represented by 'rectangle' - - The element type - The - The rectangle subregion - The - - - - Return a to the whole area of 'buffer' - - The element type - The - The - - - - Returns the size of the buffer. - - The element type - The - The of the buffer - - - - Gets the bounds of the buffer. - - The - - - - Represents a rectangular region inside a 2D memory buffer (). - - The element type. - - - - Initializes a new instance of the struct. - - The . - The defining a rectangular area within the buffer. - - - - Initializes a new instance of the struct. - - The . - - - - Gets the rectangle specifying the boundaries of the area in . - - - - - Gets the being pointed by this instance. - - - - - Gets the width - - - - - Gets the height - - - - - Gets the pixel stride which is equal to the width of . - - - - - Gets the size of the area. - - - - - Gets a value indicating whether the area refers to the entire - - - - - Gets or sets a value at the given index. - - The position inside a row - The row index - The reference to the value - - - - Gets a span to row 'y' inside this area. - - The row index - The span - - - - Returns a subregion as . (Similar to .) - - The x index at the subregion origin. - The y index at the subregion origin. - The desired width of the subregion. - The desired height of the subregion. - The subregion - - - - Returns a subregion as . (Similar to .) - - The specifying the boundaries of the subregion - The subregion - - - - Gets a reference to the [0,0] element. - - The reference to the [0,0] element - - - - Represents a buffer of value type objects - interpreted as a 2D region of x elements. - - - Before RC1, this class might be target of API changes, use it on your own risk! - - The value type. - - - - Initializes a new instance of the class. - - The to wrap. - The number of elements in a row. - The number of rows. - - - - Gets the width. - - - - - Gets the height. - - - - - Gets the backing . - - The MemoryGroup. - - - - Gets the backing without the view abstraction. - - - This property has been kept internal intentionally. - It's public counterpart is , - which only exposes the view of the MemoryGroup. - - - - - Gets a reference to the element at the specified position. - - The x coordinate (row) - The y coordinate (position at row) - A reference to the element. - When index is out of range of the buffer. - - - - Disposes the instance - - - - - Gets a to the row 'y' beginning from the pixel at the first pixel on that row. - - - This method does not validate the y argument for performance reason, - is being propagated from lower levels. - - The row index. - The of the pixels in the row. - Thrown when row index is out of range. - - - - Gets a to the row 'y' beginning from the pixel at the first pixel on that row. - - The y (row) coordinate. - The . - - - - Gets a to the backing data if the backing group consists of a single contiguous memory buffer. - Throws otherwise. - - The referencing the memory area. - - Thrown when the backing group is discontiguous. - - - - - Gets a to the backing data of if the backing group consists of a single contiguous memory buffer. - Throws otherwise. - - The . - - Thrown when the backing group is discontiguous. - - - - - Swaps the contents of 'destination' with 'source' if the buffers are owned (1), - copies the contents of 'source' to 'destination' otherwise (2). Buffers should be of same size in case 2! - - - - - A custom that can wrap of instances - and cast them to be for any arbitrary unmanaged value type. - - The value type to use when casting the wrapped instance. - - - - The wrapped of instance. - - - - - Initializes a new instance of the class. - - The of instance to wrap. - - - - - - - - - - - - - - - - A custom that can wrap of instances - and cast them to be for any arbitrary unmanaged value type. - - The value type to use when casting the wrapped instance. - - - - Initializes a new instance of the class. - - The of instance to wrap. - - - - - - - - - - Represents discontiguous group of multiple uniformly-sized memory segments. - The last segment can be smaller than the preceding ones. - - The element type. - - - - Gets the number of elements per contiguous sub-buffer preceding the last buffer. - The last buffer is allowed to be smaller. - - - - - Gets the aggregate number of elements in the group. - - - - - Gets a value indicating whether the group has been invalidated. - - - Invalidation usually occurs when an image processor capable to alter the image dimensions replaces - the image buffers internally. - - - - - Returns a value-type implementing an allocation-free enumerator of the memory groups in the current - instance. The return type shouldn't be used directly: just use a block on - the instance in use and the C# compiler will automatically invoke this - method behind the scenes. This method takes precedence over the - implementation, which is still available when casting to one of the underlying interfaces. - - A new instance mapping the current values in use. - - - - A value-type enumerator for instances. - - The element type. - - - - - - - - - - Returns a slice that is expected to be within the bounds of a single buffer. - Otherwise is thrown. - - - - - Cached pointer or array data enabling fast access from - known implementations. - - - - - Implements , defining a view for - rather than owning the segments. - - - This type provides an indirection, protecting the users of publicly exposed memory API-s - from internal memory-swaps. Whenever an internal swap happens, the - instance becomes invalid, throwing an exception on all operations. - - The element type. - - - - - - - - - - - - - Represents discontinuous group of multiple uniformly-sized memory segments. - The underlying buffers may change with time, therefore it's not safe to expose them directly on - and . - - The element type. - - - - A implementation that consumes the underlying memory buffers. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Creates a new memory group, allocating it's buffers with the provided allocator. - - The to use. - The total length of the buffer. - The expected alignment (eg. to make sure image rows fit into single buffers). - The . - A new . - Thrown when 'blockAlignment' converted to bytes is greater than the buffer capacity of the allocator. - - - - Returns the slice of the buffer starting at global index that goes until the end of the buffer. - - - - - A implementation that owns the underlying memory buffers. - - - - - - - - - - - Selects active values in . - - - - - Exception thrown when the library detects an invalid memory allocation request, - or an attempt has been made to use an invalidated . - - - - - Initializes a new instance of the class. - - The exception message text. - - - - Initializes a new instance of the class. - - - - - Extension methods for . - - - - - Allocates a buffer of value type objects interpreted as a 2D region - of x elements. - - The type of buffer items to allocate. - The memory allocator. - The buffer width. - The buffer height. - A value indicating whether the allocated buffer should be contiguous, unless bigger than . - The allocation options. - The . - - - - Allocates a buffer of value type objects interpreted as a 2D region - of x elements. - - The type of buffer items to allocate. - The memory allocator. - The buffer width. - The buffer height. - The allocation options. - The . - - - - Allocates a buffer of value type objects interpreted as a 2D region - of width x height elements. - - The type of buffer items to allocate. - The memory allocator. - The buffer size. - A value indicating whether the allocated buffer should be contiguous, unless bigger than . - The allocation options. - The . - - - - Allocates a buffer of value type objects interpreted as a 2D region - of width x height elements. - - The type of buffer items to allocate. - The memory allocator. - The buffer size. - The allocation options. - The . - - - - Allocates padded buffers. Generally used by encoder/decoders. - - The . - Pixel count in the row - The pixel size in bytes, eg. 3 for RGB. - The padding. - A . - - - - Extension methods for - - - - - Gets a from an instance. - - The buffer - The - - - - Gets the length of an internal buffer. - - The buffer - The length of the buffer - - - - Gets a to an offsetted position inside the buffer. - - The buffer - The start - The - - - - Gets a to an offsetted position inside the buffer. - - The buffer - The start - The length of the slice - The - - - - Clears the contents of this buffer. - - The buffer - - - - Gets a reference to the first item in the internal buffer for an instance. - - The buffer - A reference to the first item within the memory wrapped by - - - - Represents an interval of rows in a and/or - - - Before RC1, this class might be target of API changes, use it on your own risk! - - - - - Initializes a new instance of the struct. - - The inclusive minimum row. - The exclusive maximum row. - - - - Gets the inclusive minimum row. - - - - - Gets the exclusive maximum row. - - - - - Gets the difference ( - ). - - - - - Returns a boolean indicating whether the given two -s are equal. - - The first to compare. - The second to compare. - True if the given -s are equal; False otherwise. - - - - Returns a boolean indicating whether the given two -s are not equal. - - The first to compare. - The second to compare. - True if the given -s are not equal; False otherwise. - - - - - - - - - - - - - - - - A custom that can wrap a rawpointer to a buffer of a specified type. - - The value type to use when casting the wrapped instance. - This manager doesn't own the memory buffer that it points to. - - - - The pointer to the memory buffer. - - - - - The length of the memory area. - - - - - Initializes a new instance of the class. - - The pointer to the memory buffer. - The length of the memory area. - - - - - - - - - - - - - - - - Enumerated frame process modes to apply to multi-frame images. - - - - - Decodes all the frames of a multi-frame image. - - - - - Decodes only the first frame of a multi-frame image. - - - - - Encapsulates the metadata of an image frame. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - by making a copy from other metadata. - - - The other to create this instance from. - - - - - Gets or sets the Exif profile. - - - - - Gets or sets the XMP profile. - - - - - Gets or sets the list of ICC profiles. - - - - - Gets or sets the iptc profile. - - - - - - - - Gets the metadata value associated with the specified key. - - The type of format metadata. - The type of format frame metadata. - The key of the value to get. - - The . - - - - - Encapsulates the metadata of an image. - - - - - The default horizontal resolution value (dots per inch) in x direction. - The default value is 96 . - - - - - The default vertical resolution value (dots per inch) in y direction. - The default value is 96 . - - - - - The default pixel resolution units. - The default value is . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - by making a copy from other metadata. - - - The other to create this instance from. - - - - - Gets or sets the resolution of the image in x- direction. - It is defined as the number of dots per and should be an positive value. - - The density of the image in x- direction. - - - - Gets or sets the resolution of the image in y- direction. - It is defined as the number of dots per and should be an positive value. - - The density of the image in y- direction. - - - - Gets or sets unit of measure used when reporting resolution. - - - Value - Unit - - - AspectRatio (00) - No units; width:height pixel aspect ratio = Ydensity:Xdensity - - - PixelsPerInch (01) - Pixels per inch (2.54 cm) - - - PixelsPerCentimeter (02) - Pixels per centimeter - - - PixelsPerMeter (03) - Pixels per meter (100 cm) - - - - - - - Gets or sets the Exif profile. - - - - - Gets or sets the XMP profile. - - - - - Gets or sets the list of ICC profiles. - - - - - Gets or sets the IPTC profile. - - - - - Gets the metadata value associated with the specified key. - - The type of metadata. - The key of the value to get. - - The . - - - - - - - - Synchronizes the profiles with the current metadata. - - - - - Provides enumeration of available pixel density units. - - - - - No units; width:height pixel aspect ratio. - - - - - Pixels per inch (2.54 cm). - - - - - Pixels per centimeter. - - - - - Pixels per meter (100 cm). - - - - - Specifies exif data types. - - - - - Unknown - - - - - An 8-bit unsigned integer. - - - - - An 8-bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL. - - Although the standard defines ASCII this has commonly been ignored as - ASCII cannot properly encode text in many languages. - - - - - - A 16-bit (2-byte) unsigned integer. - - - - - A 32-bit (4-byte) unsigned integer. - - - - - Two LONGs. The first LONG is the numerator and the second LONG expresses the denominator. - - - - - An 8-bit signed integer. - - - - - An 8-bit byte that can take any value depending on the field definition. - - - - - A 16-bit (2-byte) signed integer. - - - - - A 32-bit (4-byte) signed integer (2's complement notation). - - - - - Two SLONGs. The first SLONG is the numerator and the second SLONG is the denominator. - - - - - A 32-bit single precision floating point value. - - - - - A 64-bit double precision floating point value. - - - - - Reference to an IFD (32-bit (4-byte) unsigned integer). - - - - - A 64-bit (8-byte) unsigned integer. - - - - - A 64-bit (8-byte) signed integer (2's complement notation). - - - - - Reference to an IFD (64-bit (8-byte) unsigned integer). - - - - - Gets the size in bytes of the given data type. - - The data type. - - The . - - - Thrown if the type is unsupported. - - - - - Specifies which parts will be written when the profile is added to an image. - - - - - None - - - - - IfdTags - - - - - ExifTags - - - - - GPSTags - - - - - All - - - - - Represents an EXIF profile providing access to the collection of values. - - - - - The byte array to read the EXIF profile from. - - - - - The collection of EXIF values - - - - - The thumbnail offset position in the byte stream - - - - - The thumbnail length in the byte stream - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The byte array to read the EXIF profile from. - - - - Initializes a new instance of the class. - - The values. - The invalid tags. - - - - Initializes a new instance of the class - by making a copy from another EXIF profile. - - The other EXIF profile, where the clone should be made from. - is null.> - - - - Gets or sets which parts will be written when the profile is added to an image. - - - - - Gets the tags that where found but contained an invalid value. - - - - - Gets the values of this EXIF profile. - - - - - Returns the thumbnail in the EXIF profile when available. - - - The . - - - - - Returns the thumbnail in the EXIF profile when available. - - The pixel format. - - The . - - - - - Returns the value with the specified tag. - - The tag of the exif value. - The value with the specified tag. - The data type of the tag. - - - - Removes the value with the specified tag. - - The tag of the EXIF value. - - True, if the value was removed, otherwise false. - - - - - Sets the value of the specified tag. - - The tag of the exif value. - The value. - The data type of the tag. - - - - Converts this instance to a byte array. - - The - - - - - - - Returns the value with the specified tag. - - The tag of the exif value. - The value with the specified tag. - - - - Sets the value of the specified tag. - - The tag of the exif value. - The value. - - - - Synchronizes the profiles with the specified metadata. - - The metadata. - - - - Reads and returns the collection of EXIF values. - - - The . - - - - - Reads and parses EXIF data from a stream. - - - - - Gets the invalid tags. - - - - - Gets or sets the thumbnail length in the byte stream. - - - - - Gets or sets the thumbnail offset position in the byte stream. - - - - - Reads the values to the values collection. - - The values. - The IFD offset. - - - - Class that provides a description for an ExifTag value. - - - - - Initializes a new instance of the class. - - The value of the exif tag. - The description for the value of the exif tag. - - - - Gets the tag description from any custom attributes. - - The tag. - The value. - - The . - - - - - Contains methods for writing EXIF metadata. - - - - - Which parts will be written. - - - - - Initializes a new instance of the class. - - The values. - The allowed parts. - - - - Returns the EXIF data. - - - The . - - - - - - - Class that represents an exif tag from the Exif standard 2.31. - - - - - - - - - - - - - - - - - - - - Gets the FaxProfile exif tag. - - - - - Gets the ModeNumber exif tag. - - - - - Gets the GPSAltitudeRef exif tag. - - - - - Gets the ClipPath exif tag. - - - - - Gets the VersionYear exif tag. - - - - - Gets the XMP exif tag. - - - - - Gets the IPTC exif tag. - - - - - Gets the IccProfile exif tag. - - - - - Gets the CFAPattern2 exif tag. - - - - - Gets the TIFFEPStandardID exif tag. - - - - - Gets the GPSVersionID exif tag. - - - - - Converts the specified to a . - - The to convert. - - - - Determines whether the specified instances are considered equal. - - The first to compare. - The second to compare. - - - - Determines whether the specified instances are not considered equal. - - The first to compare. - The second to compare. - - - - - - - - - - - - - - - - Gets the PixelScale exif tag. - - - - - Gets the IntergraphMatrix exif tag. - - - - - Gets the ModelTiePoint exif tag. - - - - - Gets the ModelTransform exif tag. - - - - - Gets the UserComment exif tag. - - - - - Gets the GPSProcessingMethod exif tag. - - - - - Gets the GPSAreaInformation exif tag. - - - - - Gets the SubfileType exif tag. - - - - - Gets the SubIFDOffset exif tag. - - - - - Gets the GPSIFDOffset exif tag. - - - - - Gets the T4Options exif tag. - - - - - Gets the T6Options exif tag. - - - - - Gets the XClipPathUnits exif tag. - - - - - Gets the YClipPathUnits exif tag. - - - - - Gets the ProfileType exif tag. - - - - - Gets the CodingMethods exif tag. - - - - - Gets the T82ptions exif tag. - - - - - Gets the JPEGInterchangeFormat exif tag. - - - - - Gets the JPEGInterchangeFormatLength exif tag. - - - - - Gets the MDFileTag exif tag. - - - - - Gets the StandardOutputSensitivity exif tag. - - - - - Gets the RecommendedExposureIndex exif tag. - - - - - Gets the ISOSpeed exif tag. - - - - - Gets the ISOSpeedLatitudeyyy exif tag. - - - - - Gets the ISOSpeedLatitudezzz exif tag. - - - - - Gets the FaxRecvParams exif tag. - - - - - Gets the FaxRecvTime exif tag. - - - - - Gets the ImageNumber exif tag. - - - - - Gets the FreeOffsets exif tag. - - - - - Gets the FreeByteCounts exif tag. - - - - - Gets the ColorResponseUnit exif tag. - - - - - Gets the TileOffsets exif tag. - - - - - Gets the SMinSampleValue exif tag. - - - - - Gets the SMaxSampleValue exif tag. - - - - - Gets the JPEGQTables exif tag. - - - - - Gets the JPEGDCTables exif tag. - - - - - Gets the JPEGACTables exif tag. - - - - - Gets the StripRowCounts exif tag. - - - - - Gets the IntergraphRegisters exif tag. - - - - - Gets the TimeZoneOffset exif tag. - - - - - Gets the offset to child IFDs exif tag. - - - - - Gets the ImageWidth exif tag. - - - - - Gets the ImageLength exif tag. - - - - - Gets the RowsPerStrip exif tag. - - - - - Gets the TileWidth exif tag. - - - - - Gets the TileLength exif tag. - - - - - Gets the BadFaxLines exif tag. - - - - - Gets the ConsecutiveBadFaxLines exif tag. - - - - - Gets the PixelXDimension exif tag. - - - - - Gets the PixelYDimension exif tag. - - - - - Gets the StripOffsets exif tag. - - - - - Gets the StripByteCounts exif tag. - - - - - Gets the TileByteCounts exif tag. - - - - - Gets the ImageLayer exif tag. - - - - - Gets the XPosition exif tag. - - - - - Gets the YPosition exif tag. - - - - - Gets the XResolution exif tag. - - - - - Gets the YResolution exif tag. - - - - - Gets the BatteryLevel exif tag. - - - - - Gets the ExposureTime exif tag. - - - - - Gets the FNumber exif tag. - - - - - Gets the MDScalePixel exif tag. - - - - - Gets the CompressedBitsPerPixel exif tag. - - - - - Gets the ApertureValue exif tag. - - - - - Gets the MaxApertureValue exif tag. - - - - - Gets the SubjectDistance exif tag. - - - - - Gets the FocalLength exif tag. - - - - - Gets the FlashEnergy2 exif tag. - - - - - Gets the FocalPlaneXResolution2 exif tag. - - - - - Gets the FocalPlaneYResolution2 exif tag. - - - - - Gets the ExposureIndex2 exif tag. - - - - - Gets the Humidity exif tag. - - - - - Gets the Pressure exif tag. - - - - - Gets the Acceleration exif tag. - - - - - Gets the FlashEnergy exif tag. - - - - - Gets the FocalPlaneXResolution exif tag. - - - - - Gets the FocalPlaneYResolution exif tag. - - - - - Gets the ExposureIndex exif tag. - - - - - Gets the DigitalZoomRatio exif tag. - - - - - Gets the GPSAltitude exif tag. - - - - - Gets the GPSDOP exif tag. - - - - - Gets the GPSSpeed exif tag. - - - - - Gets the GPSTrack exif tag. - - - - - Gets the GPSImgDirection exif tag. - - - - - Gets the GPSDestBearing exif tag. - - - - - Gets the GPSDestDistance exif tag. - - - - - Gets the WhitePoint exif tag. - - - - - Gets the PrimaryChromaticities exif tag. - - - - - Gets the YCbCrCoefficients exif tag. - - - - - Gets the ReferenceBlackWhite exif tag. - - - - - Gets the GPSLatitude exif tag. - - - - - Gets the GPSLongitude exif tag. - - - - - Gets the GPSTimestamp exif tag. - - - - - Gets the GPSDestLatitude exif tag. - - - - - Gets the GPSDestLongitude exif tag. - - - - - Gets the LensSpecification exif tag. - - - - - Gets the OldSubfileType exif tag. - - - - - Gets the Compression exif tag. - - - - - Gets the PhotometricInterpretation exif tag. - - - - - Gets the Thresholding exif tag. - - - - - Gets the CellWidth exif tag. - - - - - Gets the CellLength exif tag. - - - - - Gets the FillOrder exif tag. - - - - - Gets the Orientation exif tag. - - - - - Gets the SamplesPerPixel exif tag. - - - - - Gets the PlanarConfiguration exif tag. - - - - - Gets the Predictor exif tag. - - - - - Gets the GrayResponseUnit exif tag. - - - - - Gets the ResolutionUnit exif tag. - - - - - Gets the CleanFaxData exif tag. - - - - - Gets the InkSet exif tag. - - - - - Gets the NumberOfInks exif tag. - - - - - Gets the DotRange exif tag. - - - - - Gets the Indexed exif tag. - - - - - Gets the OPIProxy exif tag. - - - - - Gets the JPEGProc exif tag. - - - - - Gets the JPEGRestartInterval exif tag. - - - - - Gets the YCbCrPositioning exif tag. - - - - - Gets the Rating exif tag. - - - - - Gets the RatingPercent exif tag. - - - - - Gets the ExposureProgram exif tag. - - - - - Gets the Interlace exif tag. - - - - - Gets the SelfTimerMode exif tag. - - - - - Gets the SensitivityType exif tag. - - - - - Gets the MeteringMode exif tag. - - - - - Gets the LightSource exif tag. - - - - - Gets the FocalPlaneResolutionUnit2 exif tag. - - - - - Gets the SensingMethod2 exif tag. - - - - - Gets the Flash exif tag. - - - - - Gets the ColorSpace exif tag. - - - - - Gets the FocalPlaneResolutionUnit exif tag. - - - - - Gets the SensingMethod exif tag. - - - - - Gets the CustomRendered exif tag. - - - - - Gets the ExposureMode exif tag. - - - - - Gets the WhiteBalance exif tag. - - - - - Gets the FocalLengthIn35mmFilm exif tag. - - - - - Gets the SceneCaptureType exif tag. - - - - - Gets the GainControl exif tag. - - - - - Gets the Contrast exif tag. - - - - - Gets the Saturation exif tag. - - - - - Gets the Sharpness exif tag. - - - - - Gets the SubjectDistanceRange exif tag. - - - - - Gets the GPSDifferential exif tag. - - - - - Gets the BitsPerSample exif tag. - - - - - Gets the MinSampleValue exif tag. - - - - - Gets the MaxSampleValue exif tag. - - - - - Gets the GrayResponseCurve exif tag. - - - - - Gets the ColorMap exif tag. - - - - - Gets the ExtraSamples exif tag. - - - - - Gets the PageNumber exif tag. - - - - - Gets the TransferFunction exif tag. - - - - - Gets the HalftoneHints exif tag. - - - - - Gets the SampleFormat exif tag. - - - - - Gets the TransferRange exif tag. - - - - - Gets the DefaultImageColor exif tag. - - - - - Gets the JPEGLosslessPredictors exif tag. - - - - - Gets the JPEGPointTransforms exif tag. - - - - - Gets the YCbCrSubsampling exif tag. - - - - - Gets the CFARepeatPatternDim exif tag. - - - - - Gets the IntergraphPacketData exif tag. - - - - - Gets the ISOSpeedRatings exif tag. - - - - - Gets the SubjectArea exif tag. - - - - - Gets the SubjectLocation exif tag. - - - - - Gets the ShutterSpeedValue exif tag. - - - - - Gets the BrightnessValue exif tag. - - - - - Gets the ExposureBiasValue exif tag. - - - - - Gets the AmbientTemperature exif tag. - - - - - Gets the WaterDepth exif tag. - - - - - Gets the CameraElevationAngle exif tag. - - - - - Gets the Decode exif tag. - - - - - Gets the ImageDescription exif tag. - - - - - Gets the Make exif tag. - - - - - Gets the Model exif tag. - - - - - Gets the Software exif tag. - - - - - Gets the DateTime exif tag. - - - - - Gets the Artist exif tag. - - - - - Gets the HostComputer exif tag. - - - - - Gets the Copyright exif tag. - - - - - Gets the DocumentName exif tag. - - - - - Gets the PageName exif tag. - - - - - Gets the InkNames exif tag. - - - - - Gets the TargetPrinter exif tag. - - - - - Gets the ImageID exif tag. - - - - - Gets the MDLabName exif tag. - - - - - Gets the MDSampleInfo exif tag. - - - - - Gets the MDPrepDate exif tag. - - - - - Gets the MDPrepTime exif tag. - - - - - Gets the MDFileUnits exif tag. - - - - - Gets the SEMInfo exif tag. - - - - - Gets the SpectralSensitivity exif tag. - - - - - Gets the DateTimeOriginal exif tag. - - - - - Gets the DateTimeDigitized exif tag. - - - - - Gets the SubsecTime exif tag. - - - - - Gets the SubsecTimeOriginal exif tag. - - - - - Gets the SubsecTimeDigitized exif tag. - - - - - Gets the RelatedSoundFile exif tag. - - - - - Gets the FaxSubaddress exif tag. - - - - - Gets the OffsetTime exif tag. - - - - - Gets the OffsetTimeOriginal exif tag. - - - - - Gets the OffsetTimeDigitized exif tag. - - - - - Gets the SecurityClassification exif tag. - - - - - Gets the ImageHistory exif tag. - - - - - Gets the ImageUniqueID exif tag. - - - - - Gets the OwnerName exif tag. - - - - - Gets the SerialNumber exif tag. - - - - - Gets the LensMake exif tag. - - - - - Gets the LensModel exif tag. - - - - - Gets the LensSerialNumber exif tag. - - - - - Gets the GDALMetadata exif tag. - - - - - Gets the GDALNoData exif tag. - - - - - Gets the GPSLatitudeRef exif tag. - - - - - Gets the GPSLongitudeRef exif tag. - - - - - Gets the GPSSatellites exif tag. - - - - - Gets the GPSStatus exif tag. - - - - - Gets the GPSMeasureMode exif tag. - - - - - Gets the GPSSpeedRef exif tag. - - - - - Gets the GPSTrackRef exif tag. - - - - - Gets the GPSImgDirectionRef exif tag. - - - - - Gets the GPSMapDatum exif tag. - - - - - Gets the GPSDestLatitudeRef exif tag. - - - - - Gets the GPSDestLongitudeRef exif tag. - - - - - Gets the GPSDestBearingRef exif tag. - - - - - Gets the GPSDestDistanceRef exif tag. - - - - - Gets the GPSDateStamp exif tag. - - - - - Gets the title tag used by Windows (encoded in UCS2). - - - - - Gets the comment tag used by Windows (encoded in UCS2). - - - - - Gets the author tag used by Windows (encoded in UCS2). - - - - - Gets the keywords tag used by Windows (encoded in UCS2). - - - - - Gets the subject tag used by Windows (encoded in UCS2). - - - - - Gets the JPEGTables exif tag. - - - - - Gets the OECF exif tag. - - - - - Gets the ExifVersion exif tag. - - - - - Gets the ComponentsConfiguration exif tag. - - - - - Gets the MakerNote exif tag. - - - - - Gets the FlashpixVersion exif tag. - - - - - Gets the SpatialFrequencyResponse exif tag. - - - - - Gets the SpatialFrequencyResponse2 exif tag. - - - - - Gets the Noise exif tag. - - - - - Gets the CFAPattern exif tag. - - - - - Gets the DeviceSettingDescription exif tag. - - - - - Gets the ImageSourceData exif tag. - - - - - Gets the FileSource exif tag. - - - - - Gets the ImageDescription exif tag. - - - - - All exif tags from the Exif standard 2.31. - - - - - Unknown - - - - - SubIFDOffset - - - - - GPSIFDOffset - - - - - Indicates the identification of the Interoperability rule. - See https://www.awaresystems.be/imaging/tiff/tifftags/privateifd/interoperability/interoperabilityindex.html - - - - - A general indication of the kind of data contained in this subfile. - See Section 8: Baseline Fields. - - - - - A general indication of the kind of data contained in this subfile. - See Section 8: Baseline Fields. - - - - - The number of columns in the image, i.e., the number of pixels per row. - See Section 8: Baseline Fields. - - - - - The number of rows of pixels in the image. - See Section 8: Baseline Fields. - - - - - Number of bits per component. - See Section 8: Baseline Fields. - - - - - Compression scheme used on the image data. - See Section 8: Baseline Fields. - - - - - The color space of the image data. - See Section 8: Baseline Fields. - - - - - For black and white TIFF files that represent shades of gray, the technique used to convert from gray to black and white pixels. - See Section 8: Baseline Fields. - - - - - The width of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file. - See Section 8: Baseline Fields. - - - - - The length of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file. - See Section 8: Baseline Fields. - - - - - The logical order of bits within a byte. - See Section 8: Baseline Fields. - - - - - The name of the document from which this image was scanned. - See Section 12: Document Storage and Retrieval. - - - - - A string that describes the subject of the image. - See Section 8: Baseline Fields. - - - - - The scanner manufacturer. - See Section 8: Baseline Fields. - - - - - The scanner model name or number. - See Section 8: Baseline Fields. - - - - - For each strip, the byte offset of that strip. - See Section 8: Baseline Fields. - - - - - The orientation of the image with respect to the rows and columns. - See Section 8: Baseline Fields. - - - - - The number of components per pixel. - See Section 8: Baseline Fields. - - - - - The number of rows per strip. - See Section 8: Baseline Fields. - - - - - For each strip, the number of bytes in the strip after compression. - See Section 8: Baseline Fields. - - - - - The minimum component value used. - See Section 8: Baseline Fields. - - - - - The maximum component value used. - See Section 8: Baseline Fields. - - - - - The number of pixels per ResolutionUnit in the ImageWidth direction. - See Section 8: Baseline Fields. - - - - - The number of pixels per ResolutionUnit in the direction. - See Section 8: Baseline Fields. - - - - - How the components of each pixel are stored. - See Section 8: Baseline Fields. - - - - - The name of the page from which this image was scanned. - See Section 12: Document Storage and Retrieval. - - - - - X position of the image. - See Section 12: Document Storage and Retrieval. - - - - - Y position of the image. - See Section 12: Document Storage and Retrieval. - - - - - For each string of contiguous unused bytes in a TIFF file, the byte offset of the string. - See Section 8: Baseline Fields. - - - - - For each string of contiguous unused bytes in a TIFF file, the number of bytes in the string. - See Section 8: Baseline Fields. - - - - - The precision of the information contained in the GrayResponseCurve. - See Section 8: Baseline Fields. - - - - - For grayscale data, the optical density of each possible pixel value. - See Section 8: Baseline Fields. - - - - - Options for Group 3 Fax compression. - - - - - Options for Group 4 Fax compression. - - - - - The unit of measurement for XResolution and YResolution. - See Section 8: Baseline Fields. - - - - - The page number of the page from which this image was scanned. - See Section 12: Document Storage and Retrieval. - - - - - ColorResponseUnit - - - - - TransferFunction - - - - - Name and version number of the software package(s) used to create the image. - See Section 8: Baseline Fields. - - - - - Date and time of image creation. - See Section 8: Baseline Fields. - - - - - Person who created the image. - See Section 8: Baseline Fields. - - - - - The computer and/or operating system in use at the time of image creation. - See Section 8: Baseline Fields. - - - - - Predictor - - - - - WhitePoint - - - - - PrimaryChromaticities - - - - - A color map for palette color images. - See Section 8: Baseline Fields. - - - - - HalftoneHints - - - - - TileWidth - - - - - TileLength - - - - - TileOffsets - - - - - TileByteCounts - - - - - BadFaxLines - - - - - CleanFaxData - - - - - ConsecutiveBadFaxLines - - - - - Offset to child IFDs. - See TIFF Supplement 1: Adobe Pagemaker 6.0. - Each value is an offset (from the beginning of the TIFF file, as always) to a child IFD. Child images provide extra information for the parent image - such as a subsampled version of the parent image. - TIFF data type is Long or 13, IFD. The IFD type is identical to LONG, except that it is only used to point to other valid IFDs. - - - - - InkSet - - - - - InkNames - - - - - NumberOfInks - - - - - DotRange - - - - - TargetPrinter - - - - - Description of extra components. - See Section 8: Baseline Fields. - - - - - SampleFormat - - - - - SMinSampleValue - - - - - SMaxSampleValue - - - - - TransferRange - - - - - ClipPath - - - - - XClipPathUnits - - - - - YClipPathUnits - - - - - Indexed - - - - - JPEGTables - - - - - OPIProxy - - - - - Used in the TIFF-FX standard to point to an IFD containing tags that are globally applicable to the complete TIFF file. - See RFC2301: TIFF-F/FX Specification. - It is recommended that a TIFF writer place this field in the first IFD, where a TIFF reader would find it quickly. - Each field in the GlobalParametersIFD is a TIFF field that is legal in any IFD. Required baseline fields should not be located in the GlobalParametersIFD, but should be in each image IFD. If a conflict exists between fields in the GlobalParametersIFD and in the image IFDs, then the data in the image IFD shall prevail. - - - - - ProfileType - - - - - FaxProfile - - - - - CodingMethods - - - - - VersionYear - - - - - ModeNumber - - - - - Decode - - - - - DefaultImageColor - - - - - T82ptions - - - - - JPEGProc - - - - - JPEGInterchangeFormat - - - - - JPEGInterchangeFormatLength - - - - - JPEGRestartInterval - - - - - JPEGLosslessPredictors - - - - - JPEGPointTransforms - - - - - JPEGQTables - - - - - JPEGDCTables - - - - - JPEGACTables - - - - - YCbCrCoefficients - - - - - YCbCrSubsampling - - - - - YCbCrPositioning - - - - - ReferenceBlackWhite - - - - - StripRowCounts - - - - - XMP - - - - - Rating - - - - - RatingPercent - - - - - ImageID - - - - - Annotation data, as used in 'Imaging for Windows'. - See Other Private TIFF tags: http://www.awaresystems.be/imaging/tiff/tifftags/private.html - - - - - CFARepeatPatternDim - - - - - CFAPattern2 - - - - - BatteryLevel - - - - - Copyright notice. - See Section 8: Baseline Fields. - - - - - ExposureTime - - - - - FNumber - - - - - Specifies the pixel data format encoding in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - - - - - Specifies a scale factor in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - The scale factor is to be applies to each pixel before presenting it to the user. - - - - - Used to specify the conversion from 16bit to 8bit in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - Since the display is only 9bit, the 16bit data must be converted before display. - 8bit value = (16bit value - low range ) * 255 / (high range - low range) - Count: n. - - - - - Name of the lab that scanned this file, as used in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - - - - - Information about the sample, as used in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - This information is entered by the person that scanned the file. - Note that the word 'sample' as used here, refers to the scanned sample, not an image channel. - - - - - Date the sample was prepared, as used in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - The format of this data is YY/MM/DD. - Note that the word 'sample' as used here, refers to the scanned sample, not an image channel. - - - - - Time the sample was prepared, as used in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - Format of this data is HH:MM using the 24-hour clock. - Note that the word 'sample' as used here, refers to the scanned sample, not an image channel. - - - - - Units for data in this file, as used in the Molecular Dynamics GEL file format. - See Molecular Dynamics GEL File Format and Private Tags: https://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html - - - - - PixelScale - - - - - IPTC (International Press Telecommunications Council) metadata. - See IPTC 4.1 specification. - - - - - IntergraphPacketData - - - - - IntergraphRegisters - - - - - IntergraphMatrix - - - - - ModelTiePoint - - - - - SEMInfo - - - - - ModelTransform - - - - - Collection of Photoshop 'Image Resource Blocks' (Embedded Metadata). - See Extracting the Thumbnail from the PhotoShop private TIFF Tag: https://www.awaresystems.be/imaging/tiff/tifftags/docs/photoshopthumbnail.html - - - - - ICC profile data. - See https://www.awaresystems.be/imaging/tiff/tifftags/iccprofile.html - - - - - Used in interchangeable GeoTIFF files. - See https://www.awaresystems.be/imaging/tiff/tifftags/geokeydirectorytag.html - This tag is also know as 'ProjectionInfoTag' and 'CoordSystemInfoTag' - This tag may be used to store the GeoKey Directory, which defines and references the "GeoKeys". - - - - - Used in interchangeable GeoTIFF files. - See https://www.awaresystems.be/imaging/tiff/tifftags/geodoubleparamstag.html - This tag is used to store all of the DOUBLE valued GeoKeys, referenced by the GeoKeyDirectoryTag. The meaning of any value of this double array is determined from the GeoKeyDirectoryTag reference pointing to it. FLOAT values should first be converted to DOUBLE and stored here. - - - - - Used in interchangeable GeoTIFF files. - See https://www.awaresystems.be/imaging/tiff/tifftags/geoasciiparamstag.html - This tag is used to store all of the ASCII valued GeoKeys, referenced by the GeoKeyDirectoryTag. Since keys use offsets into tags, any special comments may be placed at the beginning of this tag. For the most part, the only keys that are ASCII valued are "Citation" keys, giving documentation and references for obscure projections, datums, etc. - - - - - ImageLayer - - - - - ExposureProgram - - - - - SpectralSensitivity - - - - - ISOSpeedRatings - - - - - OECF - - - - - Interlace - - - - - TimeZoneOffset - - - - - SelfTimerMode - - - - - SensitivityType - - - - - StandardOutputSensitivity - - - - - RecommendedExposureIndex - - - - - ISOSpeed - - - - - ISOSpeedLatitudeyyy - - - - - ISOSpeedLatitudezzz - - - - - FaxRecvParams - - - - - FaxSubaddress - - - - - FaxRecvTime - - - - - ExifVersion - - - - - DateTimeOriginal - - - - - DateTimeDigitized - - - - - OffsetTime - - - - - OffsetTimeOriginal - - - - - OffsetTimeDigitized - - - - - ComponentsConfiguration - - - - - CompressedBitsPerPixel - - - - - ShutterSpeedValue - - - - - ApertureValue - - - - - BrightnessValue - - - - - ExposureBiasValue - - - - - MaxApertureValue - - - - - SubjectDistance - - - - - MeteringMode - - - - - LightSource - - - - - Flash - - - - - FocalLength - - - - - FlashEnergy2 - - - - - SpatialFrequencyResponse2 - - - - - Noise - - - - - FocalPlaneXResolution2 - - - - - FocalPlaneYResolution2 - - - - - FocalPlaneResolutionUnit2 - - - - - ImageNumber - - - - - SecurityClassification - - - - - ImageHistory - - - - - SubjectArea - - - - - ExposureIndex2 - - - - - TIFFEPStandardID - - - - - SensingMethod - - - - - MakerNote - - - - - UserComment - - - - - SubsecTime - - - - - SubsecTimeOriginal - - - - - SubsecTimeDigitized - - - - - ImageSourceData - - - - - AmbientTemperature - - - - - Humidity - - - - - Pressure - - - - - WaterDepth - - - - - Acceleration - - - - - CameraElevationAngle - - - - - XPTitle - - - - - XPComment - - - - - XPAuthor - - - - - XPKeywords - - - - - XPSubject - - - - - FlashpixVersion - - - - - ColorSpace - - - - - PixelXDimension - - - - - PixelYDimension - - - - - RelatedSoundFile - - - - - A pointer to the Exif-related Interoperability IFD. - See https://www.awaresystems.be/imaging/tiff/tifftags/privateifd/interoperability.html - Interoperability IFD is composed of tags which stores the information to ensure the Interoperability. - The Interoperability structure of Interoperability IFD is same as TIFF defined IFD structure but does not contain the image data characteristically compared with normal TIFF IFD. - - - - - FlashEnergy - - - - - SpatialFrequencyResponse - - - - - FocalPlaneXResolution - - - - - FocalPlaneYResolution - - - - - FocalPlaneResolutionUnit - - - - - SubjectLocation - - - - - ExposureIndex - - - - - SensingMethod - - - - - FileSource - - - - - SceneType - - - - - CFAPattern - - - - - CustomRendered - - - - - ExposureMode - - - - - WhiteBalance - - - - - DigitalZoomRatio - - - - - FocalLengthIn35mmFilm - - - - - SceneCaptureType - - - - - GainControl - - - - - Contrast - - - - - Saturation - - - - - Sharpness - - - - - DeviceSettingDescription - - - - - SubjectDistanceRange - - - - - ImageUniqueID - - - - - OwnerName - - - - - SerialNumber - - - - - LensSpecification - - - - - LensMake - - - - - LensModel - - - - - LensSerialNumber - - - - - GDALMetadata - - - - - GDALNoData - - - - - GPSVersionID - - - - - GPSLatitudeRef - - - - - GPSLatitude - - - - - GPSLongitudeRef - - - - - GPSLongitude - - - - - GPSAltitudeRef - - - - - GPSAltitude - - - - - GPSTimestamp - - - - - GPSSatellites - - - - - GPSStatus - - - - - GPSMeasureMode - - - - - GPSDOP - - - - - GPSSpeedRef - - - - - GPSSpeed - - - - - GPSTrackRef - - - - - GPSTrack - - - - - GPSImgDirectionRef - - - - - GPSImgDirection - - - - - GPSMapDatum - - - - - GPSDestLatitudeRef - - - - - GPSDestLatitude - - - - - GPSDestLongitudeRef - - - - - GPSDestLongitude - - - - - GPSDestBearingRef - - - - - GPSDestBearing - - - - - GPSDestDistanceRef - - - - - GPSDestDistance - - - - - GPSProcessingMethod - - - - - GPSAreaInformation - - - - - GPSDateStamp - - - - - GPSDifferential - - - - - Used in the Oce scanning process. - Identifies the scanticket used in the scanning process. - Includes a trailing zero. - See https://www.awaresystems.be/imaging/tiff/tifftags/docs/oce.html - - - - - Used in the Oce scanning process. - Identifies the application to process the TIFF file that results from scanning. - Includes a trailing zero. - See https://www.awaresystems.be/imaging/tiff/tifftags/docs/oce.html - - - - - Used in the Oce scanning process. - This is the user's answer to an optional question embedded in the Oce scanticket, and presented to that user before scanning. It can serve in further determination of the workflow. - See https://www.awaresystems.be/imaging/tiff/tifftags/docs/oce.html - - - - - Used in the Oce scanning process. - This tag encodes the imageprocessing done by the Oce ImageLogic module in the scanner to ensure optimal quality for certain workflows. - See https://www.awaresystems.be/imaging/tiff/tifftags/docs/oce.html - - - - - Alias Sketchbook Pro layer usage description. - See https://www.awaresystems.be/imaging/tiff/tifftags/docs/alias.html - - - - - Class that represents an exif tag from the Exif standard 2.31 with as the data type of the tag. - - The data type of the tag. - - - - The EXIF encoded string structure. - - - - - Initializes a new instance of the struct. - Default use Unicode character code. - - The text value. - - - - Initializes a new instance of the struct. - - The character code. - The text value. - - - - The 8-byte character code enum. - - - - - The ASCII (ITU-T T.50 IA5) character code. - - - - - The JIS (X208-1990) character code. - - - - - The Unicode character code. - - - - - The undefined character code. - - - - - Gets the character ode. - - - - - Gets the text. - - - - - Converts the specified to an instance of this type. - - The text value. - - - - Converts the specified to a . - - The to convert. - - - - - - - - - - - - - - - - Enumerates the available orientation values supplied by EXIF metadata. - - - - - Unknown rotation. - - - - - The 0th row at the top, the 0th column on the left. - - - - - The 0th row at the top, the 0th column on the right. - - - - - The 0th row at the bottom, the 0th column on the right. - - - - - The 0th row at the bottom, the 0th column on the left. - - - - - The 0th row on the left, the 0th column at the top. - - - - - The 0th row at the right, the 0th column at the top. - - - - - The 0th row on the right, the 0th column at the bottom. - - - - - The 0th row on the left, the 0th column at the bottom. - - - - - Gets the value of the current instance as a string. - - - - - A value of the exif profile. - - - - - Gets the data type of the exif value. - - - - - Gets a value indicating whether the value is an array. - - - - - Gets the tag of the exif value. - - - - - Gets the value of this exif value. - - The value of this exif value. - - - - Sets the value of this exif value. - - The value of this exif value. - A value indicating whether the value could be set. - - - - A value of the exif profile. - - The type of the value. - - - - Gets or sets the value. - - - - - A segment of a curve - - - - - Initializes a new instance of the class. - - The signature of this segment - - - - Gets the signature of this segment - - - - - - - - A formula based curve segment - - - - - Initializes a new instance of the class. - - The type of this segment - Gamma segment parameter - A segment parameter - B segment parameter - C segment parameter - D segment parameter - E segment parameter - - - - Gets the type of this curve - - - - - Gets the gamma curve parameter - - - - - Gets the A curve parameter - - - - - Gets the B curve parameter - - - - - Gets the C curve parameter - - - - - Gets the D curve parameter - - - - - Gets the E curve parameter - - - - - - - - - - - A one dimensional ICC curve. - - - - - Initializes a new instance of the class. - - The break points of this curve - The segments of this curve - - - - Gets the breakpoints that separate two curve segments - - - - - Gets an array of curve segments - - - - - - - - A parametric curve - - - - - Initializes a new instance of the class. - - G curve parameter - - - - Initializes a new instance of the class. - - G curve parameter - A curve parameter - B curve parameter - - - - Initializes a new instance of the class. - - G curve parameter - A curve parameter - B curve parameter - C curve parameter - - - - Initializes a new instance of the class. - - G curve parameter - A curve parameter - B curve parameter - C curve parameter - D curve parameter - - - - Initializes a new instance of the class. - - G curve parameter - A curve parameter - B curve parameter - C curve parameter - D curve parameter - E curve parameter - F curve parameter - - - - Gets the type of this curve - - - - - Gets the G curve parameter - - - - - Gets the A curve parameter - - - - - Gets the B curve parameter - - - - - Gets the C curve parameter - - - - - Gets the D curve parameter - - - - - Gets the E curve parameter - - - - - Gets the F curve parameter - - - - - - - - - - - - - - A response curve - - - - - Initializes a new instance of the class. - - The type of this curve - The XYZ values - The response arrays - - - - Gets the type of this curve - - - - - Gets the XYZ values - - - - - Gets the response arrays - - - - - - - - - - - - - - A sampled curve segment - - - - - Initializes a new instance of the class. - - The curve values of this segment - - - - Gets the curve values of this segment - - - - - - - - - - - Provides methods to read ICC data types - - - Provides methods to read ICC data types - - - Provides methods to read ICC data types - - - Provides methods to read ICC data types - - - Provides methods to read ICC data types - - - Provides methods to read ICC data types - - - Provides methods to read ICC data types - - - Provides methods to read ICC data types - - - - - The data that is read - - - - - The current reading position - - - - - Initializes a new instance of the class. - - The data to read - - - - Gets the length in bytes of the raw data - - - - - Sets the reading position to the given value - - The new index position - - - - Returns the current without increment and adds the given increment - - The value to increment - The current without the increment - - - - Calculates the 4 byte padding and adds it to the variable - - - - - Calculates the 4 byte padding - - the number of bytes to pad - - - - Gets the bit value at a specified position - - The value from where the bit will be extracted - Position of the bit. Zero based index from left to right. - The bit value at specified position - - - - Reads a - - The read curve - - - - Reads a - - The number of channels - The read curve - - - - Reads a - - The read curve - - - - Reads a - - The read segment - - - - Reads a - - The read segment - - - - Reads a - - The read segment - - - - Reads curve data - - Number of input channels - The curve data - - - - Reads an 8bit lookup table - - The read LUT - - - - Reads a 16bit lookup table - - The number of entries - The read LUT - - - - Reads a CLUT depending on type - - Input channel count - Output channel count - If true, it's read as CLUTf32, - else read as either CLUT8 or CLUT16 depending on embedded information - The read CLUT - - - - Reads an 8 bit CLUT - - Input channel count - Output channel count - Grid point count for each CLUT channel - The read CLUT8 - - - - Reads a 16 bit CLUT - - Input channel count - Output channel count - Grid point count for each CLUT channel - The read CLUT16 - - - - Reads a 32bit floating point CLUT - - Input channel count - Output channel count - Grid point count for each CLUT channel - The read CLUTf32 - - - - Reads a two dimensional matrix - - Number of values in X - Number of values in Y - True if the values are encoded as Single; false if encoded as Fix16 - The read matrix - - - - Reads a one dimensional matrix - - Number of values - True if the values are encoded as Single; false if encoded as Fix16 - The read matrix - - - - Reads a - - The read - - - - Reads a CurveSet - - Number of input channels - Number of output channels - The read - - - - Reads a Matrix - - Number of input channels - Number of output channels - The read - - - - Reads a CLUT - - Number of input channels - Number of output channels - The read - - - - Reads a DateTime - - the value - - - - Reads an ICC profile version number - - the version number - - - - Reads an XYZ number - - the XYZ number - - - - Reads a profile ID - - the profile ID - - - - Reads a position number - - the position number - - - - Reads a response number - - the response number - - - - Reads a named color - - Number of device coordinates - the named color - - - - Reads a profile description - - the profile description - - - - Reads a colorant table entry - - the profile description - - - - Reads a screening channel - - the screening channel - - - - Reads an ushort - - the value - - - - Reads a short - - the value - - - - Reads an uint - - the value - - - - Reads an int - - the value - - - - Reads an ulong - - the value - - - - Reads a long - - the value - - - - Reads a float. - - the value - - - - Reads a double - - the value - - - - Reads an ASCII encoded string. - - number of bytes to read - The value as a string - - - - Reads an UTF-16 big-endian encoded string. - - number of bytes to read - The value as a string - - - - Reads a signed 32bit number with 1 sign bit, 15 value bits and 16 fractional bits. - - The number as double - - - - Reads an unsigned 32bit number with 16 value bits and 16 fractional bits. - - The number as double - - - - Reads an unsigned 16bit number with 1 value bit and 15 fractional bits. - - The number as double - - - - Reads an unsigned 16bit number with 8 value bits and 8 fractional bits. - - The number as double - - - - Reads a number of bytes and advances the index. - - The number of bytes to read - The read bytes - - - - Reads a tag data entry - - The table entry with reading information - the tag data entry - - - - Reads the header of a - - The read signature - - - - Reads the header of a and checks if it's the expected value - - expected value to check against - - - - Reads a with an unknown - - The size of the entry in bytes - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The read entry - - - - Reads a - - The size of the entry in bytes - The read entry - - - - Provides methods to write ICC data types - - - Provides methods to write ICC data types - - - Provides methods to write ICC data types - - - Provides methods to write ICC data types - - - Provides methods to write ICC data types - - - Provides methods to write ICC data types - - - Provides methods to write ICC data types - - - Provides methods to write ICC data types - - - - - The underlying stream where the data is written to - - - - - To detect redundant calls - - - - - Initializes a new instance of the class. - - - - - Gets the currently written length in bytes - - - - - Gets the written data bytes - - The written data - - - - Sets the writing position to the given value - - The new index position - - - - Writes a byte array - - The array to write - The number of bytes written - - - - Writes a ushort array - - The array to write - The number of bytes written - - - - Writes a short array - - The array to write - The number of bytes written - - - - Writes a uint array - - The array to write - The number of bytes written - - - - Writes an int array - - The array to write - The number of bytes written - - - - Writes a ulong array - - The array to write - The number of bytes written - - - - Write a number of empty bytes - - The number of bytes to write - The number of bytes written - - - - Writes empty bytes to a 4-byte margin - - The number of bytes written - - - - - - - Writes given bytes from pointer - - Pointer to the bytes to write - The number of bytes to write - The number of bytes written - - - - Writes given bytes from pointer ignoring endianness - - Pointer to the bytes to write - The number of bytes to write - The number of bytes written - - - - Writes curve data - - The curves to write - The number of bytes written - - - - Writes a - - The curve to write - The number of bytes written - - - - Writes a - - The curve to write - The number of bytes written - - - - Writes a - - The curve to write - The number of bytes written - - - - Writes a - - The curve to write - The number of bytes written - - - - Writes a - - The curve to write - The number of bytes written - - - - Writes a - - The curve to write - The number of bytes written - - - - Writes an 8bit lookup table - - The LUT to write - The number of bytes written - - - - Writes an 16bit lookup table - - The LUT to write - The number of bytes written - - - - Writes an color lookup table - - The CLUT to write - The number of bytes written - - - - Writes a 8bit color lookup table - - The CLUT to write - The number of bytes written - - - - Writes a 16bit color lookup table - - The CLUT to write - The number of bytes written - - - - Writes a 32bit float color lookup table - - The CLUT to write - The number of bytes written - - - - Writes a two dimensional matrix - - The matrix to write - True if the values are encoded as Single; false if encoded as Fix16 - The number of bytes written - - - - Writes a two dimensional matrix - - The matrix to write - True if the values are encoded as Single; false if encoded as Fix16 - The number of bytes written - - - - Writes a two dimensional matrix - - The matrix to write - True if the values are encoded as Single; false if encoded as Fix16 - The number of bytes written - - - - Writes a one dimensional matrix - - The matrix to write - True if the values are encoded as Single; false if encoded as Fix16 - The number of bytes written - - - - Writes a one dimensional matrix - - The matrix to write - True if the values are encoded as Single; false if encoded as Fix16 - The number of bytes written - - - - Writes a - - The element to write - The number of bytes written - - - - Writes a CurveSet - - The element to write - The number of bytes written - - - - Writes a Matrix - - The element to write - The number of bytes written - - - - Writes a CLUT - - The element to write - The number of bytes written - - - - Writes a DateTime - - The value to write - the number of bytes written - - - - Writes an ICC profile version number - - The value to write - the number of bytes written - - - - Writes an XYZ number - - The value to write - the number of bytes written - - - - Writes a profile ID - - The value to write - the number of bytes written - - - - Writes a position number - - The value to write - the number of bytes written - - - - Writes a response number - - The value to write - the number of bytes written - - - - Writes a named color - - The value to write - the number of bytes written - - - - Writes a profile description - - The value to write - the number of bytes written - - - - Writes a screening channel - - The value to write - the number of bytes written - - - - Writes a byte - - The value to write - the number of bytes written - - - - Writes an ushort - - The value to write - the number of bytes written - - - - Writes a short - - The value to write - the number of bytes written - - - - Writes an uint - - The value to write - the number of bytes written - - - - Writes an int - - The value to write - the number of bytes written - - - - Writes an ulong - - The value to write - the number of bytes written - - - - Writes a long - - The value to write - the number of bytes written - - - - Writes a float - - The value to write - the number of bytes written - - - - Writes a double - - The value to write - the number of bytes written - - - - Writes a signed 32bit number with 1 sign bit, 15 value bits and 16 fractional bits - - The value to write - the number of bytes written - - - - Writes an unsigned 32bit number with 16 value bits and 16 fractional bits - - The value to write - the number of bytes written - - - - Writes an unsigned 16bit number with 1 value bit and 15 fractional bits - - The value to write - the number of bytes written - - - - Writes an unsigned 16bit number with 8 value bits and 8 fractional bits - - The value to write - the number of bytes written - - - - Writes an ASCII encoded string - - the string to write - the number of bytes written - - - - Writes an ASCII encoded string resizes it to the given length - - The string to write - The desired length of the string (including potential null terminator) - If True, there will be a \0 added at the end - the number of bytes written - - - - Writes an UTF-16 big-endian encoded string - - the string to write - the number of bytes written - - - - Writes a tag data entry - - The entry to write - The table entry for the written data entry - The number of bytes written (excluding padding) - - - - Writes a tag data entry (without padding) - - The entry to write - The number of bytes written - - - - Writes the header of a - - The signature of the entry - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Writes a - - The entry to write - The number of bytes written - - - - Color lookup table data type - - - - - 32bit floating point - - - - - 8bit unsigned integer (byte) - - - - - 16bit unsigned integer (ushort) - - - - - Colorant Encoding - - - - - Unknown colorant encoding - - - - - ITU-R BT.709-2 colorant encoding - - - - - SMPTE RP145 colorant encoding - - - - - EBU Tech.3213-E colorant encoding - - - - - P22 colorant encoding - - - - - Color Space Type - - - - - CIE XYZ - - - - - CIE Lab - - - - - CIE Luv - - - - - YCbCr - - - - - CIE Yxy - - - - - RGB - - - - - Gray - - - - - HSV - - - - - HLS - - - - - CMYK - - - - - CMY - - - - - Generic 2 channel color - - - - - Generic 3 channel color - - - - - Generic 4 channel color - - - - - Generic 5 channel color - - - - - Generic 6 channel color - - - - - Generic 7 channel color - - - - - Generic 8 channel color - - - - - Generic 9 channel color - - - - - Generic 10 channel color - - - - - Generic 11 channel color - - - - - Generic 12 channel color - - - - - Generic 13 channel color - - - - - Generic 14 channel color - - - - - Generic 15 channel color - - - - - Curve Measurement Encodings - - - - - ISO 5-3 densitometer response. This is the accepted standard for - reflection densitometers for measuring photographic color prints - - - - - ISO 5-3 densitometer response which is the accepted standard in - Europe for color reflection densitometers - - - - - ISO 5-3 densitometer response commonly referred to as narrow band - or interference-type response. - - - - - ISO 5-3 wide band color reflection densitometer response which is - the accepted standard in the United States for color reflection densitometers - - - - - ISO 5-3 densitometer response for measuring color negatives - - - - - DIN 16536-2 densitometer response, with no polarizing filter - - - - - DIN 16536-2 densitometer response, with polarizing filter - - - - - DIN 16536-2 narrow band densitometer response, with no polarizing filter - - - - - DIN 16536-2 narrow band densitometer response, with polarizing filter - - - - - Curve Segment Signature - - - - - Curve defined by a formula - - - - - Curve defined by multiple segments - - - - - Enumerates the basic data types as defined in ICC.1:2010 version 4.3.0.0 - Section 4.2 to 4.15 - - - - - A 12-byte value representation of the time and date - - - - - A single-precision 32-bit floating-point as specified in IEEE 754, - excluding un-normalized s, infinities, and not a "" (NaN) values - - - - - Positions of some data elements are indicated using a position offset with the data element's size. - - - - - An 8-byte value, used to associate a normalized device code with a measurement value - - - - - A fixed signed 4-byte (32-bit) quantity which has 16 fractional bits - - - - - A fixed unsigned 4-byte (32-bit) quantity having 16 fractional bits - - - - - A fixed unsigned 2-byte (16-bit) quantity having15 fractional bits - - - - - A fixed unsigned 2-byte (16-bit) quantity having 8 fractional bits - - - - - An unsigned 2-byte (16-bit) integer - - - - - An unsigned 4-byte (32-bit) integer - - - - - An unsigned 8-byte (64-bit) integer - - - - - An unsigned 1-byte (8-bit) integer - - - - - A set of three fixed signed 4-byte (32-bit) quantities used to encode CIEXYZ, nCIEXYZ, and PCSXYZ tristimulus values - - - - - Alpha-numeric values, and other input and output codes, shall conform to the American Standard Code for - Information Interchange (ASCII) specified in ISO/IEC 646. - - - - - Device attributes. Can be combined with a logical OR - The least-significant 32 bits are defined by the ICC, - the rest can be used for vendor specific values - - - - - Opacity transparent - - - - - Opacity reflective - - - - - Reflectivity matte - - - - - Reflectivity glossy - - - - - Polarity negative - - - - - Polarity positive - - - - - Chroma black and white - - - - - Chroma color - - - - - Formula curve segment type - - - - - Type 1: Y = (a * X + b)^γ + c - - - - - Type 1: Y = a * log10 (b * X^γ + c) + d - - - - - Type 3: Y = a * b^(c * X + d) + e - - - - - Measurement Geometry - - - - - Unknown geometry - - - - - Geometry of 0°:45° or 45°:0° - - - - - Geometry of 0°:d or d:0° - - - - - Multi process element signature - - - - - Set of curves - - - - - Matrix transformation - - - - - Color lookup table - - - - - Reserved for future expansion. Do not use! - - - - - Reserved for future expansion. Do not use! - - - - - Formula curve segment type - - - - - Type 1: Y = X^g - - - - - CIE 122-1996: - For X >= -b/a: Y =(a * X + b)^g - For X $lt; -b/a: Y = 0 - - - - - IEC 61966-3: - For X >= -b/a: Y =(a * X + b)^g + c - For X $lt; -b/a: Y = c - - - - - IEC 61966-2-1 (sRGB): - For X >= d: Y =(a * X + b)^g - For X $lt; d: Y = c * X - - - - - Type 5: - For X >= d: Y =(a * X + b)^g + c - For X $lt; d: Y = c * X + f - - - - - Enumerates the primary platform/operating system framework for which the profile was created - - - - - No platform identified - - - - - Apple Computer, Inc. - - - - - Microsoft Corporation - - - - - Silicon Graphics, Inc. - - - - - Sun Microsystems, Inc. - - - - - Profile Class Name - - - - - Input profiles are generally used with devices such as scanners and - digital cameras. The types of profiles available for use as Input - profiles are N-component LUT-based, Three-component matrix-based, - and monochrome. - - - - - This class of profiles represents display devices such as monitors. - The types of profiles available for use as Display profiles are - N-component LUT-based, Three-component matrix-based, and monochrome. - - - - - Output profiles are used to support devices such as printers and - film recorders. The types of profiles available for use as Output - profiles are N-component LUT-based and Monochrome. - - - - - This profile contains a pre-evaluated transform that cannot be undone, - which represents a one-way link or connection between devices. It does - not represent any device model nor can it be embedded into images. - - - - - This profile provides the relevant information to perform a transformation - between color encodings and the PCS. This type of profile is based on - modeling rather than device measurement or characterization data. - ColorSpace profiles may be embedded in images. - - - - - This profile represents abstract transforms and does not represent any - device model. Color transformations using Abstract profiles are performed - from PCS to PCS. Abstract profiles cannot be embedded in images. - - - - - NamedColor profiles can be thought of as sibling profiles to device profiles. - For a given device there would be one or more device profiles to handle - process color conversions and one or more named color profiles to handle - named colors. - - - - - Profile flags. Can be combined with a logical OR. - The least-significant 16 bits are reserved for the ICC, - the rest can be used for vendor specific values - - - - - No flags (equivalent to NotEmbedded and Independent) - - - - - Profile is embedded within another file - - - - - Profile is embedded within another file - - - - - Profile cannot be used independently of the embedded color data - - - - - Profile can be used independently of the embedded color data - - - - - Enumerates the ICC Profile Tags as defined in ICC.1:2010 version 4.3.0.0 - Section 9 - - Each tag value represent the size of the tag in the profile. - - - - - - Unknown tag - - - - - A2B0 - This tag defines a color transform from Device, Color Encoding or PCS, to PCS, or a color transform - from Device 1 to Device 2, using lookup table tag element structures - - - - - A2B2 - This tag describes the color transform from Device or Color Encoding to PCS using lookup table tag element structures - - - - - A2B2 - This tag describes the color transform from Device or Color Encoding to PCS using lookup table tag element structures - - - - - bXYZ - This tag contains the third column in the matrix used in matrix/TRC transforms. - - - - - bTRC - This tag contains the blue channel tone reproduction curve. The first element represents no colorant (white) or - phosphor (black) and the last element represents 100 % colorant (blue) or 100 % phosphor (blue). - - - - - B2A0 - This tag defines a color transform from PCS to Device or Color Encoding using the lookup table tag element structures - - - - - B2A1 - This tag defines a color transform from PCS to Device or Color Encoding using the lookup table tag element structures. - - - - - B2A2 - This tag defines a color transform from PCS to Device or Color Encoding using the lookup table tag element structures. - - - - - B2D0 - This tag defines a color transform from PCS to Device. It supports float32Number-encoded input range, output range and transform, and - provides a means to override the BToA0 tag. - - - - - B2D1 - This tag defines a color transform from PCS to Device. It supports float32Number-encoded input range, output range and transform, and - provides a means to override the BToA1 tag. - - - - - B2D2 - This tag defines a color transform from PCS to Device. It supports float32Number-encoded input range, output range and transform, and - provides a means to override the BToA2 tag. - - - - - B2D3 - This tag defines a color transform from PCS to Device. It supports float32Number-encoded input range, output range and transform, and - provides a means to override the BToA1 tag. - - - - - calt - This tag contains the profile calibration date and time. This allows applications and utilities to verify if this profile matches a - vendor's profile and how recently calibration has been performed. - - - - - targ - This tag contains the name of the registered characterization data set, or it contains the measurement - data for a characterization target. - - - - - chad - This tag contains a matrix, which shall be invertible, and which converts an nCIEXYZ color, measured using the actual illumination - conditions and relative to the actual adopted white, to an nCIEXYZ color relative to the PCS adopted white - - - - - chrm - This tag contains the type and the data of the phosphor/colorant chromaticity set used. - - - - - clro - This tag specifies the laydown order of colorants. - - - - - clrt - - - - - clot - This tag identifies the colorants used in the profile by a unique name and set of PCSXYZ or PCSLAB values. - When used in DeviceLink profiles only the PCSLAB values shall be permitted. - - - - - ciis - This tag indicates the image state of PCS colorimetry produced using the colorimetric intent transforms. - - - - - cprt - This tag contains the text copyright information for the profile. - - - - - crdi - Removed in V4 - - - - - data - Removed in V4 - - - - - dtim - Removed in V4 - - - - - dmnd - This tag describes the structure containing invariant and localizable - versions of the device manufacturer for display - - - - - dmdd - This tag describes the structure containing invariant and localizable - versions of the device model for display. - - - - - devs - Removed in V4 - - - - - D2B0 - This tag defines a color transform from Device to PCS. It supports float32Number-encoded - input range, output range and transform, and provides a means to override the AToB0 tag - - - - - D2B1 - This tag defines a color transform from Device to PCS. It supports float32Number-encoded - input range, output range and transform, and provides a means to override the AToB1 tag - - - - - D2B2 - This tag defines a color transform from Device to PCS. It supports float32Number-encoded - input range, output range and transform, and provides a means to override the AToB1 tag - - - - - D2B3 - This tag defines a color transform from Device to PCS. It supports float32Number-encoded - input range, output range and transform, and provides a means to override the AToB1 tag - - - - - gamt - This tag provides a table in which PCS values are the input and a single - output value for each input value is the output. If the output value is 0, the PCS color is in-gamut. - If the output is non-zero, the PCS color is out-of-gamut - - - - - kTRC - This tag contains the grey tone reproduction curve. The tone reproduction curve provides the necessary - information to convert between a single device channel and the PCSXYZ or PCSLAB encoding. - - - - - gXYZ - This tag contains the second column in the matrix, which is used in matrix/TRC transforms. - - - - - gTRC - This tag contains the green channel tone reproduction curve. The first element represents no - colorant (white) or phosphor (black) and the last element represents 100 % colorant (green) or 100 % phosphor (green). - - - - - lumi - This tag contains the absolute luminance of emissive devices in candelas per square meter as described by the Y channel. - - - - - meas - This tag describes the alternative measurement specification, such as a D65 illuminant instead of the default D50. - - - - - bkpt - Removed in V4 - - - - - wtpt - This tag, which is used for generating the ICC-absolute colorimetric intent, specifies the chromatically - adapted nCIEXYZ tristimulus values of the media white point. - - - - - ncol - OBSOLETE, use - - - - - ncl2 - This tag contains the named color information providing a PCS and optional device representation - for a list of named colors. - - - - - resp - This tag describes the structure containing a description of the device response for which the profile is intended. - - - - - rig0 - There is only one standard reference medium gamut, as defined in ISO 12640-3 - - - - - pre0 - This tag contains the preview transformation from PCS to device space and back to the PCS. - - - - - pre1 - This tag defines the preview transformation from PCS to device space and back to the PCS. - - - - - pre2 - This tag contains the preview transformation from PCS to device space and back to the PCS. - - - - - desc - This tag describes the structure containing invariant and localizable versions of the profile - description for display. - - - - - pseq - This tag describes the structure containing a description of the profile sequence from source to - destination, typically used with the DeviceLink profile. - - - - - psd0 - Removed in V4 - - - - - psd1 - Removed in V4 - - - - - psd2 - Removed in V4 - - - - - psd3 - Removed in V4 - - - - - ps2s - Removed in V4 - - - - - psd2i- Removed in V4 - - - - - rXYZ - This tag contains the first column in the matrix, which is used in matrix/TRC transforms. - - - - - This tag contains the red channel tone reproduction curve. The first element represents no colorant - (white) or phosphor (black) and the last element represents 100 % colorant (red) or 100 % phosphor (red). - - - - - rig2 - There is only one standard reference medium gamut, as defined in ISO 12640-3. - - - - - scrd - Removed in V4 - - - - - scrn - Removed in V4 - - - - - tech - The device technology signature - - - - - bfd - Removed in V4 - - - - - vued - This tag describes the structure containing invariant and localizable - versions of the viewing conditions. - - - - - view - This tag defines the viewing conditions parameters - - - - - Rendering intent - - - - - In perceptual transforms the PCS values represent hypothetical - measurements of a color reproduction on the reference reflective - medium. By extension, for the perceptual intent, the PCS represents - the appearance of that reproduction as viewed in the reference viewing - environment by a human observer adapted to that environment. The exact - color rendering of the perceptual intent is vendor specific. - - - - - Transformations for this intent shall re-scale the in-gamut, - chromatically adapted tristimulus values such that the white - point of the actual medium is mapped to the PCS white point - (for either input or output) - - - - - The exact color rendering of the saturation intent is vendor - specific and involves compromises such as trading off - preservation of hue in order to preserve the vividness of pure colors. - - - - - Transformations for this intent shall leave the chromatically - adapted nCIEXYZ tristimulus values of the in-gamut colors unchanged. - - - - - Screening flags. Can be combined with a logical OR. - - - - - No flags (equivalent to NotDefaultScreens and UnitLinesPerCm) - - - - - Use printer default screens - - - - - Don't use printer default screens - - - - - Frequency units in Lines/Inch - - - - - Frequency units in Lines/cm - - - - - Enumerates the screening spot types - - - - - Unknown spot type - - - - - Default printer spot type - - - - - Round stop type - - - - - Diamond spot type - - - - - Ellipse spot type - - - - - Line spot type - - - - - Square spot type - - - - - Cross spot type - - - - - Signature Name - - - - - Unknown signature - - - - - Scene Colorimetry Estimates - - - - - Scene Appearance Estimates - - - - - Focal Plane Colorimetry Estimates - - - - - Reflection Hardcopy Original Colorimetry - - - - - Reflection Print Output Colorimetry - - - - - Perceptual Reference Medium Gamut - - - - - Film Scanner - - - - - Digital Camera - - - - - Reflective Scanner - - - - - InkJet Printer - - - - - Thermal Wax Printer - - - - - Electrophotographic Printer - - - - - Electrostatic Printer - - - - - Dye Sublimation Printer - - - - - Photographic Paper Printer - - - - - Film Writer - - - - - Video Monitor - - - - - Video Camera - - - - - Projection Television - - - - - Cathode Ray Tube Display - - - - - Passive Matrix Display - - - - - Active Matrix Display - - - - - Photo CD - - - - - Photographic Image Setter - - - - - Gravure - - - - - Offset Lithography - - - - - Silkscreen - - - - - Flexography - - - - - Motion Picture Film Scanner - - - - - Motion Picture Film Recorder - - - - - Digital Motion Picture Camera - - - - - Digital Cinema Projector - - - - - Standard Illuminant - - - - - Unknown illuminant - - - - - D50 illuminant - - - - - D65 illuminant - - - - - D93 illuminant - - - - - F2 illuminant - - - - - D55 illuminant - - - - - A illuminant - - - - - D50 illuminant - - - - - F8 illuminant - - - - - Standard Observer - - - - - Unknown observer - - - - - CIE 1931 observer - - - - - CIE 1964 observer - - - - - Type Signature - - - - - Unknown type signature - - - - - The chromaticity tag type provides basic chromaticity data and type of - phosphors or colorants of a monitor to applications and utilities - - - - - This is an optional tag which specifies the laydown order in which colorants - will be printed on an n-colorant device. The laydown order may be the same - as the channel generation order listed in the colorantTableTag or the channel - order of a color encoding type such as CMYK, in which case this tag is not - needed. When this is not the case (for example, ink-towers sometimes use - the order KCMY), this tag may be used to specify the laydown order of the - colorants - - - - - The purpose of this tag is to identify the colorants used in the profile - by a unique name and set of PCSXYZ or PCSLAB values to give the colorant - an unambiguous value. The first colorant listed is the colorant of the - first device channel of a LUT tag. The second colorant listed is the - colorant of the second device channel of a LUT tag, and so on - - - - - The curveType embodies a one-dimensional function which maps an input - value in the domain of the function to an output value in the range - of the function - - - - - The dataType is a simple data structure that contains either 7-bit ASCII - or binary data - - - - - Date and time defined by 6 unsigned 16bit integers - (year, month, day, hour, minute, second) - - - - - This structure represents a color transform using tables with 16-bit - precision. This type contains four processing elements: a 3 × 3 matrix - (which shall be the identity matrix unless the input color space is - PCSXYZ), a set of one-dimensional input tables, a multi-dimensional - lookup table, and a set of one-dimensional output tables - - - - - This structure represents a color transform using tables of 8-bit - precision. This type contains four processing elements: a 3 × 3 matrix - (which shall be the identity matrix unless the input color space is - PCSXYZ), a set of one-dimensional input tables, a multi-dimensional - lookup table, and a set of one-dimensional output tables. - - - - - This structure represents a color transform. The type contains up - to five processing elements which are stored in the AToBTag tag - in the following order: a set of one-dimensional curves, a 3 × 3 - matrix with offset terms, a set of one-dimensional curves, a - multi-dimensional lookup table, and a set of one-dimensional - output curves - - - - - This structure represents a color transform. The type contains - up to five processing elements which are stored in the BToATag - in the following order: a set of one-dimensional curves, a 3 × 3 - matrix with offset terms, a set of one-dimensional curves, a - multi-dimensional lookup table, and a set of one-dimensional curves. - - - - - This information refers only to the internal - profile data and is meant to provide profile makers an alternative - to the default measurement specifications - - - - - This tag structure contains a set of records each referencing a - multilingual Unicode string associated with a profile. Each string - is referenced in a separate record with the information about what - language and region the string is for. - - - - - This structure represents a color transform, containing a sequence - of processing elements. The processing elements contained in the - structure are defined in the structure itself, allowing for a flexible - structure. Currently supported processing elements are: a set of one - dimensional curves, a matrix with offset terms, and a multidimensional - lookup table (CLUT). Other processing element types may be added in - the future. Each type of processing element may be contained any - number of times in the structure. - - - - - This type is a count value and array of structures that provide color - coordinates for color names. For each named color, a PCS and optional - device representation of the color are given. Both representations are - 16-bit values and PCS values shall be relative colorimetric. The device - representation corresponds to the header’s "data color space" field. - This representation should be consistent with the "number of device - coordinates" field in the namedColor2Type. If this field is 0, device - coordinates are not provided. The PCS representation corresponds to the - header's PCS field. The PCS representation is always provided. Color - names are fixed-length, 32-byte fields including null termination. In - order to maintain maximum portability, it is strongly recommended that - special characters of the 7-bit ASCII set not be used. - - - - - This type describes a one-dimensional curve by specifying one of a - predefined set of functions using the parameters. - - - - - This type is an array of structures, each of which contains information - from the header fields and tags from the original profiles which were - combined to create the final profile. The order of the structures is - the order in which the profiles were combined and includes a structure - for the final profile. This provides a description of the profile - sequence from source to destination, typically used with the DeviceLink - profile. - - - - - This type is an array of structures, each of which contains information - for identification of a profile used in a sequence. - - - - - The purpose of this tag type is to provide a mechanism to relate physical - colorant amounts with the normalized device codes produced by lut8Type, - lut16Type, lutAToBType, lutBToAType or multiProcessElementsType tags - so that corrections can be made for variation in the device without - having to produce a new profile. The mechanism can be used by applications - to allow users with relatively inexpensive and readily available - instrumentation to apply corrections to individual output color - channels in order to achieve consistent results. - - - - - Array of signed floating point numbers with 1 sign bit, 15 value bits and 16 fractional bits - - - - - The signatureType contains a 4-byte sequence. Sequences of less than four - characters are padded at the end with spaces. Typically this type is used - for registered tags that can be displayed on many development systems as - a sequence of four characters. - - - - - Simple ASCII text - - - - - Array of unsigned floating point numbers with 16 value bits and 16 fractional bits - - - - - Array of unsigned 16bit integers (ushort) - - - - - Array of unsigned 32bit integers (uint) - - - - - Array of unsigned 64bit integers (ulong) - - - - - Array of unsigned 8bit integers (byte) - - - - - This type represents a set of viewing condition parameters. - - - - - 3 floating point values describing a XYZ color value - - - - - REMOVED IN V4 - The textDescriptionType is a complex structure that contains three - types of text description structures: 7-bit ASCII, Unicode and ScriptCode. Since no - single standard method for specifying localizable character sets exists across - the major platform vendors, including all three provides access for the major - operating systems. The 7-bit ASCII description is to be an invariant, - nonlocalizable name for consistent reference. It is preferred that both the - Unicode and ScriptCode structures be properly localized. - - - - - REMOVED IN V4 - This type contains the PostScript product name to which this - profile corresponds and the names of the companion CRDs - - - - - REMOVED IN V4 - The screeningType describes various screening parameters including - screen frequency, screening angle, and spot shape - - - - - REMOVED IN V4 - This type contains curves representing the under color removal and - black generation and a text string which is a general description of the method - used for the UCR and BG - - - - - REMOVED IN V4 - This type is an array of structures each of which contains - platform-specific information about the settings of the device for which - this profile is valid. This type is not supported. - - - - - REMOVED IN V2 - use instead. This type is not supported. - - - - - Represents an error that happened while reading or writing a corrupt/invalid ICC profile - - - - - Initializes a new instance of the class. - - The message that describes the error - - - - Initializes a new instance of the class. - - The message that describes the error - The exception that is the cause of the current exception, or a null reference - (Nothing in Visual Basic) if no inner exception is specified - - - - Represents an ICC profile - - - - - The byte array to read the ICC profile from - - - - - The backing file for the property - - - - - ICC profile header - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The raw ICC profile data - - - - Initializes a new instance of the class. - - The profile header - The actual profile data - - - - Initializes a new instance of the class - by making a copy from another ICC profile. - - The other ICC profile, where the clone should be made from. - is null.> - - - - Gets or sets the profile header - - - - - Gets the actual profile data - - - - - - - - Calculates the MD5 hash value of an ICC profile - - The data of which to calculate the hash value - The calculated hash - - - - Checks for signs of a corrupt profile. - - This is not an absolute proof of validity but should weed out most corrupt data. - True if the profile is valid; False otherwise - - - - Converts this instance to a byte array. - - The - - - - Contains all values of an ICC profile header. - - - - - Gets or sets the profile size in bytes (will be ignored when writing a profile). - - - - - Gets or sets the preferred CMM (Color Management Module) type. - - - - - Gets or sets the profiles version number. - - - - - Gets or sets the type of the profile. - - - - - Gets or sets the data colorspace. - - - - - Gets or sets the profile connection space. - - - - - Gets or sets the date and time this profile was created. - - - - - Gets or sets the file signature. Should always be "acsp". - Value will be ignored when writing a profile. - - - - - Gets or sets the primary platform this profile as created for - - - - - Gets or sets the profile flags to indicate various options for the CMM - such as distributed processing and caching options. - - - - - Gets or sets the device manufacturer of the device for which this profile is created. - - - - - Gets or sets the model of the device for which this profile is created. - - - - - Gets or sets the device attributes unique to the particular device setup such as media type. - - - - - Gets or sets the rendering Intent. - - - - - Gets or sets The normalized XYZ values of the illuminant of the PCS. - - - - - Gets or sets profile creator signature. - - - - - Gets or sets the profile ID (hash). - - - - - Reads and parses ICC data from a byte array - - - - - Reads an ICC profile - - The raw ICC data - The read ICC profile - - - - Reads an ICC profile header - - The raw ICC data - The read ICC profile header - - - - Reads the ICC profile tag data - - The raw ICC data - The read ICC profile tag data - - - - The data of an ICC tag entry - - - - - Initializes a new instance of the class. - TagSignature will be - - Type Signature - - - - Initializes a new instance of the class. - - Type Signature - Tag Signature - - - - Gets the type Signature - - - - - Gets or sets the tag Signature - - - - - - - - - - - - - - Contains methods for writing ICC profiles. - - - - - Writes the ICC profile into a byte array - - The ICC profile to write - The ICC profile as a byte array - - - - A placeholder (might be used for future ICC versions) - - - - - Initializes a new instance of the class. - - Number of input channels - Number of output channels - - - - - - - A CLUT (color lookup table) element to process data - - - - - Initializes a new instance of the class. - - The color lookup table of this element - - - - Gets the color lookup table of this element - - - - - - - - - - - A set of curves to process data - - - - - Initializes a new instance of the class. - - An array with one dimensional curves - - - - Gets an array of one dimensional curves - - - - - - - - - - - A placeholder (might be used for future ICC versions) - - - - - Initializes a new instance of the class. - - Number of input channels - Number of output channels - - - - - - - A matrix element to process data - - - - - Initializes a new instance of the class. - - Two dimensional matrix with size of Input-Channels x Output-Channels - One dimensional matrix with size of Output-Channels x 1 - - - - Gets the two dimensional matrix with size of Input-Channels x Output-Channels - - - - - Gets the one dimensional matrix with size of Output-Channels x 1 - - - - - - - - - - - An element to process data - - - - - Initializes a new instance of the class. - - The signature of this element - Number of input channels - Number of output channels - - - - Gets the signature of this element, - - - - - Gets the number of input channels - - - - - Gets the number of output channels. - - - - - - - - The chromaticity tag type provides basic chromaticity data - and type of phosphors or colorants of a monitor to applications and utilities. - - - - - Initializes a new instance of the class. - - Colorant Type - - - - Initializes a new instance of the class. - - Values per channel - - - - Initializes a new instance of the class. - - Colorant Type - Tag Signature - - - - Initializes a new instance of the class. - - Values per channel - Tag Signature - - - - Gets the number of channels - - - - - Gets the colorant type - - - - - Gets the values per channel - - - - - - - - - - - - - - - - - This tag specifies the laydown order in which colorants - will be printed on an n-colorant device. - - - - - Initializes a new instance of the class. - - Colorant order numbers - - - - Initializes a new instance of the class. - - Colorant order numbers - Tag Signature - - - - Gets the colorant order numbers - - - - - - - - - - - - - - - - - The purpose of this tag is to identify the colorants used in - the profile by a unique name and set of PCSXYZ or PCSLAB values - to give the colorant an unambiguous value. - - - - - Initializes a new instance of the class. - - Colorant Data - - - - Initializes a new instance of the class. - - Colorant Data - Tag Signature - - - - Gets the colorant data - - - - - - - - - - - - - - - - - This type contains the PostScript product name to which this profile - corresponds and the names of the companion CRDs - - - - - Initializes a new instance of the class. - - the PostScript product name - the rendering intent 0 CRD name - the rendering intent 1 CRD name - the rendering intent 2 CRD name - the rendering intent 3 CRD name - - - - Initializes a new instance of the class. - - the PostScript product name - the rendering intent 0 CRD name - the rendering intent 1 CRD name - the rendering intent 2 CRD name - the rendering intent 3 CRD name - Tag Signature - - - - Gets the PostScript product name - - - - - Gets the rendering intent 0 CRD name - - - - - Gets the rendering intent 1 CRD name - - - - - Gets the rendering intent 2 CRD name - - - - - Gets the rendering intent 3 CRD name - - - - - - - - - - - - - - - - - The type contains a one-dimensional table of double values. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Gamma value - - - - Initializes a new instance of the class. - - Curve Data - - - - Initializes a new instance of the class. - - Tag Signature - - - - Initializes a new instance of the class. - - Gamma value - Tag Signature - - - - Initializes a new instance of the class. - - Curve Data - Tag Signature - - - - Gets the curve data - - - - - Gets the gamma value. - Only valid if is true - - - - - Gets a value indicating whether the curve maps input directly to output. - - - - - Gets a value indicating whether the curve is a gamma curve. - - - - - - - - - - - - - - - - - The dataType is a simple data structure that contains - either 7-bit ASCII or binary data, i.e. textType data or transparent bytes. - - - - - Initializes a new instance of the class. - - The raw data - - - - Initializes a new instance of the class. - - The raw data - True if the given data is 7bit ASCII encoded text - - - - Initializes a new instance of the class. - - The raw data - True if the given data is 7bit ASCII encoded text - Tag Signature - - - - Gets the raw Data - - - - - Gets a value indicating whether the represents 7bit ASCII encoded text - - - - - Gets the decoded as 7bit ASCII. - If is false, returns null - - - - - - - - - - - - - - - - - This type is a representation of the time and date. - - - - - Initializes a new instance of the class. - - The DateTime value - - - - Initializes a new instance of the class. - - The DateTime value - Tag Signature - - - - Gets the date and time value - - - - - - - - - - - - - - - - - This type represents an array of doubles (from 32bit fixed point values). - - - - - Initializes a new instance of the class. - - The array data - - - - Initializes a new instance of the class. - - The array data - Tag Signature - - - - Gets the array data - - - - - - - - - - - - - - - - - This structure represents a color transform using tables - with 16-bit precision. - - - - - Initializes a new instance of the class. - - Input LUT - CLUT - Output LUT - - - - Initializes a new instance of the class. - - Input LUT - CLUT - Output LUT - Tag Signature - - - - Initializes a new instance of the class. - - Conversion matrix (must be 3x3) - Input LUT - CLUT - Output LUT - - - - Initializes a new instance of the class. - - Conversion matrix (must be 3x3) - Input LUT - CLUT - Output LUT - Tag Signature - - - - Gets the number of input channels - - - - - Gets the number of output channels - - - - - Gets the conversion matrix - - - - - Gets the input lookup table - - - - - Gets the color lookup table - - - - - Gets the output lookup table - - - - - - - - - - - - - - - - - This structure represents a color transform using tables - with 8-bit precision. - - - - - Initializes a new instance of the class. - - Input LUT - CLUT - Output LUT - - - - Initializes a new instance of the class. - - Input LUT - CLUT - Output LUT - Tag Signature - - - - Initializes a new instance of the class. - - Conversion matrix (must be 3x3) - Input LUT - CLUT - Output LUT - - - - Initializes a new instance of the class. - - Conversion matrix (must be 3x3) - Input LUT - CLUT - Output LUT - Tag Signature - - - - Gets the number of input channels - - - - - Gets the number of output channels - - - - - Gets the conversion matrix - - - - - Gets the input lookup table - - - - - Gets the color lookup table - - - - - Gets the output lookup table - - - - - - - - - - - - - - - - - This structure represents a color transform. - - - - - Initializes a new instance of the class. - - B Curve - Two dimensional conversion matrix (3x3) - One dimensional conversion matrix (3x1) - M Curve - CLUT - A Curve - - - - Initializes a new instance of the class. - - B Curve - Two dimensional conversion matrix (3x3) - One dimensional conversion matrix (3x1) - M Curve - CLUT - A Curve - Tag Signature - - - - Gets the number of input channels - - - - - Gets the number of output channels - - - - - Gets the two dimensional conversion matrix (3x3) - - - - - Gets the one dimensional conversion matrix (3x1) - - - - - Gets the color lookup table - - - - - Gets the B Curve - - - - - Gets the M Curve - - - - - Gets the A Curve - - - - - - - - - - - - - - - - - This structure represents a color transform. - - - - - Initializes a new instance of the class. - - B Curve - Two dimensional conversion matrix (3x3) - One dimensional conversion matrix (3x1) - M Curve - CLUT - A Curve - - - - Initializes a new instance of the class. - - B Curve - Two dimensional conversion matrix (3x3) - One dimensional conversion matrix (3x1) - M Curve - CLUT - A Curve - Tag Signature - - - - Gets the number of input channels - - - - - Gets the number of output channels - - - - - Gets the two dimensional conversion matrix (3x3) - - - - - Gets the one dimensional conversion matrix (3x1) - - - - - Gets the color lookup table - - - - - Gets the B Curve - - - - - Gets the M Curve - - - - - Gets the A Curve - - - - - - - - - - - - - - - - - The measurementType information refers only to the internal - profile data and is meant to provide profile makers an alternative - to the default measurement specifications. - - - - - Initializes a new instance of the class. - - Observer - XYZ Backing values - Geometry - Flare - Illuminant - - - - Initializes a new instance of the class. - - Observer - XYZ Backing values - Geometry - Flare - Illuminant - Tag Signature - - - - Gets the observer - - - - - Gets the XYZ Backing values - - - - - Gets the geometry - - - - - Gets the flare - - - - - Gets the illuminant - - - - - - - - - - - - - - - - - This tag structure contains a set of records each referencing - a multilingual string associated with a profile. - - - - - Initializes a new instance of the class. - - Localized Text - - - - Initializes a new instance of the class. - - Localized Text - Tag Signature - - - - Gets the localized texts - - - - - - - - - - - - - - - - - This structure represents a color transform, containing - a sequence of processing elements. - - - - - Initializes a new instance of the class. - - Processing elements - - - - Initializes a new instance of the class. - - Processing elements - Tag Signature - - - - Gets the number of input channels - - - - - Gets the number of output channels - - - - - Gets the processing elements - - - - - - - - - - - - - - - - - The namedColor2Type is a count value and array of structures - that provide color coordinates for color names. - - - - - Initializes a new instance of the class. - - The named colors - - - - Initializes a new instance of the class. - - Prefix - Suffix - /// The named colors - - - - Initializes a new instance of the class. - - Vendor specific flags - Prefix - Suffix - The named colors - - - - Initializes a new instance of the class. - - The named colors - Tag Signature - - - - Initializes a new instance of the class. - - Prefix - Suffix - The named colors - Tag Signature - - - - Initializes a new instance of the class. - - Vendor specific flags - Prefix - Suffix - The named colors - Tag Signature - - - - Gets the number of coordinates - - - - - Gets the prefix - - - - - Gets the suffix - - - - - Gets the vendor specific flags - - - - - Gets the named colors - - - - - - - - - - - - - - - - - The parametricCurveType describes a one-dimensional curve by - specifying one of a predefined set of functions using the parameters. - - - - - Initializes a new instance of the class. - - The Curve - - - - Initializes a new instance of the class. - - The Curve - Tag Signature - - - - Gets the Curve - - - - - - - - - - - - - - - - - This type is an array of structures, each of which contains information - from the header fields and tags from the original profiles which were - combined to create the final profile. - - - - - Initializes a new instance of the class. - - Profile Descriptions - - - - Initializes a new instance of the class. - - Profile Descriptions - Tag Signature - - - - Gets the profile descriptions - - - - - - - - - - - - - - - - - This type is an array of structures, each of which contains information - for identification of a profile used in a sequence. - - - - - Initializes a new instance of the class. - - Profile Identifiers - - - - Initializes a new instance of the class. - - Profile Identifiers - Tag Signature - - - - Gets the profile identifiers - - - - - - - - - - - - - - - - - The purpose of this tag type is to provide a mechanism to relate physical - colorant amounts with the normalized device codes produced by lut8Type, lut16Type, - lutAToBType, lutBToAType or multiProcessElementsType tags so that corrections can - be made for variation in the device without having to produce a new profile. - - - - - Initializes a new instance of the class. - - The Curves - - - - Initializes a new instance of the class. - - The Curves - Tag Signature - - - - Gets the number of channels - - - - - Gets the curves - - - - - - - - - - - - - - - - - This type describes various screening parameters including - screen frequency, screening angle, and spot shape. - - - - - Initializes a new instance of the class. - - Screening flags - Channel information - - - - Initializes a new instance of the class. - - Screening flags - Channel information - Tag Signature - - - - Gets the screening flags - - - - - Gets the channel information - - - - - - - - - - - - - - - - - Typically this type is used for registered tags that can - be displayed on many development systems as a sequence of four characters. - - - - - Initializes a new instance of the class. - - The Signature - - - - Initializes a new instance of the class. - - The Signature - Tag Signature - - - - Gets the signature data - - - - - - - - - - - - - - - - - The TextDescriptionType contains three types of text description. - - - - - Initializes a new instance of the class. - - ASCII text - Unicode text - ScriptCode text - Unicode Language-Code - ScriptCode Code - - - - Initializes a new instance of the class. - - ASCII text - Unicode text - ScriptCode text - Unicode Language-Code - ScriptCode Code - Tag Signature - - - - Gets the ASCII text - - - - - Gets the Unicode text - - - - - Gets the ScriptCode text - - - - - Gets the Unicode Language-Code - - - - - Gets the ScriptCode Code - - - - - Performs an explicit conversion from - to . - - The entry to convert - The converted entry - - - - - - - - - - - - - - - - This is a simple text structure that contains a text string. - - - - - Initializes a new instance of the class. - - The Text - - - - Initializes a new instance of the class. - - The Text - Tag Signature - - - - Gets the Text - - - - - - - - - - - - - - - - - This type contains curves representing the under color removal and black generation - and a text string which is a general description of the method used for the UCR and BG. - - - - - Initializes a new instance of the class. - - UCR (under color removal) curve values - BG (black generation) curve values - Description of the used UCR and BG method - - - - Initializes a new instance of the class. - - UCR (under color removal) curve values - BG (black generation) curve values - Description of the used UCR and BG method - Tag Signature - - - - Gets the UCR (under color removal) curve values - - - - - Gets the BG (black generation) curve values - - - - - Gets a description of the used UCR and BG method - - - - - - - - - - - - - - - - - This type represents an array of doubles (from 32bit values). - - - - - Initializes a new instance of the class. - - The array data - - - - Initializes a new instance of the class. - - The array data - Tag Signature - - - - Gets the array data. - - - - - - - - - - - - - - - - - This type represents an array of unsigned shorts. - - - - - Initializes a new instance of the class. - - The array data - - - - Initializes a new instance of the class. - - The array data - Tag Signature - - - - Gets the array data - - - - - - - - - - - - - - - - - This type represents an array of unsigned 32bit integers. - - - - - Initializes a new instance of the class. - - The array data - - - - Initializes a new instance of the class. - - The array data - Tag Signature - - - - Gets the array data - - - - - - - - - - - - - - - - - This type represents an array of unsigned 64bit integers. - - - - - Initializes a new instance of the class. - - The array data - - - - Initializes a new instance of the class. - - The array data - Tag Signature - - - - Gets the array data - - - - - - - - - - - - - - - - - This type represents an array of bytes. - - - - - Initializes a new instance of the class. - - The array data - - - - Initializes a new instance of the class. - - The array data - Tag Signature - - - - Gets the array data. - - - - - - - - - - - - - - - - - This tag stores data of an unknown tag data entry - - - - - Initializes a new instance of the class. - - The raw data of the entry - - - - Initializes a new instance of the class. - - The raw data of the entry - Tag Signature - - - - Gets the raw data of the entry. - - - - - - - - - - - - - - - - - This type represents a set of viewing condition parameters. - - - - - Initializes a new instance of the class. - - XYZ values of Illuminant - XYZ values of Surrounding - Illuminant - - - - Initializes a new instance of the class. - - XYZ values of Illuminant - XYZ values of Surrounding - Illuminant - Tag Signature - - - - Gets the XYZ values of illuminant. - - - - - Gets the XYZ values of Surrounding - - - - - Gets the illuminant. - - - - - - - - - - - - - - - - - The XYZType contains an array of XYZ values. - - - - - Initializes a new instance of the class. - - The XYZ numbers. - - - - Initializes a new instance of the class. - - The XYZ numbers - Tag Signature - - - - Gets the XYZ numbers. - - - - - - - - - - - Color Lookup Table - - - - - Initializes a new instance of the class. - - The CLUT values - The gridpoint count - The data type of this CLUT - - - - Initializes a new instance of the class. - - The CLUT values - The gridpoint count - - - - Initializes a new instance of the class. - - The CLUT values - The gridpoint count - - - - Gets the values that make up this table - - - - - Gets the CLUT data type (important when writing a profile) - - - - - Gets the number of input channels - - - - - Gets the number of output channels - - - - - Gets the number of grid points per input channel - - - - - - - - - - - - - - Entry of ICC colorant table - - - - - Initializes a new instance of the struct. - - Name of the colorant - - - - Initializes a new instance of the struct. - - Name of the colorant - First PCS value - Second PCS value - Third PCS value - - - - Gets the colorant name. - - - - - Gets the first PCS value. - - - - - Gets the second PCS value. - - - - - Gets the third PCS value. - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - A string with a specific locale. - - - - - Initializes a new instance of the struct. - The culture will be - - The text value of this string - - - - Initializes a new instance of the struct. - The culture will be - - The culture of this string - The text value of this string - - - - Gets the text value. - - - - - Gets the culture of text. - - - - - - - - - - - Lookup Table - - - - - Initializes a new instance of the struct. - - The LUT values - - - - Initializes a new instance of the struct. - - The LUT values - - - - Initializes a new instance of the struct. - - The LUT values - - - - Gets the values that make up this table - - - - - - - - A specific color with a name - - - - - Initializes a new instance of the struct. - - Name of the color - Coordinates of the color in the profiles PCS - Coordinates of the color in the profiles Device-Space - - - - Gets the name of the color - - - - - Gets the coordinates of the color in the profiles PCS - - - - - Gets the coordinates of the color in the profiles Device-Space - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Position of an object within an ICC profile - - - - - Initializes a new instance of the struct. - - Offset in bytes - Size in bytes - - - - Gets the offset in bytes - - - - - Gets the size in bytes - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - ICC Profile description - - - - - Initializes a new instance of the struct. - - Device Manufacturer - Device Model - Device Attributes - Technology Information - Device Manufacturer Info - Device Model Info - - - - Gets the device manufacturer. - - - - - Gets the device model. - - - - - Gets the device attributes. - - - - - Gets the technology information. - - - - - Gets the device manufacturer info. - - - - - Gets the device model info. - - - - - - - - - - - - - - ICC Profile ID - - - - - A profile ID with all values set to zero - - - - - Initializes a new instance of the struct. - - Part 1 of the ID - Part 2 of the ID - Part 3 of the ID - Part 4 of the ID - - - - Gets the first part of the ID. - - - - - Gets the second part of the ID. - - - - - Gets the third part of the ID. - - - - - Gets the fourth part of the ID. - - - - - Gets a value indicating whether the ID is set or just consists of zeros. - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Description of a profile within a sequence. - - - - - Initializes a new instance of the struct. - - ID of the profile - Description of the profile - - - - Gets the ID of the profile. - - - - - Gets the description of the profile. - - - - - - - - - - - - - - Associates a normalized device code with a measurement value - - - - - Initializes a new instance of the struct. - - Device Code - Measurement Value - - - - Gets the device code - - - - - Gets the measurement value - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - A single channel of a - - - - - Initializes a new instance of the struct. - - Screen frequency - Angle in degrees - Spot shape - - - - Gets the screen frequency. - - - - - Gets the angle in degrees. - - - - - Gets the spot shape - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Entry of ICC tag table - - - - - Initializes a new instance of the struct. - - Signature of the tag - Offset of entry in bytes - Size of entry in bytes - - - - Gets the signature of the tag. - - - - - Gets the offset of entry in bytes. - - - - - Gets the size of entry in bytes. - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - Represents the ICC profile version number. - - - - - Initializes a new instance of the struct. - - The major version number. - The minor version number. - The patch version number. - - - - Gets the major version number. - - - - - Gets the minor version number. - - - - - Gets the patch number. - - - - - - - - - - - Represents an IPTC profile providing access to the collection of values. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The byte array to read the iptc profile from. - - - - Initializes a new instance of the class - by making a copy from another IPTC profile. - - The other IPTC profile, from which the clone should be made from. - - - - Gets the byte data of the IPTC profile. - - - - - Gets the values of this iptc profile. - - - - - - - - Returns all values with the specified tag. - - The tag of the iptc value. - The values found with the specified tag. - - - - Removes all values with the specified tag. - - The tag of the iptc value to remove. - True when the value was found and removed. - - - - Removes values with the specified tag and value. - - The tag of the iptc value to remove. - The value of the iptc item to remove. - True when the value was found and removed. - - - - Changes the encoding for all the values. - - The encoding to use when storing the bytes. - - - - Sets the value for the specified tag. - - The tag of the iptc value. - The encoding to use when storing the bytes. - The value. - - Indicates if length restrictions from the specification should be followed strictly. - Defaults to true. - - - - - Makes sure the datetime is formatted according to the iptc specification. - - A date will be formatted as CCYYMMDD, e.g. "19890317" for 17 March 1989. - A time value will be formatted as HHMMSS±HHMM, e.g. "090000+0200" for 9 o'clock Berlin time, - two hours ahead of UTC. - - - The tag of the iptc value. - The datetime. - - - - Sets the value of the specified tag. - - The tag of the iptc value. - The value. - - Indicates if length restrictions from the specification should be followed strictly. - Defaults to true. - - - - - Updates the data of the profile. - - - - - Provides enumeration of all IPTC tags relevant for images. - - - - - Unknown. - - - - - Record version identifying the version of the Information Interchange Model. - Not repeatable. Max length is 2. - - - - - Object type, not repeatable. Max Length is 67. - - - - - Object attribute. Max length is 68. - - - - - Object Name, not repeatable. Max length is 64. - - - - - Edit status, not repeatable. Max length is 64. - - - - - Editorial update, not repeatable. Max length is 2. - - - - - Urgency, not repeatable. Max length is 2. - - - - - Subject Reference. Max length is 236. - - - - - Category, not repeatable. Max length is 3. - - - - - Supplemental categories. Max length is 32. - - - - - Fixture identifier, not repeatable. Max length is 32. - - - - - Keywords. Max length is 64. - - - - - Location code. Max length is 3. - - - - - Location name. Max length is 64. - - - - - Release date. Format should be CCYYMMDD. - Not repeatable, max length is 8. - - A date will be formatted as CCYYMMDD, e.g. "19890317" for 17 March 1989. - - - - - - Release time. Format should be HHMMSS±HHMM. - Not repeatable, max length is 11. - - A time value will be formatted as HHMMSS±HHMM, e.g. "090000+0200" for 9 o'clock Berlin time, - two hours ahead of UTC. - - - - - - Expiration date. Format should be CCYYMMDD. - Not repeatable, max length is 8. - - A date will be formatted as CCYYMMDD, e.g. "19890317" for 17 March 1989. - - - - - - Expiration time. Format should be HHMMSS±HHMM. - Not repeatable, max length is 11. - - A time value will be formatted as HHMMSS±HHMM, e.g. "090000+0200" for 9 o'clock Berlin time, - two hours ahead of UTC. - - - - - - Special instructions, not repeatable. Max length is 256. - - - - - Action advised, not repeatable. Max length is 2. - - - - - Reference service. Max length is 10. - - - - - Reference date. Format should be CCYYMMDD. - Not repeatable, max length is 8. - - A date will be formatted as CCYYMMDD, e.g. "19890317" for 17 March 1989. - - - - - - ReferenceNumber. Max length is 8. - - - - - Created date. Format should be CCYYMMDD. - Not repeatable, max length is 8. - - A date will be formatted as CCYYMMDD, e.g. "19890317" for 17 March 1989. - - - - - - Created time. Format should be HHMMSS±HHMM. - Not repeatable, max length is 11. - - A time value will be formatted as HHMMSS±HHMM, e.g. "090000+0200" for 9 o'clock Berlin time, - two hours ahead of UTC. - - - - - - Digital creation date. Format should be CCYYMMDD. - Not repeatable, max length is 8. - - A date will be formatted as CCYYMMDD, e.g. "19890317" for 17 March 1989. - - - - - - Digital creation time. Format should be HHMMSS±HHMM. - Not repeatable, max length is 11. - - A time value will be formatted as HHMMSS±HHMM, e.g. "090000+0200" for 9 o'clock Berlin time, - two hours ahead of UTC. - - - - - - Originating program, not repeatable. Max length is 32. - - - - - Program version, not repeatable. Max length is 10. - - - - - Object cycle, not repeatable. Max length is 1. - - - - - Byline. Max length is 32. - - - - - Byline title. Max length is 32. - - - - - City, not repeatable. Max length is 32. - - - - - Sub location, not repeatable. Max length is 32. - - - - - Province/State, not repeatable. Max length is 32. - - - - - Country code, not repeatable. Max length is 3. - - - - - Country, not repeatable. Max length is 64. - - - - - Original transmission reference, not repeatable. Max length is 32. - - - - - Headline, not repeatable. Max length is 256. - - - - - Credit, not repeatable. Max length is 32. - - - - - Source, not repeatable. Max length is 32. - - - - - Copyright notice, not repeatable. Max length is 128. - - - - - Contact. Max length 128. - - - - - Caption, not repeatable. Max length is 2000. - - - - - Local caption. - - - - - Caption writer. Max length is 32. - - - - - Image type, not repeatable. Max length is 2. - - - - - Image orientation, not repeatable. Max length is 1. - - - - - Custom field 1 - - - - - Custom field 2 - - - - - Custom field 3 - - - - - Custom field 4 - - - - - Custom field 5 - - - - - Custom field 6 - - - - - Custom field 7 - - - - - Custom field 8 - - - - - Custom field 9 - - - - - Custom field 10 - - - - - Custom field 11 - - - - - Custom field 12 - - - - - Custom field 13 - - - - - Custom field 14 - - - - - Custom field 15 - - - - - Custom field 16 - - - - - Custom field 17 - - - - - Custom field 18 - - - - - Custom field 19 - - - - - Custom field 20 - - - - - Extension methods for IPTC tags. - - - - - Maximum length of the IPTC value with the given tag according to the specification. - - The tag to check the max length for. - The maximum length. - - - - Determines if the given tag can be repeated according to the specification. - - The tag to check. - True, if the tag can occur multiple times. - - - - Determines if the tag is a datetime tag which needs to be formatted as CCYYMMDD. - - The tag to check. - True, if its a datetime tag. - - - - Determines if the tag is a time tag which need to be formatted as HHMMSS±HHMM. - - The tag to check. - True, if its a time tag. - - - - Represents a single value of the IPTC profile. - - - - - Gets or sets the encoding to use for the Value. - - - - - Gets the tag of the iptc value. - - - - - Gets or sets a value indicating whether to be enforce value length restrictions according - to the specification. - - - - - Gets or sets the value. - - - - - Gets the length of the value. - - - - - - - - Determines whether the specified object is equal to the current . - - The object to compare this with. - True when the specified object is equal to the current . - - - - Determines whether the specified iptc value is equal to the current . - - The iptc value to compare this with. - True when the specified iptc value is equal to the current . - - - - Serves as a hash of this type. - - A hash code for the current instance. - - - - Converts this instance to a byte array. - - A array. - - - - Returns a string that represents the current value. - - A string that represents the current value. - - - - Returns a string that represents the current value with the specified encoding. - - The encoding to use. - A string that represents the current value with the specified encoding. - - - - Represents an XMP profile, providing access to the raw XML. - See for the full specification. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The UTF8 encoded byte array to read the XMP profile from. - - - - Initializes a new instance of the class - by making a copy from another XMP profile. - - The other XMP profile, from which the clone should be made from. - - - - Gets the XMP raw data byte array. - - - - - Gets the raw XML document containing the XMP profile. - - The - - - - Convert the content of this into a byte array. - - The - - - - - - - A delegate to be executed on a . - - The pixel type. - - - - A delegate to be executed on two instances of . - - The first pixel type. - The second pixel type. - - - - A delegate to be executed on three instances of . - - The first pixel type. - The second pixel type. - The third pixel type. - - - - Provides efficient access the pixel buffers of an . - - The pixel type. - - - - Gets the width of the backing . - - - - - Gets the height of the backing . - - - - - Gets the representation of the pixels as a of contiguous memory - at row beginning from the first pixel on that row. - - The row index. - The . - Thrown when row index is out of range. - - - - Helper methods for packing and unpacking floating point values - - - - - Packs a into an - - The float to pack - The - - - - Packs an into a - - The integer to pack. - The - - - - Unpacks a into a . - - The value. - The . - - - - Maps the position of number types in memory - - - - - The float. - - - - - The integer. - - - - - The unsigned integer. - - - - - This interface exists for ensuring signature compatibility to MonoGame and XNA packed color types. - - - The packed format. uint, long, float. - - - - Gets or sets the packed representation of the value. - - - - - An interface that represents a generic pixel type. - The naming convention of each pixel format is to order the color components from least significant to most significant, reading from left to right. - For example in the pixel format the R component is the least significant byte, and the A component is the most significant. - - The type implementing this interface - - - - Creates a instance for this pixel type. - This method is not intended to be consumed directly. Use instead. - - The instance. - - - - A base interface for all pixels, defining the mandatory operations to be implemented by a pixel type. - - - - - Initializes the pixel instance from a generic ("scaled") . - - The vector to load the pixel from. - - - - Expands the pixel into a generic ("scaled") representation - with values scaled and clamped between 0 and 1. - The vector components are typically expanded in least to greatest significance order. - - The . - - - - Initializes the pixel instance from a which is specific to the current pixel type. - - The vector to load the pixel from. - - - - Expands the pixel into a which is specific to the current pixel type. - The vector components are typically expanded in least to greatest significance order. - - The . - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Convert the pixel instance into representation. - - The reference to the destination pixel - - - - Initializes the pixel instance from an value. - - The value. - - - - Initializes the pixel instance from an value. - - The value. - - - - Enumerates the various alpha composition modes. - - - - - Returns the destination over the source. - - - - - Returns the source colors. - - - - - Returns the source over the destination. - - - - - The source where the destination and source overlap. - - - - - The destination where the destination and source overlap. - - - - - The destination where the source does not overlap it. - - - - - The source where they don't overlap otherwise dest in overlapping parts. - - - - - The destination over the source. - - - - - The destination where the destination and source overlap. - - - - - The source where the destination and source overlap. - - - - - The clear. - - - - - Clear where they overlap. - - - - - Provides enumeration of the alpha value transparency behavior of a pixel format. - - - - - Indicates that the pixel format does not contain an alpha channel. - - - - - Indicates that the transparency behavior is premultiplied. - Each color is first scaled by the alpha value. The alpha value itself is the same - in both straight and premultiplied alpha. Typically, no color channel value is - greater than the alpha channel value. - If a color channel value in a premultiplied format is greater than the alpha - channel, the standard source-over blending math results in an additive blend. - - - - - Indicates that the transparency behavior is not premultiplied. - The alpha channel indicates the transparency of the color. - - - - - Collection of Porter Duff alpha blending functions applying different composition models. - - - These functions are designed to be a general solution for all color cases, - that is, they take in account the alpha value of both the backdrop - and source, and there's no need to alpha-premultiply neither the backdrop - nor the source. - Note there are faster functions for when the backdrop color is known - to be opaque - - - - - A pixel blender that implements the "NormalSrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplySrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddSrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractSrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenSrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenSrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenSrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlaySrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightSrc" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalSrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplySrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddSrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractSrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenSrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenSrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenSrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlaySrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightSrcAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalSrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplySrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddSrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractSrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenSrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenSrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenSrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlaySrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightSrcOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalSrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplySrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddSrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractSrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenSrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenSrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenSrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlaySrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightSrcIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalSrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplySrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddSrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractSrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenSrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenSrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenSrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlaySrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightSrcOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplyDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlayDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightDest" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplyDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlayDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightDestAtop" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplyDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlayDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightDestOver" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplyDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlayDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightDestIn" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplyDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlayDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightDestOut" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplyClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlayClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightClear" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "NormalXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "MultiplyXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "AddXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "SubtractXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "ScreenXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "DarkenXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "LightenXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "OverlayXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - A pixel blender that implements the "HardLightXor" composition equation. - - - - - Gets the static instance of this blender. - - - - - - - - - - - - - - Collection of Porter Duff Color Blending and Alpha Composition Functions. - - - These functions are designed to be a general solution for all color cases, - that is, they take in account the alpha value of both the backdrop - and source, and there's no need to alpha-premultiply neither the backdrop - nor the source. - Note there are faster functions for when the backdrop color is known - to be opaque - - - - - Returns the result of the "Normal" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "Multiply" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "Add" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "Subtract" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "Screen" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "Darken" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "Lighten" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "Overlay" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Returns the result of the "HardLight" compositing equation. - - The backdrop vector. - The source vector. - The . - - - - Helper function for Overlay andHardLight modes - - Backdrop color element - Source color element - Overlay value - - - - Returns the result of the "Over" compositing equation. - - The destination vector. - The source vector. - The amount to blend. Range 0..1 - The . - - - - Returns the result of the "Atop" compositing equation. - - The destination vector. - The source vector. - The amount to blend. Range 0..1 - The . - - - - Returns the result of the "In" compositing equation. - - The destination vector. - The source vector. - The . - - - - Returns the result of the "Out" compositing equation. - - The destination vector. - The source vector. - The . - - - - Returns the result of the "XOr" compositing equation. - - The destination vector. - The source vector. - The . - - - - Returns the result of the "NormalSrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalSrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "NormalXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplySrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "MultiplyXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddSrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "AddXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractSrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "SubtractXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenSrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "ScreenXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenSrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "DarkenXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenSrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "LightenXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlaySrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "OverlayXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrc" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDest" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestAtop" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestOver" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestIn" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestOut" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightXor" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightClear" compositing equation. - - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrc" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightSrcOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDest" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestAtop" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestOver" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestIn" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightDestOut" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightClear" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Returns the result of the "HardLightXor" compositing equation. - - The pixel format. - The backdrop vector. - The source vector. - The source opacity. Range 0..1 - The . - - - - Abstract base class for calling pixel composition functions - - The type of the pixel - - - - Blend 2 pixels together. - - The background color. - The source color. - - A value between 0 and 1 indicating the weight of the second source vector. - At amount = 0, "background" is returned, at amount = 1, "source" is returned. - - The final pixel value after composition. - - - - Blends 2 rows together - - the pixel format of the source span - to use internally - the destination span - the background span - the source span - - A value between 0 and 1 indicating the weight of the second source vector. - At amount = 0, "background" is returned, at amount = 1, "source" is returned. - - - - - Blends 2 rows together - - to use internally - the destination span - the background span - the source span - - A span with values between 0 and 1 indicating the weight of the second source vector. - At amount = 0, "background" is returned, at amount = 1, "source" is returned. - - - - - Blends 2 rows together - - the pixel format of the source span - to use internally - the destination span - the background span - the source span - - A span with values between 0 and 1 indicating the weight of the second source vector. - At amount = 0, "background" is returned, at amount = 1, "source" is returned. - - - - - Blend 2 rows together. - - destination span - the background span - the source span - - A value between 0 and 1 indicating the weight of the second source vector. - At amount = 0, "background" is returned, at amount = 1, "source" is returned. - - - - - Blend 2 rows together. - - destination span - the background span - the source span - - A span with values between 0 and 1 indicating the weight of the second source vector. - At amount = 0, "background" is returned, at amount = 1, "source" is returned. - - - - - Enumerates the various color blending modes. - - - - - Default blending mode, also known as "Normal" or "Alpha Blending" - - - - - Blends the 2 values by multiplication. - - - - - Blends the 2 values by addition. - - - - - Blends the 2 values by subtraction. - - - - - Multiplies the complements of the backdrop and source values, then complements the result. - - - - - Selects the minimum of the backdrop and source values. - - - - - Selects the max of the backdrop and source values. - - - - - Multiplies or screens the values, depending on the backdrop vector values. - - - - - Multiplies or screens the colors, depending on the source value. - - - - - Flags responsible to select additional operations which could be efficiently applied in - - or - - knowing the pixel type. - - - - - No special operation is selected - - - - - Select and instead the standard (non scaled) variants. - - - - - Enable alpha premultiplication / unpremultiplication - - - - - Enable SRGB companding (defined in ). - - - - - Extension and utility methods for . - - - - - Applies the union of and , - if is true, returns unmodified otherwise. - - - and - should be always used together! - - - - - Packed pixel type containing a single 8-bit normalized alpha value. - - Ranges from [0, 0, 0, 0] to [0, 0, 0, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The alpha component. - - - - Initializes a new instance of the struct. - - The alpha component. - - - - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compares an object with the packed vector. - - The object to compare. - True if the object is equal to the packed vector. - - - - Compares another A8 packed vector with the packed vector. - - The A8 packed vector to compare. - True if the packed vectors are equal. - - - - Gets a string representation of the packed vector. - - A string representation of the packed vector. - - - - - - - Packs a into a byte. - - The float containing the value to pack. - The containing the packed values. - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - The color components are stored in alpha, red, green, and blue order (least significant to most significant byte). - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Gets or sets the alpha component. - - - - - Gets or sets the blue component. - - - - - Gets or sets the green component. - - - - - Gets or sets the red component. - - - - - The maximum byte value. - - - - - The half vector value. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed vector. - - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed vector. - - - - - Initializes a new instance of the struct. - - - The packed value. - - - - - Gets or sets the packed representation of the Abgrb32 struct. - - - - - - - - Converts an to . - - The . - The . - - - - Converts a to . - - The . - The . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets a string representation of the packed vector. - - A string representation of the packed vector. - - - - - - - Packs the four floats into a color. - - The x-component - The y-component - The z-component - The w-component - - - - Packs a into a uint. - - The vector containing the values to pack. - - - - Packs a into a color. - - The vector containing the values to pack. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - The color components are stored in alpha, red, green, and blue order (least significant to most significant byte). - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Gets or sets the alpha component. - - - - - Gets or sets the red component. - - - - - Gets or sets the green component. - - - - - Gets or sets the blue component. - - - - - The maximum byte value. - - - - - The half vector value. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed vector. - - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed vector. - - - - - Initializes a new instance of the struct. - - - The packed value. - - - - - Gets or sets the packed representation of the Argb32 struct. - - - - - - - - Converts an to . - - The . - The . - - - - Converts a to . - - The . - The . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets a string representation of the packed vector. - - A string representation of the packed vector. - - - - - - - Packs the four floats into a color. - - The x-component - The y-component - The z-component - The w-component - - - - Packs a into a uint. - - The vector containing the values to pack. - - - - Packs a into a color. - - The vector containing the values to pack. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pixel type containing three 8-bit unsigned normalized values ranging from 0 to 255. - The color components are stored in blue, green, red order (least significant to most significant byte). - - Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - The blue component. - - - - - The green component. - - - - - The red component. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - - - - Converts an to . - - The . - The . - - - - Converts a to . - - The . - The . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing unsigned normalized values ranging from 0 to 1. - The x and z components use 5 bits, and the y component uses 6 bits. - - Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component - The y-component - The z-component - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed value. - - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expands the packed representation into a . - The vector components are typically expanded in least to greatest significance order. - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - The color components are stored in blue, green, red, and alpha order (least significant to most significant byte). - The format is binary compatible with System.Drawing.Imaging.PixelFormat.Format32bppArgb - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Gets or sets the blue component. - - - - - Gets or sets the green component. - - - - - Gets or sets the red component. - - - - - Gets or sets the alpha component. - - - - - The maximum byte value. - - - - - The half vector value. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Gets or sets the packed representation of the Bgra32 struct. - - - - - - - - Converts an to . - - The . - The . - - - - Converts a to . - - The . - The . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packs a into a color. - - The vector containing the values to pack. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y, z, and w. - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component - The y-component - The z-component - The w-component - - - - Initializes a new instance of the struct. - - The vector containing the components for the packed vector. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing unsigned normalized values ranging from 0 to 1. - The x , y and z components use 5 bits, and the w component uses 1 bit. - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component - The y-component - The z-component - The w-component - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed vector. - - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing four 8-bit unsigned integer values, ranging from 0 to 255. - - Ranges from [0, 0, 0, 0] to [255, 255, 255, 255] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - - A vector containing the initial values for the components of the Byte4 structure. - - - - - Initializes a new instance of the struct. - - The x-component - The y-component - The z-component - The w-component - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packs a vector into a uint. - - The vector containing the values to pack. - The containing the packed values. - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing a single 16 bit floating point value. - - Ranges from [-1, 0, 0, 1] to [1, 0, 0, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The single component. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expands the packed representation into a . - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing two 16-bit floating-point values. - - Ranges from [-1, -1, 0, 1] to [1, 1, 0, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - - - - Initializes a new instance of the struct. - - A vector containing the initial values for the components. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expands the packed representation into a . - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing four 16-bit floating-point values. - - Ranges from [-1, -1, -1, -1] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - The z-component. - The w-component. - - - - Initializes a new instance of the struct. - - A vector containing the initial values for the components - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packs a into a . - - The vector containing the values to pack. - The containing the packed values. - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing a single 16-bit normalized luminance value. - - Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The luminance component - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing a single 8-bit normalized luminance value. - - Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The luminance component. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing two 8-bit normalized values representing luminance and alpha. - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Gets or sets the luminance component. - - - - - Gets or sets the alpha component. - - - - - Initializes a new instance of the struct. - - The luminance component. - The alpha component. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing two 16-bit normalized values representing luminance and alpha. - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - Gets or sets the luminance component. - - - - - Gets or sets the alpha component. - - - - - Initializes a new instance of the struct. - - The luminance component. - The alpha component. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packed pixel type containing two 8-bit signed normalized values, ranging from −1 to 1. - - Ranges from [-1, -1, 0, 1] to [1, 1, 0, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - - - - Initializes a new instance of the struct. - - The vector containing the component values. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expands the packed representation into a . - The vector components are typically expanded in least to greatest significance order. - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing four 8-bit signed normalized values, ranging from −1 to 1. - - Ranges from [-1, -1, -1, -1] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - The z-component. - The w-component. - - - - Initializes a new instance of the struct. - - The vector containing the component values. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing two 16-bit signed normalized values, ranging from −1 to 1. - - Ranges from [-1, -1, 0, 1] to [1, 1, 0, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - - - - Initializes a new instance of the struct. - - The vector containing the component values. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expands the packed representation into a . - The vector components are typically expanded in least to greatest significance order. - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Packed pixel type containing four 16-bit signed normalized values, ranging from −1 to 1. - - Ranges from [-1, -1, -1, -1] to [1, 1, 1, 1] in vector form. - - - - Provides optimized overrides for bulk operations. - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - The z-component. - The w-component. - - - - Initializes a new instance of the struct. - - The vector containing the component values. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - Pixel type containing three 8-bit unsigned normalized values ranging from 0 to 255. - The color components are stored in red, green, blue order (least significant to most significant byte). - - Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form. - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The red component. - - - - - The green component. - - - - - The blue component. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - - - - Converts an to . - - The . - The . - - - - Converts a to . - - The . - The . - - - - Allows the implicit conversion of an instance of to a - . - - The instance of to convert. - An instance of . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Packs a into a color. - - The vector containing the values to pack. - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - Packed pixel type containing three 16-bit unsigned normalized values ranging from 0 to 635535. - - Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form. - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets or sets the red component. - - - - - Gets or sets the green component. - - - - - Gets or sets the blue component. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - The color components are stored in red, green, blue, and alpha order (least significant to most significant byte). - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - Provides optimized overrides for bulk operations. - - - implementation optimized for . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets or sets the red component. - - - - - Gets or sets the green component. - - - - - Gets or sets the blue component. - - - - - Gets or sets the alpha component. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed vector. - - - - - Initializes a new instance of the struct. - - - The vector containing the components for the packed vector. - - - - - Initializes a new instance of the struct. - - - The packed value. - - - - - Gets or sets the packed representation of the Rgba32 struct. - - - - - Gets or sets the RGB components of this struct as - - - - - Gets or sets the RGB components of this struct as reverting the component order. - - - - - - - - Converts an to . - - The . - The . - - - - Converts a to . - - The . - The . - - - - Allows the implicit conversion of an instance of to a - . - - The instance of to convert. - An instance of . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - Creates a new instance of the struct - from the given hexadecimal string. - - - The hexadecimal representation of the combined color components arranged - in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. - - - The . - - - - - Attempts to creates a new instance of the struct - from the given hexadecimal string. - - - The hexadecimal representation of the combined color components arranged - in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. - - When this method returns, contains the equivalent of the hexadecimal input. - - The . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Converts the value of this instance to a hexadecimal string. - - A hexadecimal string representation of the value. - - - - - - - - - - - - - - - - Packs a into a color returning a new instance as a result. - - The vector containing the values to pack. - The - - - - Packs the four floats into a color. - - The x-component - The y-component - The z-component - The w-component - - - - Packs a into a uint. - - The vector containing the values to pack. - - - - Packs a into a color. - - The vector containing the values to pack. - - - - Converts the specified hex value to an rrggbbaa hex value. - - The hex value to convert. - - A rrggbbaa hex value. - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - Packed pixel type containing four 16-bit unsigned normalized values ranging from 0 to 65535. - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - - - Provides optimized overrides for bulk operations. - - - Provides optimized overrides for bulk operations. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets or sets the red component. - - - - - Gets or sets the green component. - - - - - Gets or sets the blue component. - - - - - Gets or sets the alpha component. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Initializes a new instance of the struct. - - A structure of 4 bytes in RGBA byte order. - - - - Initializes a new instance of the struct. - - A structure of 4 bytes in BGRA byte order. - - - - Initializes a new instance of the struct. - - A structure of 4 bytes in ARGB byte order. - - - - Initializes a new instance of the struct. - - A structure of 4 bytes in ABGR byte order. - - - - Initializes a new instance of the struct. - - A structure of 3 bytes in RGB byte order. - - - - Initializes a new instance of the struct. - - A structure of 3 bytes in BGR byte order. - - - - Initializes a new instance of the struct. - - The . - - - - Gets or sets the RGB components of this struct as . - - - - - - - - Converts an to . - - The . - The . - - - - Converts a to . - - The . - The . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Convert to . - - The . - - - - Convert to . - - The . - - - - Convert to . - - The . - - - - Convert to . - - The . - - - - Convert to . - - The . - - - - Convert to . - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Packed pixel type containing two 16-bit unsigned normalized values ranging from 0 to 1. - - Ranges from [0, 0, 0, 1] to [1, 1, 0, 1] in vector form. - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Initializes a new instance of the struct. - - The x-component - The y-component - - - - Initializes a new instance of the struct. - - The vector containing the component values. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expands the packed representation into a . - The vector components are typically expanded in least to greatest significance order. - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Packed vector type containing unsigned normalized values ranging from 0 to 1. - The x, y and z components use 10 bits, and the w component uses 2 bits. - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Initializes a new instance of the struct. - - The x-component - The y-component - The z-component - The w-component - - - - Initializes a new instance of the struct. - - The vector containing the component values. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Unpacked pixel type containing four 32-bit floating-point values typically ranging from 0 to 1. - The color components are stored in red, green, blue, and alpha order. - - Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - implementation optimized for . - - - - - - - - - - - - - - - - - Gets or sets the red component. - - - - - Gets or sets the green component. - - - - - Gets or sets the blue component. - - - - - Gets or sets the alpha component. - - - - - Initializes a new instance of the struct. - - The red component. - The green component. - The blue component. - The alpha component. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - Creates a new instance of the struct. - - - The hexadecimal representation of the combined color components arranged - in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. - - - The . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Converts the value of this instance to a hexadecimal string. - - A hexadecimal string representation of the value. - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Packed pixel type containing two 16-bit signed integer values. - - Ranges from [-32767, -32767, 0, 1] to [32767, 32767, 0, 1] in vector form. - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - - - - Initializes a new instance of the struct. - - The vector containing the component values. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expands the packed representation into a . - The vector components are typically expanded in least to greatest significance order. - - The . - - - - - - - - - - - - - - - - Provides optimized overrides for bulk operations. - - - Packed pixel type containing four 16-bit signed integer values. - - Ranges from [-37267, -37267, -37267, -37267] to [37267, 37267, 37267, 37267] in vector form. - - - - - - Provides optimized overrides for bulk operations. - - - - - - - - Initializes a new instance of the struct. - - The x-component. - The y-component. - The z-component. - The w-component. - - - - Initializes a new instance of the struct. - - A vector containing the initial values for the components. - - - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the parameter is not equal to the parameter; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets the hash code for the current instance. - - Hash code for the instance. - - - - - - - A stateless class implementing Strategy Pattern for batched pixel-data conversion operations - for pixel buffers of type . - - The pixel format. - - Provides access to pixel blenders - - - - - Gets the global instance for the pixel type - - - - - Gets the pixel type info for the given . - - The . - - - - Bulk version of converting 'sourceVectors.Length' pixels into 'destinationColors'. - The method is DESTRUCTIVE altering the contents of . - - - The destructive behavior is a design choice for performance reasons. - In a typical use case the contents of are abandoned after the conversion. - - A to configure internal operations - The to the source vectors. - The to the destination colors. - The to apply during the conversion - - - - Bulk version of converting 'sourceVectors.Length' pixels into 'destinationColors'. - The method is DESTRUCTIVE altering the contents of . - - - The destructive behavior is a design choice for performance reasons. - In a typical use case the contents of are abandoned after the conversion. - - A to configure internal operations - The to the source vectors. - The to the destination colors. - - - - Bulk version of converting 'sourceColors.Length' pixels into 'destinationVectors'. - - A to configure internal operations - The to the source colors. - The to the destination vectors. - The to apply during the conversion - - - - Bulk version of converting 'sourceColors.Length' pixels into 'destinationVectors'. - - A to configure internal operations - The to the source colors. - The to the destination vectors. - - - - Bulk operation that copies the to in - format. - - The destination pixel type. - A to configure internal operations. - The to the source pixels. - The to the destination pixels. - - - - Bulk operation that copies the to in - format. - - The destination pixel type. - A to configure internal operations. - The to the source pixels. - The to the destination pixels. - - - - Bulk operation that packs 3 seperate RGB channels to . - The destination must have a padding of 3. - - A to configure internal operations. - A to the red values. - A to the green values. - A to the blue values. - A to the destination pixels. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Converts all pixels in 'source` span of into a span of -s. - - A to configure internal operations. - The source of data. - The to the destination pixels. - - - - A helper for that expects a byte span. - The layout of the data in 'sourceBytes' must be compatible with layout. - - A to configure internal operations. - The to the source bytes. - The to the destination pixels. - The number of pixels to convert. - - - - Converts all pixels of the 'sourcePixels` span to a span of -s. - - A to configure internal operations - The span of source pixels - The destination span of data. - - - - A helper for that expects a byte span as destination. - The layout of the data in 'destBytes' must be compatible with layout. - - A to configure internal operations - The to the source pixels. - The to the destination bytes. - The number of pixels to convert. - - - - Find an instance of the pixel blender. - - the blending and composition to apply - A . - - - - Find an instance of the pixel blender. - - The color blending mode to apply - The alpha composition mode to apply - A . - - - - Contains optimized implementations for conversion between pixel formats. - - - Implementations are based on ideas in: - https://github.com/dotnet/coreclr/blob/master/src/System.Private.CoreLib/shared/System/Buffers/Binary/Reader.cs#L84 - The JIT can detect and optimize rotation idioms ROTL (Rotate Left) - and ROTR (Rotate Right) emitting efficient CPU instructions: - https://github.com/dotnet/coreclr/pull/1830 - - - - - Optimized converters from . - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Optimized converters from . - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Optimized converters from . - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Optimized converters from . - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Optimized converters from . - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Optimized converters from . - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Converts a representing a collection of - pixels to a representing - a collection of pixels. - - - - - Helper class for (bulk) conversion of buffers to/from other buffer types. - - - Contains - - - - - Apply modifiers used requested by ToVector4() conversion. - - - - - Apply modifiers used requested by FromVector4() conversion. - - - - - Provides default implementations for batched to/from conversion. - WARNING: The methods prefixed with "Unsafe" are operating without bounds checking and input validation! - Input validation is the responsibility of the caller! - - - - - Provides efficient implementations for batched to/from conversion. - which is applicable for -compatible pixel types where - returns the same scaled result as . - The method is works by internally converting to a therefore it's not applicable for that type! - - - - - It's not worth to bother the transitive pixel conversion method below this limit. - The value depends on the actual gain brought by the SIMD characteristics of the executing CPU and JIT. - - - - - Provides an efficient default implementation for - The method works by internally converting to a therefore it's not applicable for that type! - - - - - Provides an efficient default implementation for - The method is works by internally converting to a therefore it's not applicable for that type! - - - - - Enumerates the RGBA (red, green, blue, alpha) color components. - - - - - The red component. - - - - - The green component. - - - - - The blue component. - - - - - The alpha component. - - - - - A structure encapsulating a 5x4 matrix used for transforming the color and alpha components of an image. - - - - - Value at row 1, column 1 of the matrix. - - - - - Value at row 1, column 2 of the matrix. - - - - - Value at row 1, column 3 of the matrix. - - - - - Value at row 1, column 4 of the matrix. - - - - - Value at row 2, column 1 of the matrix. - - - - - Value at row 2, column 2 of the matrix. - - - - - Value at row 2, column 3 of the matrix. - - - - - Value at row 2, column 4 of the matrix. - - - - - Value at row 3, column 1 of the matrix. - - - - - Value at row 3, column 2 of the matrix. - - - - - Value at row 3, column 3 of the matrix. - - - - - Value at row 3, column 4 of the matrix. - - - - - Value at row 4, column 1 of the matrix. - - - - - Value at row 4, column 2 of the matrix. - - - - - Value at row 4, column 3 of the matrix. - - - - - Value at row 4, column 4 of the matrix. - - - - - Value at row 5, column 1 of the matrix. - - - - - Value at row 5, column 2 of the matrix. - - - - - Value at row 5, column 3 of the matrix. - - - - - Value at row 5, column 4 of the matrix. - - - - - Initializes a new instance of the struct. - - The value at row 1, column 1 of the matrix. - The value at row 1, column 2 of the matrix. - The value at row 1, column 3 of the matrix. - The value at row 1, column 4 of the matrix. - The value at row 2, column 1 of the matrix. - The value at row 2, column 2 of the matrix. - The value at row 2, column 3 of the matrix. - The value at row 2, column 4 of the matrix. - The value at row 3, column 1 of the matrix. - The value at row 3, column 2 of the matrix. - The value at row 3, column 3 of the matrix. - The value at row 3, column 4 of the matrix. - The value at row 4, column 1 of the matrix. - The value at row 4, column 2 of the matrix. - The value at row 4, column 3 of the matrix. - The value at row 4, column 4 of the matrix. - The value at row 5, column 1 of the matrix. - The value at row 5, column 2 of the matrix. - The value at row 5, column 3 of the matrix. - The value at row 5, column 4 of the matrix. - - - - Gets the multiplicative identity matrix. - - - - - Gets a value indicating whether the matrix is the identity matrix. - - - - - Adds two matrices together. - - The first source matrix. - The second source matrix. - The resulting matrix. - - - - Subtracts the second matrix from the first. - - The first source matrix. - The second source matrix. - The result of the subtraction. - - - - Returns a new matrix with the negated elements of the given matrix. - - The source matrix. - The negated matrix. - - - - Multiplies a matrix by another matrix. - - The first source matrix. - The second source matrix. - The result of the multiplication. - - - - Multiplies a matrix by a scalar value. - - The source matrix. - The scaling factor. - The scaled matrix. - - - - Returns a boolean indicating whether the given two matrices are equal. - - The first matrix to compare. - The second matrix to compare. - True if the given matrices are equal; False otherwise. - - - - Returns a boolean indicating whether the given two matrices are not equal. - - The first matrix to compare. - The second matrix to compare. - True if the given matrices are equal; False otherwise. - - - - - - - - - - - - - - - - Represents a complex number, where the real and imaginary parts are stored as values. - - - This is a more efficient version of the type. - - - - - The real part of the complex number - - - - - The imaginary part of the complex number - - - - - Initializes a new instance of the struct. - - The real part in the complex number. - The imaginary part in the complex number. - - - - Performs the multiplication operation between a instance and a scalar. - - The value to multiply. - The scalar to use to multiply the value. - The result - - - - Performs the multiplication operation between a instance and a . - - The value to multiply. - The instance to use to multiply the value. - The result - - - - Performs the multiplication operation between a instance and a . - - The value to multiply. - The instance to use to multiply the value. - The result - - - - - - - - - - - - - - - - A vector with 4 values of type . - - - - - The real part of the complex vector - - - - - The imaginary part of the complex number - - - - - Sums the values in the input to the current instance - - The input to sum - - - - Performs a weighted sum on the current instance according to the given parameters - - The 'a' parameter, for the real component - The 'b' parameter, for the imaginary component - The resulting value - - - - - - - - - - - - - Represents a dense matrix with arbitrary elements. - Components that are adjacent in a column of the matrix are adjacent in the storage array. - The components are said to be stored in column major order. - - The type of elements in the matrix. - - - - The 1D representation of the dense matrix. - - - - - Gets the number of columns in the dense matrix. - - - - - Gets the number of rows in the dense matrix. - - - - - Gets the size of the dense matrix. - - - - - Gets the number of items in the array. - - - - - Initializes a new instance of the struct. - - The length of each side in the matrix. - - - - Initializes a new instance of the struct. - - The number of columns. - The number of rows. - - - - Initializes a new instance of the struct. - - The 2D array to provide access to. - - - - Gets a span wrapping the . - - - - - Gets or sets the item at the specified position. - - The row-coordinate of the item. Must be greater than or equal to zero and less than the height of the array. - The column-coordinate of the item. Must be greater than or equal to zero and less than the width of the array. - The at the specified position. - - - - Performs an implicit conversion from a to a . - - The source array. - - The representation on the source data. - - - - - Performs an implicit conversion from a to a . - - The source array. - - The representation on the source data. - - - - - Compares the two instances to determine whether they are unequal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are equal. - - The first source instance. - The second source instance. - The . - - - - Transposes the rows and columns of the dense matrix. - - The . - - - - Fills the matrix with the given value - - The value to fill each item with - - - - Clears the matrix setting each value to the default value for the element type - - - - - Checks the coordinates to ensure they are within bounds. - - The y-coordinate of the item. Must be greater than zero and smaller than the height of the matrix. - The x-coordinate of the item. Must be greater than zero and smaller than the width of the matrix. - - Thrown if the coordinates are not within the bounds of the array. - - - - - - - - - - - - - - Represents a number that can be expressed as a fraction. - - - This is a very simplified implementation of a rational number designed for use with metadata only. - - - - - Initializes a new instance of the struct. - - - The number above the line in a vulgar fraction showing how many of the parts - indicated by the denominator are taken. - - - The number below the line in a vulgar fraction; a divisor. - - - - - Gets the numerator of a number. - - - - - Gets the denominator of a number. - - - - - Gets a value indicating whether this instance is indeterminate. - - - - - Gets a value indicating whether this instance is an integer (n, 1) - - - - - Gets a value indicating whether this instance is equal to negative infinity (-1, 0) - - - - - Gets a value indicating whether this instance is equal to positive infinity (1, 0) - - - - - Gets a value indicating whether this instance is equal to 0 (0, 1) - - - - - - - - - - - - - - Converts the numeric value of this instance to its equivalent string representation using - the specified culture-specific format information. - - - An object that supplies culture-specific formatting information. - - The - - - - Create a new instance of the struct from a double value. - - The to create the instance from. - Whether to use the best possible precision when parsing the value. - - - - Finds the greatest common divisor of two values. - - The first value - The second value - The - - - - Simplifies the - - - - - Extension methods for the struct. - - - - - Creates a translation matrix from the given vector. - - The translation position. - A translation matrix. - - - - Creates a scale matrix that is offset by a given center point. - - Value to scale by on the X-axis. - Value to scale by on the Y-axis. - The center point. - A scaling matrix. - - - - Creates a scale matrix from the given vector scale. - - The scale to use. - A scaling matrix. - - - - Creates a scale matrix from the given vector scale with an offset from the given center point. - - The scale to use. - The center offset. - A scaling matrix. - - - - Creates a scale matrix that scales uniformly with the given scale with an offset from the given center. - - The uniform scale to use. - The center offset. - A scaling matrix. - - - - Creates a skew matrix from the given angles in degrees. - - The X angle, in degrees. - The Y angle, in degrees. - A skew matrix. - - - - Creates a skew matrix from the given angles in radians and a center point. - - The X angle, in radians. - The Y angle, in radians. - The center point. - A skew matrix. - - - - Creates a skew matrix from the given angles in degrees and a center point. - - The X angle, in degrees. - The Y angle, in degrees. - The center point. - A skew matrix. - - - - Creates a rotation matrix using the given rotation in degrees. - - The amount of rotation, in degrees. - A rotation matrix. - - - - Creates a rotation matrix using the given rotation in radians and a center point. - - The amount of rotation, in radians. - The center point. - A rotation matrix. - - - - Creates a rotation matrix using the given rotation in degrees and a center point. - - The amount of rotation, in degrees. - The center point. - A rotation matrix. - - - - Represents an integral number. - - - - - Initializes a new instance of the struct. - - The value of the number. - - - - Initializes a new instance of the struct. - - The value of the number. - - - - Converts the specified to an instance of this type. - - The value. - - - - Converts the specified to an instance of this type. - - The value. - - - - Converts the specified to an instance of this type. - - The value. - - - - Converts the specified to a . - - The to convert. - - - - Converts the specified to a . - - The to convert. - - - - Converts the specified to a . - - The to convert. - - - - Determines whether the specified instances are considered equal. - - The first to compare. - The second to compare. - - - - Determines whether the specified instances are not considered equal. - - The first to compare. - The second to compare. - - - - Determines whether the first is more than the second . - - The first to compare. - The second to compare. - - - - Determines whether the first is less than the second . - - The first to compare. - The second to compare. - - - - Determines whether the first is more than or equal to the second . - - The first to compare. - The second to compare. - - - - Determines whether the first is less than or equal to the second . - - The first to compare. - The second to compare. - - - - - - - - - - - - - - - - - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - - An object that supplies culture-specific formatting information. - The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros. - - - - Represents an ordered pair of integer x- and y-coordinates that defines a point in - a two-dimensional plane. - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - Represents a that has X and Y values set to zero. - - - - - Initializes a new instance of the struct. - - The horizontal and vertical position of the point. - - - - Initializes a new instance of the struct. - - The horizontal position of the point. - The vertical position of the point. - - - - Initializes a new instance of the struct from the given . - - The size. - - - - Gets or sets the x-coordinate of this . - - - - - Gets or sets the y-coordinate of this . - - - - - Gets a value indicating whether this is empty. - - - - - Creates a with the coordinates of the specified . - - The point. - - - - Creates a with the coordinates of the specified . - - The point. - - - - Creates a with the coordinates of the specified . - - The point. - - - - Negates the given point by multiplying all values by -1. - - The source point. - The negated point. - - - - Translates a by a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - - The . - - - - - Translates a by the negative of a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Multiplies by a producing . - - Multiplier of type . - Multiplicand of type . - Product of type . - - - - Multiplies by a producing . - - Multiplicand of type . - Multiplier of type . - Product of type . - - - - Divides by a producing . - - Dividend of type . - Divisor of type . - Result of type . - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Translates a by the negative of a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Translates a by the negative of a given value. - - The point on the left hand of the operand. - The value on the right hand of the operand. - The . - - - - Translates a by the negative of a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Converts a to a by performing a ceiling operation on all the coordinates. - - The point. - The . - - - - Converts a to a by performing a round operation on all the coordinates. - - The point. - The . - - - - Converts a to a by performing a round operation on all the coordinates. - - The vector. - The . - - - - Converts a to a by performing a truncate operation on all the coordinates. - - The point. - The . - - - - Transforms a point by a specified 3x2 matrix. - - The point to transform. - The transformation matrix used. - The transformed . - - - - Deconstructs this point into two integers. - - The out value for X. - The out value for Y. - - - - Translates this by the specified amount. - - The amount to offset the x-coordinate. - The amount to offset the y-coordinate. - - - - Translates this by the specified amount. - - The used offset this . - - - - - - - - - - - - - - - - Represents an ordered pair of single precision floating point x- and y-coordinates that defines a point in - a two-dimensional plane. - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - Represents a that has X and Y values set to zero. - - - - - Initializes a new instance of the struct. - - The horizontal position of the point. - The vertical position of the point. - - - - Initializes a new instance of the struct from the given . - - The size. - - - - Gets or sets the x-coordinate of this . - - - - - Gets or sets the y-coordinate of this . - - - - - Gets a value indicating whether this is empty. - - - - - Creates a with the coordinates of the specified . - - The vector. - - The . - - - - - Creates a with the coordinates of the specified . - - The point. - - The . - - - - - Creates a with the coordinates of the specified by truncating each of the coordinates. - - The point. - - The . - - - - - Negates the given point by multiplying all values by -1. - - The source point. - The negated point. - - - - Translates a by a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - - The . - - - - - Translates a by the negative of a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Translates a by a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - - The . - - - - - Translates a by the negative of a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Multiplies by a producing . - - Multiplier of type . - Multiplicand of type . - Product of type . - - - - Multiplies by a producing . - - Multiplicand of type . - Multiplier of type . - Product of type . - - - - Divides by a producing . - - Dividend of type . - Divisor of type . - Result of type . - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Translates a by the given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Translates a by the given . - - The point on the left hand of the operand. - The point on the right hand of the operand. - The . - - - - Translates a by the negative of a given . - - The point on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Translates a by the negative of a given . - - The point on the left hand of the operand. - The point on the right hand of the operand. - The . - - - - Translates a by the multiplying the X and Y by the given value. - - The point on the left hand of the operand. - The value on the right hand of the operand. - The . - - - - Transforms a point by a specified 3x2 matrix. - - The point to transform. - The transformation matrix used. - The transformed . - - - - Deconstructs this point into two floats. - - The out value for X. - The out value for Y. - - - - Translates this by the specified amount. - - The amount to offset the x-coordinate. - The amount to offset the y-coordinate. - - - - Translates this by the specified amount. - - The used offset this . - - - - - - - - - - - - - - - - Represents a number that can be expressed as a fraction. - - - This is a very simplified implementation of a rational number designed for use with metadata only. - - - - - Initializes a new instance of the struct. - - The to create the rational from. - - - - Initializes a new instance of the struct. - - The number above the line in a vulgar fraction showing how many of the parts indicated by the denominator are taken. - The number below the line in a vulgar fraction; a divisor. - - - - Initializes a new instance of the struct. - - The number above the line in a vulgar fraction showing how many of the parts indicated by the denominator are taken. - The number below the line in a vulgar fraction; a divisor. - Specified if the rational should be simplified. - - - - Initializes a new instance of the struct. - - The to create the instance from. - - - - Initializes a new instance of the struct. - - The to create the instance from. - Whether to use the best possible precision when parsing the value. - - - - Gets the numerator of a number. - - - - - Gets the denominator of a number. - - - - - Determines whether the specified instances are considered equal. - - The first to compare. - The second to compare. - The - - - - Determines whether the specified instances are not considered equal. - - The first to compare. - The second to compare. - The - - - - Converts the specified to an instance of this type. - - The to convert to an instance of this type. - - The . - - - - - Converts the specified to an instance of this type. - - The to convert to an instance of this type. - Whether to use the best possible precision when parsing the value. - - The . - - - - - - - - - - - - - - Converts a rational number to the nearest . - - - The . - - - - - Converts a rational number to the nearest . - - - The . - - - - - - - - Converts the numeric value of this instance to its equivalent string representation using - the specified culture-specific format information. - - - An object that supplies culture-specific formatting information. - - The - - - - Stores a set of four integers that represent the location and size of a rectangle. - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - Represents a that has X, Y, Width, and Height values set to zero. - - - - - Initializes a new instance of the struct. - - The horizontal position of the rectangle. - The vertical position of the rectangle. - The width of the rectangle. - The height of the rectangle. - - - - Initializes a new instance of the struct. - - - The which specifies the rectangles point in a two-dimensional plane. - - - The which specifies the rectangles height and width. - - - - - Gets or sets the x-coordinate of this . - - - - - Gets or sets the y-coordinate of this . - - - - - Gets or sets the width of this . - - - - - Gets or sets the height of this . - - - - - Gets or sets the coordinates of the upper-left corner of the rectangular region represented by this . - - - - - Gets or sets the size of this . - - - - - Gets a value indicating whether this is empty. - - - - - Gets the y-coordinate of the top edge of this . - - - - - Gets the x-coordinate of the right edge of this . - - - - - Gets the y-coordinate of the bottom edge of this . - - - - - Gets the x-coordinate of the left edge of this . - - - - - Creates a with the coordinates of the specified . - - The rectangle. - - - - Creates a with the coordinates of the specified . - - The rectangle. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Creates a new with the specified location and size. - The left coordinate of the rectangle. - The top coordinate of the rectangle. - The right coordinate of the rectangle. - The bottom coordinate of the rectangle. - The . - - - - Returns the center point of the given . - - The rectangle. - The . - - - - Creates a rectangle that represents the intersection between and - . If there is no intersection, an empty rectangle is returned. - - The first rectangle. - The second rectangle. - The . - - - - Creates a that is inflated by the specified amount. - - The rectangle. - The amount to inflate the width by. - The amount to inflate the height by. - A new . - - - - Converts a to a by performing a ceiling operation on all the coordinates. - - The rectangle. - The . - - - - Transforms a rectangle by the given matrix. - - The source rectangle. - The transformation matrix. - A transformed rectangle. - - - - Converts a to a by performing a truncate operation on all the coordinates. - - The rectangle. - The . - - - - Converts a to a by performing a round operation on all the coordinates. - - The rectangle. - The . - - - - Creates a rectangle that represents the union between and . - - The first rectangle. - The second rectangle. - The . - - - - Deconstructs this rectangle into four integers. - - The out value for X. - The out value for Y. - The out value for the width. - The out value for the height. - - - - Creates a Rectangle that represents the intersection between this Rectangle and the . - - The rectangle. - - - - Inflates this by the specified amount. - - The width. - The height. - - - - Inflates this by the specified amount. - - The size. - - - - Determines if the specfied point is contained within the rectangular region defined by - this . - - The x-coordinate of the given point. - The y-coordinate of the given point. - The . - - - - Determines if the specified point is contained within the rectangular region defined by this . - - The point. - The . - - - - Determines if the rectangular region represented by is entirely contained - within the rectangular region represented by this . - - The rectangle. - The . - - - - Determines if the specfied intersects the rectangular region defined by - this . - - The other Rectange. - The . - - - - Adjusts the location of this rectangle by the specified amount. - - The point. - - - - Adjusts the location of this rectangle by the specified amount. - - The amount to offset the x-coordinate. - The amount to offset the y-coordinate. - - - - - - - - - - - - - - - - Stores a set of four single precision floating points that represent the location and size of a rectangle. - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - Represents a that has X, Y, Width, and Height values set to zero. - - - - - Initializes a new instance of the struct. - - The horizontal position of the rectangle. - The vertical position of the rectangle. - The width of the rectangle. - The height of the rectangle. - - - - Initializes a new instance of the struct. - - - The which specifies the rectangles point in a two-dimensional plane. - - - The which specifies the rectangles height and width. - - - - - Gets or sets the x-coordinate of this . - - - - - Gets or sets the y-coordinate of this . - - - - - Gets or sets the width of this . - - - - - Gets or sets the height of this . - - - - - Gets or sets the coordinates of the upper-left corner of the rectangular region represented by this . - - - - - Gets or sets the size of this . - - - - - Gets a value indicating whether this is empty. - - - - - Gets the y-coordinate of the top edge of this . - - - - - Gets the x-coordinate of the right edge of this . - - - - - Gets the y-coordinate of the bottom edge of this . - - - - - Gets the x-coordinate of the left edge of this . - - - - - Creates a with the coordinates of the specified by truncating each coordinate. - - The rectangle. - - - - Compares two objects for equality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The on the left side of the operand. - The on the right side of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Creates a new with the specified location and size. - The left coordinate of the rectangle. - The top coordinate of the rectangle. - The right coordinate of the rectangle. - The bottom coordinate of the rectangle. - The . - - - - Returns the center point of the given . - - The rectangle. - The . - - - - Creates a rectangle that represents the intersection between and - . If there is no intersection, an empty rectangle is returned. - - The first rectangle. - The second rectangle. - The . - - - - Creates a that is inflated by the specified amount. - - The rectangle. - The amount to inflate the width by. - The amount to inflate the height by. - A new . - - - - Transforms a rectangle by the given matrix. - - The source rectangle. - The transformation matrix. - A transformed . - - - - Creates a rectangle that represents the union between and . - - The first rectangle. - The second rectangle. - The . - - - - Deconstructs this rectangle into four floats. - - The out value for X. - The out value for Y. - The out value for the width. - The out value for the height. - - - - Creates a RectangleF that represents the intersection between this RectangleF and the . - - The rectangle. - - - - Inflates this by the specified amount. - - The width. - The height. - - - - Inflates this by the specified amount. - - The size. - - - - Determines if the specfied point is contained within the rectangular region defined by - this . - - The x-coordinate of the given point. - The y-coordinate of the given point. - The . - - - - Determines if the specified point is contained within the rectangular region defined by this . - - The point. - The . - - - - Determines if the rectangular region represented by is entirely contained - within the rectangular region represented by this . - - The rectangle. - The . - - - - Determines if the specfied intersects the rectangular region defined by - this . - - The other Rectange. - The . - - - - Adjusts the location of this rectangle by the specified amount. - - The point. - - - - Adjusts the location of this rectangle by the specified amount. - - The amount to offset the x-coordinate. - The amount to offset the y-coordinate. - - - - - - - - - - - - - - - - Represents a number that can be expressed as a fraction. - - - This is a very simplified implementation of a rational number designed for use with metadata only. - - - - - Initializes a new instance of the struct. - - The to create the rational from. - - - - Initializes a new instance of the struct. - - The number above the line in a vulgar fraction showing how many of the parts indicated by the denominator are taken. - The number below the line in a vulgar fraction; a divisor. - - - - Initializes a new instance of the struct. - - The number above the line in a vulgar fraction showing how many of the parts indicated by the denominator are taken. - The number below the line in a vulgar fraction; a divisor. - Specified if the rational should be simplified. - - - - Initializes a new instance of the struct. - - The to create the instance from. - - - - Initializes a new instance of the struct. - - The to create the instance from. - Whether to use the best possible precision when parsing the value. - - - - Gets the numerator of a number. - - - - - Gets the denominator of a number. - - - - - Determines whether the specified instances are considered equal. - - The first to compare. - The second to compare. - The - - - - Determines whether the specified instances are not considered equal. - - The first to compare. - The second to compare. - The - - - - Converts the specified to an instance of this type. - - The to convert to an instance of this type. - - The . - - - - - Converts the specified to an instance of this type. - - The to convert to an instance of this type. - Whether to use the best possible precision when parsing the value. - - The . - - - - - - - - - - - - - - Converts a rational number to the nearest . - - - The . - - - - - - - - Converts the numeric value of this instance to its equivalent string representation using - the specified culture-specific format information. - - - An object that supplies culture-specific formatting information. - - The - - - - Stores an ordered pair of integers, which specify a height and width. - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - Represents a that has Width and Height values set to zero. - - - - - Initializes a new instance of the struct. - - The width and height of the size. - - - - Initializes a new instance of the struct. - - The width of the size. - The height of the size. - - - - Initializes a new instance of the struct. - - The size. - - - - Initializes a new instance of the struct from the given . - - The point. - - - - Gets or sets the width of this . - - - - - Gets or sets the height of this . - - - - - Gets a value indicating whether this is empty. - - - - - Creates a with the dimensions of the specified . - - The point. - - - - Converts the given into a . - - The size. - - - - Computes the sum of adding two sizes. - - The size on the left hand of the operand. - The size on the right hand of the operand. - - The . - - - - - Computes the difference left by subtracting one size from another. - - The size on the left hand of the operand. - The size on the right hand of the operand. - - The . - - - - - Multiplies a by an producing . - - Multiplier of type . - Multiplicand of type . - Product of type . - - - - Multiplies by an producing . - - Multiplicand of type . - Multiplier of type . - Product of type . - - - - Divides by an producing . - - Dividend of type . - Divisor of type . - Result of type . - - - - Multiplies by a producing . - - Multiplier of type . - Multiplicand of type . - Product of type . - - - - Multiplies by a producing . - - Multiplicand of type . - Multiplier of type . - Product of type . - - - - Divides by a producing . - - Dividend of type . - Divisor of type . - Result of type . - - - - Compares two objects for equality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - - The on the left side of the operand. - - - The on the right side of the operand. - - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Performs vector addition of two objects. - - The size on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Contracts a by another . - - The size on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Converts a to a by performing a ceiling operation on all the dimensions. - - The size. - The . - - - - Converts a to a by performing a round operation on all the dimensions. - - The size. - The . - - - - Transforms a size by the given matrix. - - The source size. - The transformation matrix. - A transformed size. - - - - Converts a to a by performing a round operation on all the dimensions. - - The size. - The . - - - - Deconstructs this size into two integers. - - The out value for the width. - The out value for the height. - - - - - - - - - - - - - - - - Multiplies by an producing . - - Multiplicand of type . - Multiplier of type . - Product of type . - - - - Multiplies by a producing . - - Multiplicand of type . - Multiplier of type . - Product of type SizeF. - - - - Stores an ordered pair of single precision floating points, which specify a height and width. - - - This struct is fully mutable. This is done (against the guidelines) for the sake of performance, - as it avoids the need to create new values for modification operations. - - - - - Represents a that has Width and Height values set to zero. - - - - - Initializes a new instance of the struct. - - The width of the size. - The height of the size. - - - - Initializes a new instance of the struct. - - The size. - - - - Initializes a new instance of the struct from the given . - - The point. - - - - Gets or sets the width of this . - - - - - Gets or sets the height of this . - - - - - Gets a value indicating whether this is empty. - - - - - Creates a with the coordinates of the specified . - - The point. - - The . - - - - - Creates a with the dimensions of the specified by truncating each of the dimensions. - - The size. - - The . - - - - - Converts the given into a . - - The size. - - - - Computes the sum of adding two sizes. - - The size on the left hand of the operand. - The size on the right hand of the operand. - - The . - - - - - Computes the difference left by subtracting one size from another. - - The size on the left hand of the operand. - The size on the right hand of the operand. - - The . - - - - - Multiplies by a producing . - - Multiplier of type . - Multiplicand of type . - Product of type . - - - - Multiplies by a producing . - - Multiplicand of type . - Multiplier of type . - Product of type . - - - - Divides by a producing . - - Dividend of type . - Divisor of type . - Result of type . - - - - Compares two objects for equality. - - The size on the left hand of the operand. - The size on the right hand of the operand. - - True if the current left is equal to the parameter; otherwise, false. - - - - - Compares two objects for inequality. - - The size on the left hand of the operand. - The size on the right hand of the operand. - - True if the current left is unequal to the parameter; otherwise, false. - - - - - Performs vector addition of two objects. - - The size on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Contracts a by another . - - The size on the left hand of the operand. - The size on the right hand of the operand. - The . - - - - Transforms a size by the given matrix. - - The source size. - The transformation matrix. - A transformed size. - - - - Deconstructs this size into two floats. - - The out value for the width. - The out value for the height. - - - - - - - - - - - - - - - - Multiplies by a producing . - - Multiplicand of type . - Multiplier of type . - Product of type SizeF. - - - - Represents a value in relation to a value on the image. - - - - - Initializes a new instance of the struct. - - The value. - The type. - - - - Enumerates the different value types. - - - - - The value is the final return value. - - - - - The value is a percentage of the image width. - - - - - The value is a percentage of the images height. - - - - - Gets the value. - - - - - Gets the type. - - - - - Implicitly converts a float into an absolute value. - - the value to use as the absolute figure. - - - - Create a new ValueSize with as a PercentageOfWidth type with value set to percentage. - - The percentage. - a Values size with type PercentageOfWidth - - - - Create a new ValueSize with as a PercentageOfHeight type with value set to percentage. - - The percentage. - a Values size with type PercentageOfHeight - - - - Create a new ValueSize with as a Absolute type with value set to value. - - The value. - a Values size with type Absolute. - - - - Calculates the specified size. - - The size. - The calculated value. - - - - - - - - - - - - - - - - Extensions to perform AdaptiveThreshold through Mutator. - - - - - Applies Bradley Adaptive Threshold to the image. - - The image this method extends. - The . - - - - Applies Bradley Adaptive Threshold to the image. - - The image this method extends. - Threshold limit (0.0-1.0) to consider for binarization. - The . - - - - Applies Bradley Adaptive Threshold to the image. - - The image this method extends. - Upper (white) color for thresholding. - Lower (black) color for thresholding. - The . - - - - Applies Bradley Adaptive Threshold to the image. - - The image this method extends. - Upper (white) color for thresholding. - Lower (black) color for thresholding. - Threshold limit (0.0-1.0) to consider for binarization. - The . - - - - Applies Bradley Adaptive Threshold to the image. - - The image this method extends. - Upper (white) color for thresholding. - Lower (black) color for thresholding. - Rectangle region to apply the processor on. - The . - - - - Applies Bradley Adaptive Threshold to the image. - - The image this method extends. - Upper (white) color for thresholding. - Lower (black) color for thresholding. - Threshold limit (0.0-1.0) to consider for binarization. - Rectangle region to apply the processor on. - The . - - - - A helper class for constructing instances for use in affine transforms. - - - - - Prepends a rotation matrix using the given rotation angle in degrees - and the image center point as rotation center. - - The amount of rotation, in degrees. - The . - - - - Prepends a rotation matrix using the given rotation angle in radians - and the image center point as rotation center. - - The amount of rotation, in radians. - The . - - - - Prepends a rotation matrix using the given rotation in degrees at the given origin. - - The amount of rotation, in degrees. - The rotation origin point. - The . - - - - Prepends a rotation matrix using the given rotation in radians at the given origin. - - The amount of rotation, in radians. - The rotation origin point. - The . - - - - Appends a rotation matrix using the given rotation angle in degrees - and the image center point as rotation center. - - The amount of rotation, in degrees. - The . - - - - Appends a rotation matrix using the given rotation angle in radians - and the image center point as rotation center. - - The amount of rotation, in radians. - The . - - - - Appends a rotation matrix using the given rotation in degrees at the given origin. - - The amount of rotation, in degrees. - The rotation origin point. - The . - - - - Appends a rotation matrix using the given rotation in radians at the given origin. - - The amount of rotation, in radians. - The rotation origin point. - The . - - - - Prepends a scale matrix from the given uniform scale. - - The uniform scale. - The . - - - - Prepends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Prepends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Appends a scale matrix from the given uniform scale. - - The uniform scale. - The . - - - - Appends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Appends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Prepends a centered skew matrix from the give angles in degrees. - - The X angle, in degrees. - The Y angle, in degrees. - The . - - - - Prepends a centered skew matrix from the give angles in radians. - - The X angle, in radians. - The Y angle, in radians. - The . - - - - Prepends a skew matrix using the given angles in degrees at the given origin. - - The X angle, in degrees. - The Y angle, in degrees. - The skew origin point. - The . - - - - Prepends a skew matrix using the given angles in radians at the given origin. - - The X angle, in radians. - The Y angle, in radians. - The skew origin point. - The . - - - - Appends a centered skew matrix from the give angles in degrees. - - The X angle, in degrees. - The Y angle, in degrees. - The . - - - - Appends a centered skew matrix from the give angles in radians. - - The X angle, in radians. - The Y angle, in radians. - The . - - - - Appends a skew matrix using the given angles in degrees at the given origin. - - The X angle, in degrees. - The Y angle, in degrees. - The skew origin point. - The . - - - - Appends a skew matrix using the given angles in radians at the given origin. - - The X angle, in radians. - The Y angle, in radians. - The skew origin point. - The . - - - - Prepends a translation matrix from the given vector. - - The translation position. - The . - - - - Prepends a translation matrix from the given vector. - - The translation position. - The . - - - - Appends a translation matrix from the given vector. - - The translation position. - The . - - - - Appends a translation matrix from the given vector. - - The translation position. - The . - - - - Prepends a raw matrix. - - The matrix to prepend. - - The resultant matrix is degenerate containing one or more values equivalent - to or a zero determinant and therefore cannot be used - for linear transforms. - - The . - - - - Appends a raw matrix. - - The matrix to append. - - The resultant matrix is degenerate containing one or more values equivalent - to or a zero determinant and therefore cannot be used - for linear transforms. - - The . - - - - Returns the combined matrix for a given source size. - - The source image size. - The . - - - - Returns the combined matrix for a given source rectangle. - - The rectangle in the source image. - - The resultant matrix is degenerate containing one or more values equivalent - to or a zero determinant and therefore cannot be used - for linear transforms. - - The . - - - - Enumerated anchor positions to apply to resized images. - - - - - Anchors the position of the image to the center of it's bounding container. - - - - - Anchors the position of the image to the top of it's bounding container. - - - - - Anchors the position of the image to the bottom of it's bounding container. - - - - - Anchors the position of the image to the left of it's bounding container. - - - - - Anchors the position of the image to the right of it's bounding container. - - - - - Anchors the position of the image to the top left side of it's bounding container. - - - - - Anchors the position of the image to the top right side of it's bounding container. - - - - - Anchors the position of the image to the bottom right side of it's bounding container. - - - - - Anchors the position of the image to the bottom left side of it's bounding container. - - - - - Selects the value to be compared to threshold. - - - - - Compare the color luminance (according to ITU-R Recommendation BT.709). - - - - - Compare the HSL saturation of the color. - - - - - Compare the maximum of YCbCr chroma value, i.e. Cb and Cr distance from achromatic value. - - - - - Enumerates the various types of defined color blindness filters. - - - - - Partial color desensitivity. - - - - - Complete color desensitivity (Monochrome) - - - - - Green weak - - - - - Green blind - - - - - Red weak - - - - - Red blind - - - - - Blue weak - - - - - Blue blind - - - - - Performs processor application operations on the source image - - The pixel format - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The source image. - Whether to mutate the image. - - - - - - - - - - - - - - - - - - - - - - Defines extensions to apply binary dithering on an - using Mutate/Clone. - - - - - Dithers the image reducing it to two colors using ordered dithering. - - The image this method extends. - The ordered ditherer. - The to allow chaining of operations. - - - - Dithers the image reducing it to two colors using ordered dithering. - - The image this method extends. - The ordered ditherer. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold - The to allow chaining of operations. - - - - Dithers the image reducing it to two colors using ordered dithering. - - The image this method extends. - The ordered ditherer. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Dithers the image reducing it to two colors using ordered dithering. - - The image this method extends. - The ordered ditherer. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extension methods to apply binary thresholding on an - using Mutate/Clone. - - - - - Applies binarization to the image splitting the pixels at the given threshold with - Luminance as the color component to be compared to threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - The to allow chaining of operations. - - - - Applies binarization to the image splitting the pixels at the given threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - Selects the value to be compared to threshold. - The to allow chaining of operations. - - - - Applies binarization to the image splitting the pixels at the given threshold with - Luminance as the color component to be compared to threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies binarization to the image splitting the pixels at the given threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - Selects the value to be compared to threshold. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies binarization to the image splitting the pixels at the given threshold with - Luminance as the color component to be compared to threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold - The to allow chaining of operations. - - - - Applies binarization to the image splitting the pixels at the given threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold - Selects the value to be compared to threshold. - The to allow chaining of operations. - - - - Applies binarization to the image splitting the pixels at the given threshold with - Luminance as the color component to be compared to threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies binarization to the image splitting the pixels at the given threshold. - - The image this method extends. - The threshold to apply binarization of the image. Must be between 0 and 1. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold - Selects the value to be compared to threshold. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Adds bokeh blurring extensions to the type. - - - - - Applies a bokeh blur to the image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies a bokeh blur to the image. - - The image this method extends. - The 'radius' value representing the size of the area to sample. - The 'components' value representing the number of kernels to use to approximate the bokeh effect. - The gamma highlight factor to use to emphasize bright spots in the source image - The to allow chaining of operations. - - - - Applies a bokeh blur to the image. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a bokeh blur to the image. - - The image this method extends. - The 'radius' value representing the size of the area to sample. - The 'components' value representing the number of kernels to use to approximate the bokeh effect. - The gamma highlight factor to use to emphasize bright spots in the source image - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions methods to apply box blurring to an - using Mutate/Clone. - - - - - Applies a box blur to the image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies a box blur to the image. - - The image this method extends. - The 'radius' value representing the size of the area to sample. - The to allow chaining of operations. - - - - Applies a box blur to the image. - - The image this method extends. - The 'radius' value representing the size of the area to sample. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines edge detection extensions applicable on an using Mutate/Clone. - - - - - Detects any edges within the image. - Uses the kernel operating in grayscale mode. - - The image this method extends. - The to allow chaining of operations. - - - - Detects any edges within the image. - Uses the kernel operating in grayscale mode. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Detects any edges within the image operating in grayscale mode. - - The image this method extends. - The 2D edge detector kernel. - The to allow chaining of operations. - - - - Detects any edges within the image using a . - - The image this method extends. - The 2D edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - The to allow chaining of operations. - - - - Detects any edges within the image operating in grayscale mode. - - The image this method extends. - The 2D edge detector kernel. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Detects any edges within the image using a . - - The image this method extends. - The 2D edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Detects any edges within the image operating in grayscale mode. - - The image this method extends. - The edge detector kernel. - The to allow chaining of operations. - - - - Detects any edges within the image using a . - - The image this method extends. - The edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - The to allow chaining of operations. - - - - Detects any edges within the image operating in grayscale mode. - - The image this method extends. - The edge detector kernel. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Detects any edges within the image using a . - - The image this method extends. - The edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Detects any edges within the image operating in grayscale mode. - - The image this method extends. - Thecompass edge detector kernel. - The to allow chaining of operations. - - - - Detects any edges within the image using a . - - The image this method extends. - Thecompass edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - The to allow chaining of operations. - - - - Detects any edges within the image operating in grayscale mode. - - The image this method extends. - Thecompass edge detector kernel. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Detects any edges within the image using a . - - The image this method extends. - Thecompass edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines Gaussian blurring extensions to apply on an - using Mutate/Clone. - - - - - Applies a Gaussian blur to the image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies a Gaussian blur to the image. - - The image this method extends. - The 'sigma' value representing the weight of the blur. - The to allow chaining of operations. - - - - Applies a Gaussian blur to the image. - - The image this method extends. - The 'sigma' value representing the weight of the blur. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines Gaussian sharpening extensions to apply on an - using Mutate/Clone. - - - - - Applies a Gaussian sharpening filter to the image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies a Gaussian sharpening filter to the image. - - The image this method extends. - The 'sigma' value representing the weight of the blur. - The to allow chaining of operations. - - - - Applies a Gaussian sharpening filter to the image. - - The image this method extends. - The 'sigma' value representing the weight of the blur. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines dithering extensions to apply on an - using Mutate/Clone. - - - - - Dithers the image reducing it to a web-safe palette using . - - The image this method extends. - The to allow chaining of operations. - - - - Dithers the image reducing it to a web-safe palette. - - The image this method extends. - The ordered ditherer. - The to allow chaining of operations. - - - - Dithers the image reducing it to a web-safe palette. - - The image this method extends. - The ordered ditherer. - The dithering scale used to adjust the amount of dither. - The to allow chaining of operations. - - - - Dithers the image reducing it to the given palette. - - The image this method extends. - The ordered ditherer. - The palette to select substitute colors from. - The to allow chaining of operations. - - - - Dithers the image reducing it to the given palette. - - The image this method extends. - The ordered ditherer. - The dithering scale used to adjust the amount of dither. - The palette to select substitute colors from. - The to allow chaining of operations. - - - - Dithers the image reducing it to a web-safe palette using . - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Dithers the image reducing it to a web-safe palette. - - The image this method extends. - The ordered ditherer. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Dithers the image reducing it to a web-safe palette. - - The image this method extends. - The ordered ditherer. - The dithering scale used to adjust the amount of dither. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Dithers the image reducing it to the given palette. - - The image this method extends. - The ordered ditherer. - The palette to select substitute colors from. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Dithers the image reducing it to the given palette. - - The image this method extends. - The ordered ditherer. - The dithering scale used to adjust the amount of dither. - The palette to select substitute colors from. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Adds extensions that allow the drawing of images to the type. - - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The opacity of the image to blend. Must be between 0 and 1. - The . - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The blending mode. - The opacity of the image to blend. Must be between 0 and 1. - The . - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The color blending mode. - The alpha composition mode. - The opacity of the image to blend. Must be between 0 and 1. - The . - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The options, including the blending type and blending amount. - The . - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The location to draw the blended image. - The opacity of the image to blend. Must be between 0 and 1. - The . - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The location to draw the blended image. - The color blending to apply. - The opacity of the image to blend. Must be between 0 and 1. - The . - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The location to draw the blended image. - The color blending to apply. - The alpha composition mode. - The opacity of the image to blend. Must be between 0 and 1. - The . - - - - Draws the given image together with the current one by blending their pixels. - - The image this method extends. - The image to blend with the currently processing image. - The location to draw the blended image. - The options containing the blend mode and opacity. - The . - - - - Defines oil painting effect extensions applicable on an - using Mutate/Clone. - - - - - Alters the colors of the image recreating an oil painting effect with levels and brushSize - set to 10 and 15 respectively. - - The image this method extends. - The to allow chaining of operations. - - - - Alters the colors of the image recreating an oil painting effect with levels and brushSize - set to 10 and 15 respectively. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Alters the colors of the image recreating an oil painting effect. - - The image this method extends. - The number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image. - The number of neighboring pixels used in calculating each individual pixel value. - The to allow chaining of operations. - - - - Alters the colors of the image recreating an oil painting effect. - - The image this method extends. - The number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image. - The number of neighboring pixels used in calculating each individual pixel value. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines pixelation effect extensions applicable on an - using Mutate/Clone. - - - - - Pixelates an image with the given pixel size. - - The image this method extends. - The to allow chaining of operations. - - - - Pixelates an image with the given pixel size. - - The image this method extends. - The size of the pixels. - The to allow chaining of operations. - - - - Pixelates an image with the given pixel size. - - The image this method extends. - The size of the pixels. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extension methods that allow the application of user defined processing delegate to an . - - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - The to allow chaining of operations. - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - The to apply during the pixel conversions. - The to allow chaining of operations. - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - - The structure that specifies the portion of the image object to alter. - - The to apply during the pixel conversions. - The to allow chaining of operations. - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - The to allow chaining of operations. - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - The to apply during the pixel conversions. - The to allow chaining of operations. - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a user defined processing delegate to the image. - - The image this method extends. - The user defined processing delegate to use to modify image rows. - - The structure that specifies the portion of the image object to alter. - - The to apply during the pixel conversions. - The to allow chaining of operations. - - - - Defines extension methods that allow the application of black and white toning to an - using Mutate/Clone. - - - - - Applies black and white toning to the image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies black and white toning to the image. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the alteration of the brightness component of an - using Mutate/Clone. - - - - - Alters the brightness component of the image. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing brighter results. - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - The to allow chaining of operations. - - - - Alters the brightness component of the image. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing brighter results. - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that simulate the effects of various color blindness disorders on an - using Mutate/Clone. - - - - - Applies the given colorblindness simulator to the image. - - The image this method extends. - The type of color blindness simulator to apply. - The to allow chaining of operations. - - - - Applies the given colorblindness simulator to the image. - - The image this method extends. - The type of color blindness simulator to apply. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the alteration of the contrast component of an - using Mutate/Clone. - - - - - Alters the contrast component of the image. - - - A value of 0 will create an image that is completely gray. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing results with more contrast. - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - The to allow chaining of operations. - - - - Alters the contrast component of the image. - - - A value of 0 will create an image that is completely gray. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing results with more contrast. - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the application of composable filters to an - using Mutate/Clone. - - - - - Filters an image by the given color matrix - - The image this method extends. - The filter color matrix - The to allow chaining of operations. - - - - Filters an image by the given color matrix - - The image this method extends. - The filter color matrix - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the application of grayscale toning to an - using Mutate/Clone. - - - - - Applies grayscale toning to the image. - - The image this method extends. - The . - - - - Applies grayscale toning to the image using the given amount. - - The image this method extends. - The proportion of the conversion. Must be between 0 and 1. - The . - - - - Applies grayscale toning to the image with the given . - - The image this method extends. - The formula to apply to perform the operation. - The . - - - - Applies grayscale toning to the image with the given using the given amount. - - The image this method extends. - The formula to apply to perform the operation. - The proportion of the conversion. Must be between 0 and 1. - The . - - - - Applies grayscale toning to the image. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The . - - - - Applies grayscale toning to the image using the given amount. - - The image this method extends. - The proportion of the conversion. Must be between 0 and 1. - - The structure that specifies the portion of the image object to alter. - - The . - - - - Applies grayscale toning to the image. - - The image this method extends. - The formula to apply to perform the operation. - - The structure that specifies the portion of the image object to alter. - - The . - - - - Applies grayscale toning to the image using the given amount. - - The image this method extends. - The formula to apply to perform the operation. - The proportion of the conversion. Must be between 0 and 1. - - The structure that specifies the portion of the image object to alter. - - The . - - - - Defines extensions that allow the alteration of the hue component of an - using Mutate/Clone. - - - - - Alters the hue component of the image. - - The image this method extends. - The rotation angle in degrees to adjust the hue. - The to allow chaining of operations. - - - - Alters the hue component of the image. - - The image this method extends. - The rotation angle in degrees to adjust the hue. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the inversion of colors of an - using Mutate/Clone. - - - - - Inverts the colors of the image. - - The image this method extends. - The to allow chaining of operations. - - - - Inverts the colors of the image. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the recreation of an old Kodachrome camera effect on an - using Mutate/Clone. - - - - - Alters the colors of the image recreating an old Kodachrome camera effect. - - The image this method extends. - The to allow chaining of operations. - - - - Alters the colors of the image recreating an old Kodachrome camera effect. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the alteration of the lightness component of an - using Mutate/Clone. - - - - - Alters the lightness component of the image. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing lighter results. - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - The to allow chaining of operations. - - - - Alters the lightness component of the image. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing lighter results. - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the recreation of an old Lomograph camera effect on an - using Mutate/Clone. - - - - - Alters the colors of the image recreating an old Lomograph camera effect. - - The image this method extends. - The to allow chaining of operations. - - - - Alters the colors of the image recreating an old Lomograph camera effect. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the alteration of the opacity component of an - using Mutate/Clone. - - - - - Multiplies the alpha component of the image. - - The image this method extends. - The proportion of the conversion. Must be between 0 and 1. - The to allow chaining of operations. - - - - Multiplies the alpha component of the image. - - The image this method extends. - The proportion of the conversion. Must be between 0 and 1. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the recreation of an old Polaroid camera effect on an - using Mutate/Clone. - - - - - Alters the colors of the image recreating an old Polaroid camera effect. - - The image this method extends. - The to allow chaining of operations. - - - - Alters the colors of the image recreating an old Polaroid camera effect. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the alteration of the saturation component of an - using Mutate/Clone. - - - - - Alters the saturation component of the image. - - - A value of 0 is completely un-saturated. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of amount over 1 are allowed, providing super-saturated results - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - The to allow chaining of operations. - - - - Alters the saturation component of the image. - - - A value of 0 is completely un-saturated. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of amount over 1 are allowed, providing super-saturated results - - The image this method extends. - The proportion of the conversion. Must be greater than or equal to 0. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the application of sepia toning on an - using Mutate/Clone. - - - - - Applies sepia toning to the image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies sepia toning to the image using the given amount. - - The image this method extends. - The proportion of the conversion. Must be between 0 and 1. - The to allow chaining of operations. - - - - Applies sepia toning to the image. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies sepia toning to the image. - - The image this method extends. - The proportion of the conversion. Must be between 0 and 1. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extension that allow the adjustment of the contrast of an image via its histogram. - - - - - Equalizes the histogram of an image to increases the contrast. - - The image this method extends. - The to allow chaining of operations. - - - - Equalizes the histogram of an image to increases the contrast. - - The image this method extends. - The histogram equalization options to use. - The to allow chaining of operations. - - - - Defines extension methods to replace the background color of an - using Mutate/Clone. - - - - - Replaces the background color of image with the given one. - - The image this method extends. - The color to set as the background. - The to allow chaining of operations. - - - - Replaces the background color of image with the given one. - - The image this method extends. - The color to set as the background. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Replaces the background color of image with the given one. - - The image this method extends. - The options effecting pixel blending. - The color to set as the background. - The to allow chaining of operations. - - - - Replaces the background color of image with the given one. - - The image this method extends. - The options effecting pixel blending. - The color to set as the background. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the application of a radial glow on an - using Mutate/Clone. - - - - - Applies a radial glow effect to an image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The color to set as the glow. - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The the radius. - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The color to set as the glow. - The the radius. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The options effecting things like blending. - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The options effecting things like blending. - The color to set as the glow. - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The options effecting things like blending. - The the radius. - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The options effecting things like blending. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The options effecting things like blending. - The color to set as the glow. - The the radius. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The options effecting things like blending. - The color to set as the glow. - The the radius. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial glow effect to an image. - - The image this method extends. - The options effecting things like blending. - The color to set as the glow. - The the radius. - The to allow chaining of operations. - - - - Defines extensions that allow the application of a radial glow to an - using Mutate/Clone. - - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The color to set as the vignette. - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The the x-radius. - The the y-radius. - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The color to set as the vignette. - The the x-radius. - The the y-radius. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The options effecting pixel blending. - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The options effecting pixel blending. - The color to set as the vignette. - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The options effecting pixel blending. - The the x-radius. - The the y-radius. - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The options effecting pixel blending. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies a radial vignette effect to an image. - - The image this method extends. - The options effecting pixel blending. - The color to set as the vignette. - The the x-radius. - The the y-radius. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Adds extensions that allow the processing of images to the type. - - - Defines extensions that allow the computation of image integrals on an - - - - - Mutates the source image by applying the image operation to it. - - The image to mutate. - The operation to perform on the source. - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - - - - Mutates the source image by applying the image operation to it. - - The image to mutate. - The configuration which allows altering default behaviour or extending the library. - The operation to perform on the source. - The configuration is null. - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - - - - Mutates the source image by applying the image operation to it. - - The pixel format. - The image to mutate. - The operation to perform on the source. - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - - - - Mutates the source image by applying the image operation to it. - - The pixel format. - The image to mutate. - The configuration which allows altering default behaviour or extending the library. - The operation to perform on the source. - The configuration is null. - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - - - - Mutates the source image by applying the operations to it. - - The pixel format. - The image to mutate. - The operations to perform on the source. - The source is null. - The operations are null. - The source has been disposed. - The processing operation failed. - - - - Mutates the source image by applying the operations to it. - - The pixel format. - The image to mutate. - The configuration which allows altering default behaviour or extending the library. - The operations to perform on the source. - The configuration is null. - The source is null. - The operations are null. - The source has been disposed. - The processing operation failed. - - - - Creates a deep clone of the current image. The clone is then mutated by the given operation. - - The image to clone. - The operation to perform on the clone. - The new . - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - - - - Creates a deep clone of the current image. The clone is then mutated by the given operation. - - The image to clone. - The configuration which allows altering default behaviour or extending the library. - The operation to perform on the clone. - The configuration is null. - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - The new . - - - - Creates a deep clone of the current image. The clone is then mutated by the given operation. - - The pixel format. - The image to clone. - The operation to perform on the clone. - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - The new . - - - - Creates a deep clone of the current image. The clone is then mutated by the given operation. - - The pixel format. - The image to clone. - The configuration which allows altering default behaviour or extending the library. - The operation to perform on the clone. - The configuration is null. - The source is null. - The operation is null. - The source has been disposed. - The processing operation failed. - The new - - - - Creates a deep clone of the current image. The clone is then mutated by the given operations. - - The pixel format. - The image to clone. - The operations to perform on the clone. - The source is null. - The operations are null. - The source has been disposed. - The processing operation failed. - The new - - - - Creates a deep clone of the current image. The clone is then mutated by the given operations. - - The pixel format. - The image to clone. - The configuration which allows altering default behaviour or extending the library. - The operations to perform on the clone. - The configuration is null. - The source is null. - The operations are null. - The source has been disposed. - The processing operation failed. - The new - - - - Applies the given collection against the context - - The image processing context. - The operations to perform on the source. - The processing operation failed. - The to allow chaining of operations. - - - - Apply an image integral. - - The image on which to apply the integral. - The type of the pixel. - The containing all the sums. - - - - Defines extensions that allow the application of quantizing algorithms on an - using Mutate/Clone. - - - - - Applies quantization to the image using the . - - The image this method extends. - The to allow chaining of operations. - - - - Applies quantization to the image. - - The image this method extends. - The quantizer to apply to perform the operation. - The to allow chaining of operations. - - - - Applies quantization to the image using the . - - The image this method extends. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Applies quantization to the image. - - The image this method extends. - The quantizer to apply to perform the operation. - - The structure that specifies the portion of the image object to alter. - - The to allow chaining of operations. - - - - Defines extensions that allow the application of auto-orientation operations to an - using Mutate/Clone. - - - - - Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. - - The image to auto rotate. - The to allow chaining of operations. - - - - Defines extensions that allow the application of cropping operations on an - using Mutate/Clone. - - - - - Crops an image to the given width and height. - - The image to resize. - The target image width. - The target image height. - The to allow chaining of operations. - - - - Crops an image to the given rectangle. - - The image to crop. - - The structure that specifies the portion of the image object to retain. - - The to allow chaining of operations. - - - - Defines extensions that allow the application of entropy cropping operations on an - using Mutate/Clone. - - - - - Crops an image to the area of greatest entropy using a threshold for entropic density of .5F. - - The image to crop. - The to allow chaining of operations. - - - - Crops an image to the area of greatest entropy. - - The image to crop. - The threshold for entropic density. - The to allow chaining of operations. - - - - Defines extensions that allow the application of flipping operations on an - using Mutate/Clone. - - - - - Flips an image by the given instructions. - - The image to rotate, flip, or both. - The to perform the flip. - The to allow chaining of operations. - - - - Defines extensions that allow the application of padding operations on an - using Mutate/Clone. - - - - - Evenly pads an image to fit the new dimensions. - - The source image to pad. - The new width. - The new height. - The to allow chaining of operations. - - - - Evenly pads an image to fit the new dimensions with the given background color. - - The source image to pad. - The new width. - The new height. - The background color with which to pad the image. - The to allow chaining of operations. - - - - Defines extensions that allow the application of resize operations on an - using Mutate/Clone. - - - - - Resizes an image to the given . - - The image to resize. - The target image size. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given . - - The image to resize. - The target image size. - Whether to compress and expand the image color-space to gamma correct the image during processing. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given width and height. - - The image to resize. - The target image width. - The target image height. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given width and height. - - The image to resize. - The target image width. - The target image height. - Whether to compress and expand the image color-space to gamma correct the image during processing. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given width and height with the given sampler. - - The image to resize. - The target image width. - The target image height. - The to perform the resampling. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given width and height with the given sampler. - - The image to resize. - The target image size. - The to perform the resampling. - Whether to compress and expand the image color-space to gamma correct the image during processing. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given width and height with the given sampler. - - The image to resize. - The target image width. - The target image height. - The to perform the resampling. - Whether to compress and expand the image color-space to gamma correct the image during processing. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given width and height with the given sampler and - source rectangle. - - The image to resize. - The target image width. - The target image height. - The to perform the resampling. - - The structure that specifies the portion of the image object to draw. - - - The structure that specifies the portion of the target image object to draw to. - - Whether to compress and expand the image color-space to gamma correct the image during processing. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image to the given width and height with the given sampler and source rectangle. - - The image to resize. - The target image width. - The target image height. - The to perform the resampling. - - The structure that specifies the portion of the target image object to draw to. - - Whether to compress and expand the image color-space to gamma correct the image during processing. - The to allow chaining of operations. - Passing zero for one of height or width will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Resizes an image in accordance with the given . - - The image to resize. - The resize options. - The to allow chaining of operations. - Passing zero for one of height or width within the resize options will automatically preserve the aspect ratio of the original image or the nearest possible ratio. - - - - Defines extensions that allow the application of rotate operations on an - using Mutate/Clone. - - - - - Rotates and flips an image by the given instructions. - - The image to rotate. - The to perform the rotation. - The to allow chaining of operations. - - - - Rotates an image by the given angle in degrees. - - The image to rotate. - The angle in degrees to perform the rotation. - The to allow chaining of operations. - - - - Rotates an image by the given angle in degrees using the specified sampling algorithm. - - The image to rotate. - The angle in degrees to perform the rotation. - The to perform the resampling. - The to allow chaining of operations. - - - - Defines extensions that allow the application of rotate-flip operations on an - using Mutate/Clone. - - - - - Rotates and flips an image by the given instructions. - - The image to rotate, flip, or both. - The to perform the rotation. - The to perform the flip. - The to allow chaining of operations. - - - - Defines extensions that allow the application of skew operations on an - using Mutate/Clone. - - - - - Skews an image by the given angles in degrees. - - The image to skew. - The angle in degrees to perform the skew along the x-axis. - The angle in degrees to perform the skew along the y-axis. - The to allow chaining of operations. - - - - Skews an image by the given angles in degrees using the specified sampling algorithm. - - The image to skew. - The angle in degrees to perform the skew along the x-axis. - The angle in degrees to perform the skew along the y-axis. - The to perform the resampling. - The to allow chaining of operations. - - - - Defines extensions that allow the application of swizzle operations on an - - - - - Swizzles an image. - - The image to swizzle. - The swizzler function. - The swizzler function type. - The to allow chaining of operations. - - - - Defines extensions that allow the application of composable transform operations on an - using Mutate/Clone. - - - - - Performs an affine transform of an image. - - The image to transform. - The affine transform builder. - The - - - - Performs an affine transform of an image using the specified sampling algorithm. - - The . - The affine transform builder. - The to perform the resampling. - The to allow chaining of operations. - - - - Performs an affine transform of an image using the specified sampling algorithm. - - The . - The source rectangle - The affine transform builder. - The to perform the resampling. - The to allow chaining of operations. - - - - Performs an affine transform of an image using the specified sampling algorithm. - - The . - The source rectangle - The transformation matrix. - The size of the result image. - The to perform the resampling. - The to allow chaining of operations. - - - - Performs a projective transform of an image. - - The image to transform. - The affine transform builder. - The to allow chaining of operations. - - - - Performs a projective transform of an image using the specified sampling algorithm. - - The . - The projective transform builder. - The to perform the resampling. - The to allow chaining of operations. - - - - Performs a projective transform of an image using the specified sampling algorithm. - - The . - The source rectangle - The projective transform builder. - The to perform the resampling. - The to allow chaining of operations. - - - - Performs a projective transform of an image using the specified sampling algorithm. - - The . - The source rectangle - The transformation matrix. - The size of the result image. - The to perform the resampling. - The to allow chaining of operations. - - - - Provides enumeration over how a image should be flipped. - - - - - Don't flip the image. - - - - - Flip the image horizontally. - - - - - Flip the image vertically. - - - - - Enumerates the various types of defined grayscale filters. - - - - - ITU-R Recommendation BT.709 - - - - - ITU-R Recommendation BT.601 - - - - - A pixel-agnostic interface to queue up image operations to apply to an image. - - - - - Gets the configuration which allows altering default behaviour or extending the library. - - - - - Gets a set of properties for the Image Processing Context. - - This can be used for storing global settings and defaults to be accessable to processors. - - - - Gets the image dimensions at the current point in the processing pipeline. - - The . - - - - Adds the processor to the current set of image operations to be applied. - - The processor to apply. - The area to apply it to. - The current operations class to allow chaining of operations. - - - - Adds the processor to the current set of image operations to be applied. - - The processor to apply. - The current operations class to allow chaining of operations. - - - - Represents an interface that will create IInternalImageProcessingContext instances - - - - - Called during mutate operations to generate the image operations provider. - - The pixel format - The configuration which allows altering default behaviour or extending the library. - The source image. - A flag to determine whether image operations are allowed to mutate the source image. - A new - - - - The default implementation of - - - - - - - - An interface for internal operations we don't want to expose on . - - The pixel type. - - - - Returns the result image to return by - (and other overloads). - - The current image or a new image depending on whether it is requested to mutate the source image. - - - - Contains reusable static instances of known dithering algorithms. - - - - - Gets the order ditherer using the 2x2 Bayer dithering matrix - - - - - Gets the order ditherer using the 3x3 dithering matrix - - - - - Gets the order ditherer using the 4x4 Bayer dithering matrix - - - - - Gets the order ditherer using the 8x8 Bayer dithering matrix - - - - - Gets the order ditherer using the 16x16 Bayer dithering matrix - - - - - Gets the error Dither that implements the Atkinson algorithm. - - - - - Gets the error Dither that implements the Burks algorithm. - - - - - Gets the error Dither that implements the Floyd-Steinberg algorithm. - - - - - Gets the error Dither that implements the Jarvis-Judice-Ninke algorithm. - - - - - Gets the error Dither that implements the Sierra-2 algorithm. - - - - - Gets the error Dither that implements the Sierra-3 algorithm. - - - - - Gets the error Dither that implements the Sierra-Lite algorithm. - - - - - Gets the error Dither that implements the Stevenson-Arce algorithm. - - - - - Gets the error Dither that implements the Stucki algorithm. - - - - - Contains reusable static instances of known edge detection kernels. - - - - - Gets the Kayyali edge detector kernel. - - - - - Gets the Kirsch edge detector kernel. - - - - - Gets the Laplacian 3x3 edge detector kernel. - - - - - Gets the Laplacian 5x5 edge detector kernel. - - - - - Gets the Laplacian of Gaussian edge detector kernel. - - - - - Gets the Prewitt edge detector kernel. - - - - - Gets the Roberts-Cross edge detector kernel. - - - - - Gets the Robinson edge detector kernel. - - - - - Gets the Scharr edge detector kernel. - - - - - Gets the Sobel edge detector kernel. - - - - - A collection of known values for composing filters - - - - - Gets a filter recreating Achromatomaly (Color desensitivity) color blindness - - - - - Gets a filter recreating Achromatopsia (Monochrome) color blindness. - - - - - Gets a filter recreating Deuteranomaly (Green-Weak) color blindness. - - - - - Gets a filter recreating Deuteranopia (Green-Blind) color blindness. - - - - - Gets a filter recreating Protanomaly (Red-Weak) color blindness. - - - - - Gets a filter recreating Protanopia (Red-Blind) color blindness. - - - - - Gets a filter recreating Tritanomaly (Blue-Weak) color blindness. - - - - - Gets a filter recreating Tritanopia (Blue-Blind) color blindness. - - - - - Gets an approximated black and white filter - - - - - Gets a filter recreating an old Kodachrome camera effect. - - - - - Gets a filter recreating an old Lomograph camera effect. - - - - - Gets a filter recreating an old Polaroid camera effect. - - - - - Create a brightness filter matrix using the given amount. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing brighter results. - - The proportion of the conversion. Must be greater than or equal to 0. - The - - - - Create a contrast filter matrix using the given amount. - - - A value of 0 will create an image that is completely gray. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing results with more contrast. - - The proportion of the conversion. Must be greater than or equal to 0. - The - - - - Create a grayscale filter matrix using the given amount using the formula as specified by ITU-R Recommendation BT.601. - - - The proportion of the conversion. Must be between 0 and 1. - The - - - - Create a grayscale filter matrix using the given amount using the formula as specified by ITU-R Recommendation BT.709. - - - The proportion of the conversion. Must be between 0 and 1. - The - - - - Create a hue filter matrix using the given angle in degrees. - - The angle of rotation in degrees. - The - - - - Create an invert filter matrix using the given amount. - - The proportion of the conversion. Must be between 0 and 1. - The - - - - Create an opacity filter matrix using the given amount. - - The proportion of the conversion. Must be between 0 and 1. - The - - - - Create a saturation filter matrix using the given amount. - - - A value of 0 is completely un-saturated. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of amount over 1 are allowed, providing super-saturated results - - The proportion of the conversion. Must be greater than or equal to 0. - The - - - - Create a lightness filter matrix using the given amount. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing lighter results. - - The proportion of the conversion. Must be greater than or equal to 0. - The - - - - Create a sepia filter matrix using the given amount. - The formula used matches the svg specification. - - The proportion of the conversion. Must be between 0 and 1. - The - - - - Contains reusable static instances of known quantizing algorithms - - - - - Gets the adaptive Octree quantizer. Fast with good quality. - - - - - Gets the Xiaolin Wu's Color Quantizer which generates high quality output. - - - - - Gets the palette based quantizer consisting of web safe colors as defined in the CSS Color Module Level 4. - - - - - Gets the palette based quantizer consisting of colors as defined in the original second edition of Werner’s Nomenclature of Colours 1821. - The hex codes were collected and defined by Nicholas Rougeux - - - - - Contains reusable static instances of known resampling algorithms - - - - - Gets the Bicubic sampler that implements the bicubic kernel algorithm W(x) - - - - - Gets the Box sampler that implements the box algorithm. Similar to nearest neighbor when upscaling. - When downscaling the pixels will average, merging pixels together. - - - - - Gets the Catmull-Rom sampler, a well known standard Cubic Filter often used as a interpolation function - - - - - Gets the Hermite sampler. A type of smoothed triangular interpolation filter that rounds off strong edges while - preserving flat 'color levels' in the original image. - - - - - Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 2 pixels. - This algorithm provides sharpened results when compared to others when downsampling. - - - - - Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 3 pixels - This algorithm provides sharpened results when compared to others when downsampling. - - - - - Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 5 pixels - This algorithm provides sharpened results when compared to others when downsampling. - - - - - Gets the Lanczos kernel sampler that implements smooth interpolation with a radius of 8 pixels - This algorithm provides sharpened results when compared to others when downsampling. - - - - - Gets the Mitchell-Netravali sampler. This seperable cubic algorithm yields a very good equilibrium between - detail preservation (sharpness) and smoothness. - - - - - Gets the Nearest-Neighbour sampler that implements the nearest neighbor algorithm. This uses a very fast, unscaled filter - which will select the closest pixel to the new pixels position. - - - - - Gets the Robidoux sampler. This algorithm developed by Nicolas Robidoux providing a very good equilibrium between - detail preservation (sharpness) and smoothness comparable to . - - - - - Gets the Robidoux Sharp sampler. A sharpened form of the sampler - - - - - Gets the Spline sampler. A separable cubic algorithm similar to but yielding smoother results. - - - - - Gets the Triangle sampler, otherwise known as Bilinear. This interpolation algorithm can be used where perfect image transformation - with pixel matching is impossible, so that one can calculate and assign appropriate intensity values to pixels - - - - - Gets the Welch sampler. A high speed algorithm that delivers very sharpened results. - - - - - A representing a user defined processing delegate to use to modify image rows. - - The target row of pixels to process. - The , , , and fields map the RGBA channels respectively. - - - - A representing a user defined processing delegate to use to modify image rows. - - - The type of the parameter of the method that this delegate encapsulates. - This type parameter is contravariant.That is, you can use either the type you specified or any type that is less derived. - - The target row of pixels to process. - The parameter of the method that this delegate encapsulates. - The , , , and fields map the RGBA channels respectively. - - - - Performs Bradley Adaptive Threshold filter against an image. - - - Implements "Adaptive Thresholding Using the Integral Image", - see paper: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.420.7883&rep=rep1&type=pdf - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Threshold limit. - - - - Initializes a new instance of the class. - - Color for upper threshold. - Color for lower threshold. - - - - Initializes a new instance of the class. - - Color for upper threshold. - Color for lower threshold. - Threshold limit. - - - - Gets or sets upper color limit for thresholding. - - - - - Gets or sets lower color limit for threshold. - - - - - Gets or sets the value for threshold limit. - - - - - - - - Performs Bradley Adaptive Threshold filter against an image. - - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Performs simple binary threshold filtering against an image. - - - - - Initializes a new instance of the class. - - The threshold to split the image. Must be between 0 and 1. - The color component to be compared to threshold. - - - - Initializes a new instance of the class with - Luminance as color component to be compared to threshold. - - The threshold to split the image. Must be between 0 and 1. - - - - Initializes a new instance of the class. - - The threshold to split the image. Must be between 0 and 1. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold. - The color component to be compared to threshold. - - - - Initializes a new instance of the class with - Luminance as color component to be compared to threshold. - - The threshold to split the image. Must be between 0 and 1. - The color to use for pixels that are above the threshold. - The color to use for pixels that are below the threshold. - - - - Gets the threshold value. - - - - - Gets the color to use for pixels that are above the threshold. - - - - - Gets the color to use for pixels that fall below the threshold. - - - - - Gets the defining the value to be compared to threshold. - - - - - - - - Performs simple binary threshold filtering against an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - A implementing the clone logic for . - - - - - - - - The base class for all cloning image processors. - - - - - - - - - - - The base class for all pixel specific cloning image processors. - Allows the application of processing algorithms to the image. - The image is cloned before operating upon and the buffers swapped upon completion. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets The source for the current processor instance. - - - - - Gets The source area to process for the current processor instance. - - - - - Gets the instance to use when performing operations. - - - - - - - - - - - - - - Gets the size of the destination image. - - The . - - - - This method is called before the process is applied to prepare the processor. - - The cloned/destination image. Cannot be null. - - - - This method is called before the process is applied to prepare the processor. - - The source image. Cannot be null. - The cloned/destination image. Cannot be null. - - - - Applies the process to the specified portion of the specified at the specified location - and with the specified size. - - The source image. Cannot be null. - The cloned/destination image. Cannot be null. - - - - This method is called after the process is applied to prepare the processor. - - The source image. Cannot be null. - The cloned/destination image. Cannot be null. - - - - This method is called after the process is applied to prepare the processor. - - The cloned/destination image. Cannot be null. - - - - Disposes the object and frees resources for the Garbage Collector. - - Whether to dispose managed and unmanaged objects. - - - - Applies bokeh blur processing to the image. - - - - - The default radius used by the parameterless constructor. - - - - - The default component count used by the parameterless constructor. - - - - - The default gamma used by the parameterless constructor. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - The 'radius' value representing the size of the area to sample. - - - The number of components to use to approximate the original 2D bokeh blur convolution kernel. - - - The gamma highlight factor to use to further process the image. - - - - - Gets the radius. - - - - - Gets the number of components. - - - - - Gets the gamma highlight factor to use when applying the effect. - - - - - - - - A implementing the horizontal convolution logic for . - - - This type is located in the non-generic class and not in , where - it is actually used, because it does not use any generic parameters internally. Defining in a non-generic class means that there will only - ever be a single instantiation of this type for the JIT/AOT compilers to process, instead of having duplicate versions for each pixel type. - - - - - - - - Applies bokeh blur processing to the image. - - The pixel format. - This processor is based on the code from Mike Pound, see github.com/mikepound/convolve. - - - - The gamma highlight factor to use when applying the effect - - - - - The size of each complex convolution kernel. - - - - - The kernel parameters to use for the current instance (a: X, b: Y, A: Z, B: W) - - - - - The kernel components for the current instance - - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the complex kernels to use to apply the blur for the current instance - - - - - Gets the kernel parameters used to compute the pixel values from each complex pixel - - - - - - - - Computes and aggregates the convolution for each complex kernel component in the processor. - - The source image. Cannot be null. - The structure that specifies the portion of the image object to draw. - The configuration. - The buffer with the raw pixel data to use to aggregate the results of each convolution. - - - - A implementing the vertical convolution logic for . - - - - - - - - A implementing the gamma exposure logic for . - - - - - - - - A implementing the 3F gamma exposure logic for . - - - - - - - - A implementing the inverse gamma exposure logic for . - - - - - - - - A implementing the inverse 3F gamma exposure logic for . - - - - - - - - Defines a box blur processor of a given radius. - - - - - The default radius used by the parameterless constructor. - - - - - Initializes a new instance of the class. - - - The 'radius' value representing the size of the area to sample. - - - - - Initializes a new instance of the class. - - - - - Gets the Radius. - - - - - - - - Applies box blur processing to the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the 1D convolution kernel. - - - - - - - - Create a 1 dimensional Box kernel. - - The maximum size of the kernel in either direction. - The . - - - - Defines a processor that uses two one-dimensional matrices to perform convolution against an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The horizontal gradient operator. - The vertical gradient operator. - Whether the convolution filter is applied to alpha as well as the color channels. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the horizontal convolution kernel. - - - - - Gets the vertical convolution kernel. - - - - - Gets a value indicating whether the convolution filter is applied to alpha as well as the color channels. - - - - - - - - A implementing the logic for 2D convolution. - - - - - - - - A stack only struct used for reducing reference indirection during 2D convolution operations. - - - - - Defines a processor that uses two one-dimensional matrices to perform two-pass convolution against an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The 1D convolution kernel. - Whether the convolution filter is applied to alpha as well as the color channels. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the convolution kernel. - - - - - Gets a value indicating whether the convolution filter is applied to alpha as well as the color channels. - - - - - - - - A implementing the logic for the horizontal 1D convolution. - - - - - - - - A implementing the logic for the vertical 1D convolution. - - - - - - - - Kernel radius is calculated using the minimum viable value. - See . - - - - - Create a 1 dimensional Gaussian kernel using the Gaussian G(x) function. - - The convolution kernel. - - - - Create a 1 dimensional Gaussian kernel using the Gaussian G(x) function - - The convolution kernel. - - - - Defines a processor that uses a 2 dimensional matrix to perform convolution against an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The 2d gradient operator. - Whether the convolution filter is applied to alpha as well as the color channels. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the 2d convolution kernel. - - - - - Gets a value indicating whether the convolution filter is applied to alpha as well as the color channels. - - - - - - - - A implementing the convolution logic for . - - - - - - - - A stack only struct used for reducing reference indirection during convolution operations. - - - - - Defines edge detection using the two 1D gradient operators. - - - - - Initializes a new instance of the class. - - The 2D edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - - - - Gets the 2D edge detector kernel. - - - - - Gets a value indicating whether to convert the image to grayscale before performing - edge detection. - - - - - - - - Defines a processor that detects edges within an image using two one-dimensional matrices. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Defines edge detection using eight gradient operators. - - - - - Initializes a new instance of the class. - - The edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - - - - Gets the edge detector kernel. - - - - - Gets a value indicating whether to convert the image to grayscale before performing - edge detection. - - - - - - - - Defines a processor that detects edges within an image using a eight two dimensional matrices. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - A implementing the convolution logic for . - - - - - - - - Defines edge detection using a single 2D gradient operator. - - - - - Initializes a new instance of the class. - - The edge detector kernel. - - Whether to convert the image to grayscale before performing edge detection. - - - - - Gets the edge detector kernel. - - - - - Gets a value indicating whether to convert the image to grayscale before performing - edge detection. - - - - - - - - Defines a processor that detects edges within an image using a single two dimensional matrix. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The target area to process for the current processor instance. - - - - - - - - - - Defines Gaussian blur by a (Sigma, Radius) pair. - - - - - The default value for . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The 'sigma' value representing the weight of the blur. - - - - Initializes a new instance of the class. - - - The 'radius' value representing the size of the area to sample. - - - - - Initializes a new instance of the class. - - - The 'sigma' value representing the weight of the blur. - - - The 'radius' value representing the size of the area to sample. - This should be at least twice the sigma value. - - - - - Gets the sigma value representing the weight of the blur - - - - - Gets the radius defining the size of the area to sample. - - - - - - - - Applies Gaussian blur processing to an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the 1D convolution kernel. - - - - - - - - Defines Gaussian sharpening by a (Sigma, Radius) pair. - - - - - The default value for . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The 'sigma' value representing the weight of the blur. - - - - Initializes a new instance of the class. - - - The 'radius' value representing the size of the area to sample. - - - - - Initializes a new instance of the class. - - - The 'sigma' value representing the weight of the blur. - - - The 'radius' value representing the size of the area to sample. - This should be at least twice the sigma value. - - - - - Gets the sigma value representing the weight of the blur - - - - - Gets the radius defining the size of the area to sample. - - - - - - - - Applies Gaussian sharpening processing to the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the 1D convolution kernel. - - - - - - - - Represents an edge detection convolution kernel consisting of two 1D gradient operators. - - - - - An edge detection kernel containing two Kayyali operators. - - - - - An edge detection kernel containing two Prewitt operators. - . - - - - - An edge detection kernel containing two Roberts-Cross operators. - . - - - - - An edge detection kernel containing two Scharr operators. - - - - - An edge detection kernel containing two Sobel operators. - . - - - - - Initializes a new instance of the struct. - - The horizontal gradient operator. - The vertical gradient operator. - - - - Gets the horizontal gradient operator. - - - - - Gets the vertical gradient operator. - - - - - Checks whether two structures are equal. - - The left hand operand. - The right hand operand. - - True if the parameter is equal to the parameter; - otherwise, false. - - - - - Checks whether two structures are equal. - - The left hand operand. - The right hand operand. - - True if the parameter is not equal to the parameter; - otherwise, false. - - - - - - - - - - - - - - Represents an edge detection convolution kernel consisting of eight gradient operators. - - - - - An edge detection kenel comprised of Kirsch gradient operators. - . - - - - - An edge detection kenel comprised of Robinson gradient operators. - - - - - - Initializes a new instance of the struct. - - The north gradient operator. - The north-west gradient operator. - The west gradient operator. - The south-west gradient operator. - The south gradient operator. - The south-east gradient operator. - The east gradient operator. - The north-east gradient operator. - - - - Gets the North gradient operator. - - - - - Gets the NorthWest gradient operator. - - - - - Gets the West gradient operator. - - - - - Gets the SouthWest gradient operator. - - - - - Gets the South gradient operator. - - - - - Gets the SouthEast gradient operator. - - - - - Gets the East gradient operator. - - - - - Gets the NorthEast gradient operator. - - - - - Checks whether two structures are equal. - - The left hand operand. - The right hand operand. - - True if the parameter is equal to the parameter; - otherwise, false. - - - - - Checks whether two structures are equal. - - The left hand operand. - The right hand operand. - - True if the parameter is not equal to the parameter; - otherwise, false. - - - - - - - - - - - - - - Represents an edge detection convolution kernel consisting of a single 2D gradient operator. - - - - - An edge detection kernel containing a 3x3 Laplacian operator. - - - - - - An edge detection kernel containing a 5x5 Laplacian operator. - - - - - - An edge detection kernel containing a Laplacian of Gaussian operator. - . - - - - - Initializes a new instance of the struct. - - The 2D gradient operator. - - - - Gets the 2D gradient operator. - - - - - Checks whether two structures are equal. - - The left hand operand. - The right hand operand. - - True if the parameter is equal to the parameter; - otherwise, false. - - - - - Checks whether two structures are equal. - - The left hand operand. - The right hand operand. - - True if the parameter is not equal to the parameter; - otherwise, false. - - - - - - - - - - - - - - Contains the kernels used for Kayyali edge detection - - - - - Gets the horizontal gradient operator. - - - - - Gets the vertical gradient operator. - - - - - Contains the eight matrices used for Kirsch edge detection. - . - - - - - Gets the North gradient operator - - - - - Gets the NorthWest gradient operator - - - - - Gets the West gradient operator - - - - - Gets the SouthWest gradient operator - - - - - Gets the South gradient operator - - - - - Gets the SouthEast gradient operator - - - - - Gets the East gradient operator - - - - - Gets the NorthEast gradient operator - - - - - A factory for creating Laplacian kernel matrices. - - - - - Creates a Laplacian matrix, 2nd derivative, of an arbitrary length. - - - The length of the matrix sides - The - - - - Contains Laplacian kernels of different sizes. - - . - - - - - Gets the 3x3 Laplacian kernel - - - - - Gets the 5x5 Laplacian kernel - - - - - Gets the Laplacian of Gaussian kernel. - - - - - Contains the kernels used for Prewitt edge detection - - - - - Gets the horizontal gradient operator. - - - - - Gets the vertical gradient operator. - - - - - Contains the kernels used for RobertsCross edge detection - - - - - Gets the horizontal gradient operator. - - - - - Gets the vertical gradient operator. - - - - - Contains the kernels used for Robinson edge detection. - - - - - - Gets the North gradient operator - - - - - Gets the NorthWest gradient operator - - - - - Gets the West gradient operator - - - - - Gets the SouthWest gradient operator - - - - - Gets the South gradient operator - - - - - Gets the SouthEast gradient operator - - - - - Gets the East gradient operator - - - - - Gets the NorthEast gradient operator - - - - - Contains the kernels used for Scharr edge detection - - - - - Gets the horizontal gradient operator. - - - - - Gets the vertical gradient operator. - - - - - Contains the kernels used for Sobel edge detection - - - - - Gets the horizontal gradient operator. - - - - - Gets the vertical gradient operator. - - - - - Provides a map of the convolution kernel sampling offsets. - - - - - Initializes a new instance of the class. - - The memory allocator. - - - - Builds a map of the sampling offsets for the kernel clamped by the given bounds. - - The convolution kernel. - The source bounds. - - - - Builds a map of the sampling offsets for the kernel clamped by the given bounds. - - The height (number of rows) of the convolution kernel to use. - The width (number of columns) of the convolution kernel to use. - The source bounds. - - - - - - - A that contains data about a set of bokeh blur kernels - - - - - The kernel parameters to use for the current set of complex kernels - - - - - The kernel components to apply the bokeh blur effect - - - - - Initializes a new instance of the struct. - - The kernel parameters - The complex kernel components - - - - Provides parameters to be used in the . - - - - - The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances - - - - - Gets the kernel scales to adjust the component values in each kernel - - - - - Gets the available bokeh blur kernel parameters - - - - - Gets the bokeh blur kernel data for the specified parameters. - - The value representing the size of the area to sample. - The size of each kernel to compute. - The number of components to use to approximate the original 2D bokeh blur convolution kernel. - A instance with the kernel data for the current parameters. - - - - Gets the kernel parameters and scaling factor for the current count value in the current instance - - - - - Creates the collection of complex 1D kernels with the specified parameters - - The parameters to use to normalize the kernels - The value representing the size of the area to sample. - The size of each kernel to compute. - The scale factor for each kernel. - - - - Creates a complex 1D kernel with the specified parameters - - The value representing the size of the area to sample. - The size of each kernel to compute. - The scale factor for each kernel. - The exponential parameter for each complex component - The angle component for each complex component - - - - Normalizes the kernels with respect to A * real + B * imaginary - - The current convolution kernels to normalize - The parameters to use to normalize the kernels - - - - A that contains parameters to apply a bokeh blur filter - - - - - The size of the convolution kernel to use when applying the bokeh blur - - - - - The number of complex components to use to approximate the bokeh kernel - - - - - Initializes a new instance of the struct. - - The size of the kernel - The number of kernel components - - - - - - - - - - - - - A stack only, readonly, kernel matrix that can be indexed without - bounds checks when compiled in release mode. - - - - - An error diffusion dithering implementation. - - - An error diffusion dithering implementation. - - - - - - Applies error diffusion based dithering using the Atkinson image dithering algorithm. - - - - - Applies error diffusion based dithering using the Burks image dithering algorithm. - - - - - Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm. - - - - - Applies error diffusion based dithering using the Jarvis, Judice, Ninke image dithering algorithm. - - - - - Applies error diffusion based dithering using the Sierra2 image dithering algorithm. - - - - - Applies error diffusion based dithering using the Sierra3 image dithering algorithm. - - - - - Applies error diffusion based dithering using the Sierra Lite image dithering algorithm. - - - - - Applies error diffusion based dithering using the Stevenson-Arce image dithering algorithm. - - - - - Applies error diffusion based dithering using the Stucki image dithering algorithm. - - - - - Initializes a new instance of the struct. - - The diffusion matrix. - The starting offset within the matrix. - - - - Compares the two instances to determine whether they are equal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are unequal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are equal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are unequal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are equal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are unequal. - - The first source instance. - The second source instance. - The . - - - - - - - - - - - - - - - - - - - - - - Defines the contract for types that apply dithering to images. - - - - - Transforms the quantized image frame applying a dither matrix. - This method should be treated as destructive, altering the input pixels. - - The type of frame quantizer. - The pixel format. - The frame quantizer. - The source image. - The destination quantized frame. - The region of interest bounds. - - - - Transforms the image frame applying a dither matrix. - This method should be treated as destructive, altering the input pixels. - - The type of palette dithering processor. - The pixel format. - The palette dithering processor. - The source image. - The region of interest bounds. - - - - Implements an algorithm to alter the pixels of an image via palette dithering. - - The pixel format. - - - - Gets the configuration instance to use when performing operations. - - - - - Gets the dithering palette. - - - - - Gets the dithering scale used to adjust the amount of dither. Range 0..1. - - - - - Returns the color from the dithering palette corresponding to the given color. - - The color to match. - The match. - - - - An ordered dithering matrix with equal sides of arbitrary length - - - An ordered dithering matrix with equal sides of arbitrary length - - - - - Initializes a new instance of the struct. - - The length of the matrix sides - - - - Compares the two instances to determine whether they are equal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are unequal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are equal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are unequal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are equal. - - The first source instance. - The second source instance. - The . - - - - Compares the two instances to determine whether they are unequal. - - The first source instance. - The second source instance. - The . - - - - - - - - - - - - - - - - - - - - - - Applies order dithering using the 2x2 Bayer dithering matrix. - - - - - Applies order dithering using the 4x4 Bayer dithering matrix. - - - - - Applies order dithering using the 8x8 Bayer dithering matrix. - - - - - Applies order dithering using the 16x16 Bayer dithering matrix. - - - - - Applies order dithering using the 3x3 ordered dithering matrix. - - - - - A factory for creating ordered dither matrices. - - - - - Creates an ordered dithering matrix with equal sides of arbitrary length. - - - The length of the matrix sides - The - - - - Allows the consumption a palette to dither an image. - - - - - Initializes a new instance of the class. - - The ordered ditherer. - - - - Initializes a new instance of the class. - - The ordered ditherer. - The dithering scale used to adjust the amount of dither. - - - - Initializes a new instance of the class. - - The dithering algorithm. - The palette to select substitute colors from. - - - - Initializes a new instance of the class. - - The dithering algorithm. - The dithering scale used to adjust the amount of dither. - The palette to select substitute colors from. - - - - Gets the dithering algorithm to apply to the output image. - - - - - Gets the dithering scale used to adjust the amount of dither. Range 0..1. - - - - - Gets the palette to select substitute colors from. - - - - - - - - Allows the consumption a palette to dither an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Used to allow inlining of calls to - . - - Internal for AOT - - - - Combines two images together by blending the pixels. - - - - - Initializes a new instance of the class. - - The image to blend. - The location to draw the blended image. - The blending mode to use when drawing the image. - The Alpha blending mode to use when drawing the image. - The opacity of the image to blend. - - - - Gets the image to blend. - - - - - Gets the location to draw the blended image. - - - - - Gets the blending mode to use when drawing the image. - - - - - Gets the Alpha blending mode to use when drawing the image. - - - - - Gets the opacity of the image to blend. - - - - - - - - Combines two images together by blending the pixels. - - The pixel format of destination image. - The pixel format of source image. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The foreground to blend with the currently processing image. - The source for the current processor instance. - The source area to process for the current processor instance. - The location to draw the blended image. - The blending mode to use when drawing the image. - The Alpha blending mode to use when drawing the image. - The opacity of the image to blend. Must be between 0 and 1. - - - - Gets the image to blend - - - - - Gets the opacity of the image to blend - - - - - Gets the pixel blender - - - - - Gets the location to draw the blended image - - - - - - - - A implementing the draw logic for . - - - - - - - - An used by the row delegates for a given instance - - - - - Applies the current pixel row delegate to a target row of preprocessed pixels. - - The target row of pixels to process. - The initial horizontal and vertical offset for the input pixels to process. - - - - Defines an oil painting effect. - - - - - Initializes a new instance of the class. - - - The number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image. - - - The number of neighboring pixels used in calculating each individual pixel value. - - - - - Gets the number of intensity levels. - - - - - Gets the brush size. - - - - - - - - Applies oil painting effect processing to the image. - - Adapted from by Dewald Esterhuizen. - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - A implementing the convolution logic for . - - - - - - - - Defines a pixelation effect of a given size. - - - - - Initializes a new instance of the class. - - The size of the pixels. Must be greater than 0. - - is less than 0 or equal to 0. - - - - - Gets or the pixel size. - - - - - - - - Applies a pixelation effect processing to the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The . - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Applies a user defined row processing delegate to the image. - - - - - Initializes a new instance of the class. - - The user defined, row processing delegate. - The to apply during the pixel conversions. - - - - Gets the user defined row processing delegate to the image. - - - - - Gets the to apply during the pixel conversions. - - - - - - - - A implementing the row processing logic for . - - - - - - - - The base class for all processors that accept a user defined row processing delegate. - - The pixel format. - The row processor type. - - - - The to apply during the pixel conversions. - - - - - Initializes a new instance of the class. - - The row processor to use to process each pixel row - The configuration which allows altering default behaviour or extending the library. - The to apply during the pixel conversions. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - A implementing the convolution logic for . - - - - - - - - Applies a user defined, position aware, row processing delegate to the image. - - - - - Initializes a new instance of the class. - - The user defined, position aware, row processing delegate. - The to apply during the pixel conversions. - - - - Gets the user defined, position aware, row processing delegate. - - - - - Gets the to apply during the pixel conversions. - - - - - - - - A implementing the row processing logic for . - - - - - - - - Converts the colors of the image recreating Achromatomaly (Color desensitivity) color blindness. - - - - - Initializes a new instance of the class. - - - - - Converts the colors of the image recreating Achromatopsia (Monochrome) color blindness. - - - - - Initializes a new instance of the class. - - - - - Applies a black and white filter matrix to the image. - - - - - Initializes a new instance of the class. - - - - - Applies a brightness filter matrix using the given amount. - - - - - Initializes a new instance of the class. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing brighter results. - - The proportion of the conversion. Must be greater than or equal to 0. - - - - Gets the proportion of the conversion - - - - - Applies a contrast filter matrix using the given amount. - - - - - Initializes a new instance of the class. - - - A value of 0 will create an image that is completely gray. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing results with more contrast. - - The proportion of the conversion. Must be greater than or equal to 0. - - - - Gets the proportion of the conversion. - - - - - Converts the colors of the image recreating Deuteranomaly (Green-Weak) color blindness. - - - - - Initializes a new instance of the class. - - - - - Converts the colors of the image recreating Deuteranopia (Green-Blind) color blindness. - - - - - Initializes a new instance of the class. - - - - - Defines a free-form color filter by a . - - - - - Initializes a new instance of the class. - - The matrix used to apply the image filter - - - - Gets the used to apply the image filter. - - - - - - - - Provides methods that accept a matrix to apply free-form filters to images. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The . - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - A implementing the convolution logic for . - - - - - - - - Applies a grayscale filter matrix using the given amount and the formula as specified by ITU-R Recommendation BT.601 - - - - - Initializes a new instance of the class. - - The proportion of the conversion. Must be between 0 and 1. - - - - Gets the proportion of the conversion - - - - - Applies a grayscale filter matrix using the given amount and the formula as specified by ITU-R Recommendation BT.709 - - - - - Initializes a new instance of the class. - - The proportion of the conversion. Must be between 0 and 1. - - - - Gets the proportion of the conversion. - - - - - Applies a hue filter matrix using the given angle of rotation in degrees - - - - - Initializes a new instance of the class. - - The angle of rotation in degrees - - - - Gets the angle of rotation in degrees - - - - - Applies a filter matrix that inverts the colors of an image - - - - - Initializes a new instance of the class. - - The proportion of the conversion. Must be between 0 and 1. - - - - Gets the proportion of the conversion - - - - - Applies a filter matrix recreating an old Kodachrome camera effect matrix to the image - - - - - Initializes a new instance of the class. - - - - - Applies a lightness filter matrix using the given amount. - - - - - Initializes a new instance of the class. - - - A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing lighter results. - - The proportion of the conversion. Must be greater than or equal to 0. - - - - Gets the proportion of the conversion - - - - - Converts the colors of the image recreating an old Lomograph effect. - - - - - Initializes a new instance of the class. - - Graphics options to use within the processor. - - - - Gets the options effecting blending and composition - - - - - - - - Converts the colors of the image recreating an old Lomograph effect. - - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Applies an opacity filter matrix using the given amount. - - - - - Initializes a new instance of the class. - - The proportion of the conversion. Must be between 0 and 1. - - - - Gets the proportion of the conversion. - - - - - - - - Converts the colors of the image recreating an old Polaroid effect. - - - - - Initializes a new instance of the class. - - Graphics options to use within the processor. - - - - Gets the options effecting blending and composition - - - - - - - - Converts the colors of the image recreating an old Polaroid effect. - - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Converts the colors of the image recreating Protanomaly (Red-Weak) color blindness. - - - - - Initializes a new instance of the class. - - - - - Converts the colors of the image recreating Protanopia (Red-Blind) color blindness. - - - - - Initializes a new instance of the class. - - - - - Applies a saturation filter matrix using the given amount. - - - - - Initializes a new instance of the class. - - - A value of 0 is completely un-saturated. A value of 1 leaves the input unchanged. - Other values are linear multipliers on the effect. Values of amount over 1 are allowed, providing super-saturated results - - The proportion of the conversion. Must be greater than or equal to 0. - - - - Gets the proportion of the conversion - - - - - Applies a sepia filter matrix using the given amount. - - - - - Initializes a new instance of the class. - - The proportion of the conversion. Must be between 0 and 1. - - - - Gets the proportion of the conversion - - - - - Converts the colors of the image recreating Tritanomaly (Blue-Weak) color blindness. - - - - - Initializes a new instance of the class. - - - - - Converts the colors of the image recreating Tritanopia (Blue-Blind) color blindness. - - - - - Initializes a new instance of the class. - - - - - Defines an algorithm to alter the pixels of a cloned image. - - - - - Creates a pixel specific that is capable of executing - the processing algorithm on an . - - The pixel type. - The configuration which allows altering default behaviour or extending the library. - The source image. Cannot be null. - - The structure that specifies the portion of the image object to draw. - - The - - - - Implements an algorithm to alter the pixels of a cloned image. - - The pixel format. - - - - Clones the specified and executes the process against the clone. - - The . - - - - Defines an algorithm to alter the pixels of an image. - Non-generic implementations are responsible for: - 1. Encapsulating the parameters of the algorithm. - 2. Creating the generic instance to execute the algorithm. - - - - - Creates a pixel specific that is capable of executing - the processing algorithm on an . - - The pixel type. - The configuration which allows altering default behaviour or extending the library. - The source image. Cannot be null. - - The structure that specifies the portion of the image object to draw. - - The - - - - Implements an algorithm to alter the pixels of an image. - - The pixel format. - - - - Executes the process against the specified . - - - - - Executes the processor against the given source image and rectangle bounds. - - The processor. - The configuration which allows altering default behaviour or extending the library. - The source image. - The source bounds. - - - - The base class for all pixel specific image processors. - Allows the application of processing algorithms to the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets The source for the current processor instance. - - - - - Gets The source area to process for the current processor instance. - - - - - Gets the instance to use when performing operations. - - - - - - - - Applies the processor to a single image frame. - - the source image. - - - - - - - This method is called before the process is applied to prepare the processor. - - - - - This method is called before the process is applied to prepare the processor. - - The source image. Cannot be null. - - - - Applies the process to the specified portion of the specified at the specified location - and with the specified size. - - The source image. Cannot be null. - - - - This method is called after the process is applied to prepare the processor. - - The source image. Cannot be null. - - - - This method is called after the process is applied to prepare the processor. - - - - - Disposes the object and frees resources for the Garbage Collector. - - Whether to dispose managed and unmanaged objects. - - - - Applies an adaptive histogram equalization to the image. The image is split up in tiles. For each tile a cumulative distribution function (cdf) is calculated. - To calculate the final equalized pixel value, the cdf value of four adjacent tiles will be interpolated. - - - - - Initializes a new instance of the class. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - Indicating whether to clip the histogram bins at a specific value. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - The number of tiles the image is split into (horizontal and vertically). Minimum value is 2. Maximum value is 100. - - - - Gets the number of tiles the image is split into (horizontal and vertically) for the adaptive histogram equalization. - - - - - - - - Applies an adaptive histogram equalization to the image. The image is split up in tiles. For each tile a cumulative distribution function (cdf) is calculated. - To calculate the final equalized pixel value, the cdf value of four adjacent tiles will be interpolated. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - Indicating whether to clip the histogram bins at a specific value. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - The number of tiles the image is split into (horizontal and vertically). Minimum value is 2. Maximum value is 100. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the number of tiles the image is split into (horizontal and vertically) for the adaptive histogram equalization. - - - - - - - - Processes the part of a corner tile which was previously left out. It consists of 1 / 4 of a tile and does not need interpolation. - - The source image. - The lookup table to remap the grey values. - The x-position in the CDF lookup map. - The y-position in the CDF lookup map. - X start position. - X end position. - Y start position. - Y end position. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - - - - - Processes a border column of the image which is half the size of the tile width. - - The source image. - The pre-computed lookup tables to remap the grey values for each tiles. - The X index of the lookup table to use. - The source image height. - The number of vertical tiles. - The height of a tile. - X start position in the image. - X end position of the image. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - - - - - Processes a border row of the image which is half of the size of the tile height. - - The source image. - The pre-computed lookup tables to remap the grey values for each tiles. - The Y index of the lookup table to use. - The source image width. - The number of horizontal tiles. - The width of a tile. - Y start position in the image. - Y end position of the image. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - - - - - Bilinear interpolation between four adjacent tiles. - - The pixel to remap the grey value from. - The pre-computed lookup tables to remap the grey values for each tiles. - The number of tiles in the x-direction. - The number of tiles in the y-direction. - X position inside the tile. - Y position inside the tile. - X index of the top left lookup table to use. - Y index of the top left lookup table to use. - Width of one tile in pixels. - Height of one tile in pixels. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - - A re-mapped grey value. - - - - Linear interpolation between two tiles. - - The pixel to remap the grey value from. - The CDF lookup map. - X position inside the first tile. - Y position inside the first tile. - X position inside the second tile. - Y position inside the second tile. - Position inside the tile. - Width of the tile. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - - A re-mapped grey value. - - - - Bilinear interpolation between four tiles. - - The interpolation value in x direction in the range of [0, 1]. - The interpolation value in y direction in the range of [0, 1]. - Luminance from top left tile. - Luminance from right top tile. - Luminance from left bottom tile. - Luminance from right bottom tile. - Interpolated Luminance. - - - - Linear interpolation between two grey values. - - The left value. - The right value. - The interpolation value between the two values in the range of [0, 1]. - The interpolated value. - - - - - - - Contains the results of the cumulative distribution function for all tiles. - - - - - Used for storing the minimum value for each CDF entry. - - - - - Used for storing the LUT for each CDF entry. - - - - - Remaps the grey value with the cdf. - - The tiles x-position. - The tiles y-position. - The original luminance. - The remapped luminance. - - - - - - - Applies an adaptive histogram equalization to the image using an sliding window approach. - - - - - Initializes a new instance of the class. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - Indicating whether to clip the histogram bins at a specific value. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - The number of tiles the image is split into (horizontal and vertically). Minimum value is 2. Maximum value is 100. - - - - Gets the number of tiles the image is split into (horizontal and vertically) for the adaptive histogram equalization. - - - - - - - - Applies an adaptive histogram equalization to the image using an sliding window approach. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - Indicating whether to clip the histogram bins at a specific value. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - The number of tiles the image is split into (horizontal and vertically). Minimum value is 2. Maximum value is 100. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the number of tiles the image is split into (horizontal and vertically) for the adaptive histogram equalization. - - - - - - - - Get the a pixel row at a given position with a length of the tile width. Mirrors pixels which exceeds the edges. - - The source image. - Pre-allocated pixel row span of the size of a the tile width. - The x position. - The y position. - The width in pixels of a tile. - The configuration. - - - - Get the a pixel row at a given position with a length of the tile width. - - The source image. - Pre-allocated pixel row span of the size of a the tile width. - The x position. - The y position. - The width in pixels of a tile. - The configuration. - - - - Adds a column of grey values to the histogram. - - The reference to the span of grey values to add. - The reference to the histogram span. - The number of different luminance levels. - The grey values span length. - - - - Removes a column of grey values from the histogram. - - The reference to the span of grey values to remove. - The reference to the histogram span. - The number of different luminance levels. - The grey values span length. - - - - Applies the sliding window equalization to one column of the image. The window is moved from top to bottom. - Moving the window one pixel down requires to remove one row from the top of the window from the histogram and - adding a new row at the bottom. - - - - - Initializes a new instance of the struct. - - The configuration. - The histogram processor. - The source image. - The memory allocator. - The target pixels. - about the sliding window dimensions. - The y start position. - The y end position. - if set to true the borders of the image will not be checked. - - - - Defines a global histogram equalization applicable to an . - - - - - Initializes a new instance of the class. - - The number of luminance levels. - A value indicating whether to clip the histogram bins at a specific value. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - - - - - - - Applies a global histogram equalization to the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - - Indicating whether to clip the histogram bins at a specific value. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - A implementing the grayscale levels logic for . - - - - - - - - A implementing the cdf application levels logic for . - - - - - - - - Enumerates the different types of defined histogram equalization methods. - - - - - A global histogram equalization. - - - - - Adaptive histogram equalization using a tile interpolation approach. - - - - - Adaptive histogram equalization using sliding window. Slower then the tile interpolation mode, but can yield to better results. - - - - - Data container providing the different options for the histogram equalization. - - - - - Gets or sets the histogram equalization method to use. Defaults to global histogram equalization. - - - - - Gets or sets the number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - Defaults to 256. - - - - - Gets or sets a value indicating whether to clip the histogram bins at a specific value. - It is recommended to use clipping when the AdaptiveTileInterpolation method is used, to suppress artifacts which can occur on the borders of the tiles. - Defaults to false. - - - - - Gets or sets the histogram clip limit. Adaptive histogram equalization may cause noise to be amplified in near constant - regions. To reduce this problem, histogram bins which exceed a given limit will be capped at this value. The exceeding values - will be redistributed equally to all other bins. The clipLimit depends on the size of the tiles the image is split into - and therefore the image size itself. - Defaults to 350. - - For more information, see also: https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE - - - - Gets or sets the number of tiles the image is split into (horizontal and vertically) for the adaptive histogram equalization. - Defaults to 8. - - - - - Defines a processor that normalizes the histogram of an image. - - - - - Initializes a new instance of the class. - - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - Indicates, if histogram bins should be clipped. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - - - - Gets the number of luminance levels. - - - - - Gets a value indicating whether to clip the histogram bins at a specific value. - - - - - Gets the histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - - - - - - - - Creates the that implements the algorithm - defined by the given . - - The . - The . - - - - Defines a processor that normalizes the histogram of an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The number of different luminance levels. Typical values are 256 for 8-bit grayscale images - or 65536 for 16-bit grayscale images. - Indicates, if histogram bins should be clipped. - The histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - Gets the number of luminance levels. - - - - - Gets a value indicating whether to clip the histogram bins at a specific value. - - - - - Gets the histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - - - - - Calculates the cumulative distribution function. - - The reference to the array holding the cdf. - The reference to the histogram of the input image. - Index of the maximum of the histogram. - The first none zero value of the cdf. - - - - AHE tends to over amplify the contrast in near-constant regions of the image, since the histogram in such regions is highly concentrated. - Clipping the histogram is meant to reduce this effect, by cutting of histogram bin's which exceed a certain amount and redistribute - the values over the clip limit to all other bins equally. - - The histogram to apply the clipping. - Histogram clip limit. Histogram bins which exceed this limit, will be capped at this value. - - - - Convert the pixel values to grayscale using ITU-R Recommendation BT.709. - - The pixel to get the luminance from - The number of luminance levels (256 for 8 bit, 65536 for 16 bit grayscale images) - - - - Defines a processing operation to replace the background color of an . - - - - - Initializes a new instance of the class. - - The options defining blending algorithm and amount. - The to set the background color to. - - - - Gets the Graphics options to alter how processor is applied. - - - - - Gets the background color value. - - - - - - - - Sets the background color of the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Defines a radial glow effect applicable to an . - - - - - Initializes a new instance of the class. - - The options effecting blending and composition. - The color or the glow. - - - - Initializes a new instance of the class. - - The options effecting blending and composition. - The color or the glow. - The radius of the glow. - - - - Gets the options effecting blending and composition. - - - - - Gets the glow color to apply. - - - - - Gets the the radius. - - - - - - - - An that applies a radial glow effect an . - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Defines a radial vignette effect applicable to an . - - - - - Initializes a new instance of the class. - - The options effecting blending and composition. - The color of the vignette. - - - - Initializes a new instance of the class. - - The options effecting blending and composition. - The color of the vignette. - The x-radius. - The y-radius. - - - - Gets the options effecting blending and composition - - - - - Gets the vignette color to apply. - - - - - Gets the the x-radius. - - - - - Gets the the y-radius. - - - - - - - - An that applies a radial vignette effect to an . - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - A pixel sampling strategy that enumerates a limited amount of rows from different frames, - if the total number of pixels is over a threshold. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The maximum number of pixels to process. - always scan at least this portion of total pixels within the image. - - - - Gets the maximum number of pixels to process. (The threshold.) - - - - - Gets a value indicating: always scan at least this portion of total pixels within the image. - The default is 0.1 (10%). - - - - - - - - Gets the closest color to the supplied color based upon the Euclidean distance. - - The pixel format. - - This class is not threadsafe and should not be accessed in parallel. - Doing so will result in non-idempotent results. - - - - - Initializes a new instance of the class. - - The configuration. - The color palette to map from. - - - - Gets the color palette of this . - The palette memory is owned by the palette source that created it. - - - - - Returns the closest color in the palette and the index of that pixel. - The palette contents must match the one used in the constructor. - - The color to match. - The matched color. - The index. - - - - Clears the map, resetting it to use the given palette. - - The color palette to map from. - - - - Returns the Euclidean distance squared between two specified points. - - The first point. - The second point. - The distance squared. - - - - A cache for storing color distance matching results. - - - - The granularity of the cache has been determined based upon the current - suite of test images and provides the lowest possible memory usage while - providing enough match accuracy. - Entry count is currently limited to 1185921 entries (2371842 bytes ~2.26MB). - - - - - - Clears the cache resetting each entry to empty. - - - - - A pixel sampling strategy that enumerates all pixels. - - - - - - - - Provides an abstraction to enumerate pixel regions within a multi-framed . - - - - - Enumerates pixel regions within the image as . - - The image. - The pixel type. - An enumeration of pixel regions. - - - - Provides methods for allowing quantization of images pixels with configurable dithering. - - - - - Gets the quantizer options defining quantization rules. - - - - - Creates the generic frame quantizer. - - The to configure internal operations. - The pixel format. - The . - - - - Creates the generic frame quantizer. - - The pixel format. - The to configure internal operations. - The options to create the quantizer with. - The . - - - - Provides methods to allow the execution of the quantization process on an image frame. - - The pixel format. - - - - Gets the configuration. - - - - - Gets the quantizer options defining quantization rules. - - - - - Gets the quantized color palette. - - - The palette has not been built via . - - - - - Adds colors to the quantized palette from the given pixel source. - - The of source pixels to register. - - - - Quantizes an image frame and return the resulting output pixels. - - The source image frame to quantize. - The bounds within the frame to quantize. - - A representing a quantized version of the source frame pixels. - - - Only executes the second (quantization) step. The palette has to be built by calling . - To run both steps, use . - - - - - Returns the index and color from the quantized palette corresponding to the given color. - - The color to match. - The matched color. - The index. - - - - Allows the quantization of images pixels using Octrees. - - - - - - Initializes a new instance of the class - using the default . - - - - - Initializes a new instance of the class. - - The quantizer options defining quantization rules. - - - - - - - - - - - - - Encapsulates methods to calculate the color palette if an image using an Octree pattern. - - - The pixel format. - - - - Initializes a new instance of the struct. - - The configuration which allows altering default behaviour or extending the library. - The quantizer options defining quantization rules. - - - - - - - - - - - - - - - - - - - - - - - - - Class which does the actual quantization. - - - - - The root of the Octree - - - - - Maximum number of significant bits in the image - - - - - Store the last node quantized - - - - - Cache the previous color quantized - - - - - Initializes a new instance of the class. - - - The maximum number of significant bits in the image - - - - - Gets or sets the number of leaves in the tree - - - - - Gets the array of reducible nodes - - - - - Add a given color value to the Octree - - The color to add. - - - - Convert the nodes in the Octree to a palette with a maximum of colorCount colors - - The palette to fill. - The maximum number of colors - The palette index, used to calculate the final size of the palette. - - - - Get the palette index for the passed color - - The color to match. - - The index. - - - - - Keep track of the previous node that was quantized - - - The node last quantized - - - - - Reduce the depth of the tree - - - - - Class which encapsulates each node in the tree - - - - - Pointers to any child nodes - - - - - Flag indicating that this is a leaf node - - - - - Number of pixels in this node - - - - - Red component - - - - - Green Component - - - - - Blue component - - - - - The index of this node in the palette - - - - - Initializes a new instance of the class. - - The level in the tree = 0 - 7. - The number of significant color bits in the image. - The tree to which this node belongs. - - - - Gets the next reducible node - - - - - Add a color into the tree - - The color to add. - The number of significant color bits. - The level in the tree. - The tree to which this node belongs. - - - - Reduce this node by removing all of its children - - The number of leaves removed - - - - Traverse the tree, building up the color palette - - The palette - The current palette index - - - - Return the palette index for the passed color - - The pixel data. - The level. - - The representing the index of the pixel in the palette. - - - - - Gets the color index at the given level. - - The color. - The node level. - The index. - - - - Increment the color count and add to the color information - - The pixel to add. - - - - Allows the quantization of images pixels using color palettes. - - - - - Initializes a new instance of the class. - - The color palette. - - - - Initializes a new instance of the class. - - The color palette. - The quantizer options defining quantization rules. - - - - - - - - - - - - - Encapsulates methods to create a quantized image based upon the given palette. - - - The pixel format. - - - - Initializes a new instance of the struct. - - The configuration which allows altering default behaviour or extending the library. - The quantizer options defining quantization rules. - The palette to use. - - - - - - - - - - - - - - - - - - - - - - - - - Defines quantization processing for images to reduce the number of colors used in the image palette. - - - - - Initializes a new instance of the class. - - The quantizer used to reduce the color palette. - - - - Gets the quantizer. - - - - - - - - Enables the quantization of images to reduce the number of colors used in the image palette. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The quantizer used to reduce the color palette. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Contains color quantization specific constants. - - - - - The minimum number of colors to use when quantizing an image. - - - - - The maximum number of colors to use when quantizing an image. - - - - - The minumim dithering scale used to adjust the amount of dither. - - - - - The max dithering scale used to adjust the amount of dither. - - - - - Gets the default dithering algorithm to use. - - - - - Defines options for quantization. - - - - - Gets or sets the algorithm to apply to the output image. - Defaults to ; set to for no dithering. - - - - - Gets or sets the dithering scale used to adjust the amount of dither. Range 0..1. - Defaults to . - - - - - Gets or sets the maximum number of colors to hold in the color palette. Range 0..256. - Defaults to . - - - - - Contains utility methods for instances. - - - - - Helper method for throwing an exception when a frame quantizer palette has - been requested but not built yet. - - The pixel format. - The frame quantizer palette. - - The palette has not been built via - - - - - Execute both steps of the quantization. - - The pixel specific quantizer. - The source image frame to quantize. - The bounds within the frame to quantize. - The pixel type. - - A representing a quantized version of the source frame pixels. - - - - - Quantizes an image frame and return the resulting output pixels. - - The type of frame quantizer. - The pixel format. - The pixel specific quantizer. - The source image frame to quantize. - The bounds within the frame to quantize. - - A representing a quantized version of the source frame pixels. - - - - - A palette quantizer consisting of web safe colors as defined in the CSS Color Module Level 4. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The quantizer options defining quantization rules. - - - - A palette quantizer consisting of colors as defined in the original second edition of Werner’s Nomenclature of Colours 1821. - The hex codes were collected and defined by Nicholas Rougeux - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The quantizer options defining quantization rules. - - - - Allows the quantization of images pixels using Xiaolin Wu's Color Quantizer - - - - - Initializes a new instance of the class - using the default . - - - - - Initializes a new instance of the class. - - The quantizer options defining quantization rules. - - - - - - - - - - - - - An implementation of Wu's color quantizer with alpha channel. - - - - Based on C Implementation of Xiaolin Wu's Color Quantizer (v. 2) - (see Graphics Gems volume II, pages 126-133) - (). - - - This adaptation is based on the excellent JeremyAnsel.ColorQuant by Jérémy Ansel - - - - Algorithm: Greedy orthogonal bipartition of RGB space for variance minimization aided by inclusion-exclusion tricks. - For speed no nearest neighbor search is done. Slightly better performance can be expected by more sophisticated - but more expensive versions. - - - The pixel format. - - - - The index bits. 6 in original code. - - - - - The index alpha bits. 3 in original code. - - - - - The index count. - - - - - The index alpha count. - - - - - The table length. Now 1185921. originally 2471625. - - - - - Initializes a new instance of the struct. - - The configuration which allows altering default behaviour or extending the library. - The quantizer options defining quantization rules. - - - - - - - - - - - - - - - - - - - - - - - - - Gets the index of the given color in the palette. - - The red value. - The green value. - The blue value. - The alpha value. - The index. - - - - Computes sum over a box of any given statistic. - - The cube. - The moment. - The result. - - - - Computes part of Volume(cube, moment) that doesn't depend on RMax, GMax, BMax, or AMax (depending on direction). - - The cube. - The direction. - The moment. - The result. - - - - Computes remainder of Volume(cube, moment), substituting position for RMax, GMax, BMax, or AMax (depending on direction). - - The cube. - The direction. - The position. - The moment. - The result. - - - - Builds a 3-D color histogram of counts, r/g/b, c^2. - - The source data. - The bounds within the source image to quantize. - - - - Converts the histogram into moments so that we can rapidly calculate the sums of the above quantities over any desired box. - - The memory allocator used for allocating buffers. - - - - Computes the weighted variance of a box cube. - - The cube. - The . - - - - We want to minimize the sum of the variances of two sub-boxes. - The sum(c^2) terms can be ignored since their sum over both sub-boxes - is the same (the sum for the whole box) no matter where we split. - The remaining terms have a minus sign in the variance formula, - so we drop the minus sign and maximize the sum of the two terms. - - The cube. - The direction. - The first position. - The last position. - The cutting point. - The whole moment. - The . - - - - Cuts a box. - - The first set. - The second set. - Returns a value indicating whether the box has been split. - - - - Marks a color space tag. - - The cube. - A label. - - - - Builds the cube. - - - - - Moment of r*P(c). - - - - - Moment of g*P(c). - - - - - Moment of b*P(c). - - - - - Moment of a*P(c). - - - - - Moment of P(c). - - - - - Moment of c^2*P(c). - - - - - Represents a box color cube. - - - - - Gets or sets the min red value, exclusive. - - - - - Gets or sets the max red value, inclusive. - - - - - Gets or sets the min green value, exclusive. - - - - - Gets or sets the max green value, inclusive. - - - - - Gets or sets the min blue value, exclusive. - - - - - Gets or sets the max blue value, inclusive. - - - - - Gets or sets the min alpha value, exclusive. - - - - - Gets or sets the max alpha value, inclusive. - - - - - Gets or sets the volume. - - - - - - - - - - - - - - Defines a crop operation on an image. - - - - - Initializes a new instance of the class. - - The target cropped rectangle. - The source image size. - - - - Gets the width. - - - - - - - - Provides methods to allow the cropping of an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The . - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - A implementing the processor logic for . - - - - - Initializes a new instance of the struct. - - The target processing bounds for the current instance. - The source for the current instance. - The destination for the current instance. - - - - - - - Represents an error that occurs during a transform operation. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The message that describes the error. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is - the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference ( in Visual Basic) if no inner exception is specified. - - - - Defines cropping operation that preserves areas of highest entropy. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The threshold to split the image. Must be between 0 and 1. - - is less than 0 or is greater than 1. - - - - - Gets the entropy threshold value. - - - - - - - - Provides methods to allow the cropping of an image to preserve areas of highest entropy. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The . - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Gets the bounding from the given points. - - - The designating the top left position. - - - The designating the bottom right position. - - - The bounding . - - - - - Finds the bounding rectangle based on the first instance of any color component other - than the given one. - - The to search within. - The color component value to remove. - The channel to test against. - - The . - - - - - Encapsulates an interpolation algorithm for resampling images. - - - - - Gets the radius in which to sample pixels. - - - - - Gets the result of the interpolation algorithm. - - The value to process. - - The - - - - - Applies a transformation upon an image. - - The pixel format. - The transforming image processor. - - - - Implements an algorithm to alter the pixels of an image via resampling transforms. - - The pixel format. - - - - Applies a resampling transform with the given sampler. - - The type of sampler. - The sampler to use. - - - - Encapsulate an algorithm to swizzle pixels in an image. - - - - - Gets the size of the image after transformation. - - - - - Applies the swizzle transformation to a given point. - - Point to transform. - The transformed point. - - - - Defines an affine transformation applicable on an . - - - - - Initializes a new instance of the class. - - The transform matrix. - The sampler to perform the transform operation. - The target dimensions. - - - - Gets the sampler to perform interpolation of the transform operation. - - - - - Gets the matrix used to supply the affine transform. - - - - - Gets the destination size to constrain the transformed image to. - - - - - - - - Provides the base methods to perform affine transforms on an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. - - - - - - - - Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Returns the current EXIF orientation - - The image to auto rotate. - The - - - - Defines a flipping around the center point of the image. - - - - - Initializes a new instance of the class. - - The used to perform flipping. - - - - Gets the used to perform flipping. - - - - - - - - Provides methods that allow the flipping of an image around its center point. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The . - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Swaps the image at the X-axis, which goes horizontally through the middle at half the height of the image. - - The source image to apply the process to. - The configuration. - - - - Swaps the image at the Y-axis, which goes vertically through the middle at half of the width of the image. - - The source image to apply the process to. - The configuration. - - - - Utility methods for linear transforms. - - - - - Returns the sampling radius for the given sampler and dimensions. - - The type of resampler. - The resampler sampler. - The source size. - The destination size. - The . - - - - Gets the start position (inclusive) for a sampling range given - the radius, center position and max constraint. - - The radius. - The center position. - The min allowed amouunt. - The max allowed amouunt. - The . - - - - Gets the end position (inclusive) for a sampling range given - the radius, center position and max constraint. - - The radius. - The center position. - The min allowed amouunt. - The max allowed amouunt. - The . - - - - Defines a projective transformation applicable to an . - - - - - Initializes a new instance of the class. - - The transform matrix. - The sampler to perform the transform operation. - The target dimensions. - - - - Gets the sampler to perform interpolation of the transform operation. - - - - - Gets the matrix used to supply the projective transform. - - - - - Gets the destination size to constrain the transformed image to. - - - - - - - - Provides the base methods to perform non-affine transforms on an image. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Defines a rotation applicable to an . - - - - - Initializes a new instance of the class. - - The angle of rotation in degrees. - The source image size - - - - Initializes a new instance of the class. - - The angle of rotation in degrees. - The sampler to perform the rotating operation. - The source image size - - - - Gets the angle of rotation in degrees. - - - - - - - - Provides methods that allow the rotating of images. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The defining the processor parameters. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - - - - Wraps a given angle in degrees so that it falls withing the 0-360 degree range - - The angle of rotation in degrees. - The . - - - - Rotates the images with an optimized method when the angle is 90, 180 or 270 degrees. - - The source image. - The destination image. - The configuration. - - The - - - - - Rotates the image 180 degrees clockwise at the centre point. - - The source image. - The destination image. - The configuration. - - - - Rotates the image 270 degrees clockwise at the centre point. - - The source image. - The destination image. - The configuration. - - - - Rotates the image 90 degrees clockwise at the centre point. - - The source image. - The destination image. - The configuration. - - - - Defines a skew transformation applicable to an . - - - - - Initializes a new instance of the class. - - The angle in degrees to perform the skew along the x-axis. - The angle in degrees to perform the skew along the y-axis. - The source image size - - - - Initializes a new instance of the class. - - The angle in degrees to perform the skew along the x-axis. - The angle in degrees to perform the skew along the y-axis. - The sampler to perform the skew operation. - The source image size - - - - Gets the angle of rotation along the x-axis in degrees. - - - - - Gets the angle of rotation along the y-axis in degrees. - - - - - The function implements the bicubic kernel algorithm W(x) as described on - Wikipedia - A commonly used algorithm within image processing that preserves sharpness better than triangle interpolation. - - - - - - - - - - - - - - The function implements the box algorithm. Similar to nearest neighbor when upscaling. - When downscaling the pixels will average, merging together. - - - - - - - - - - - - - - Cubic filters contain a collection of different filters of varying B-Spline and - Cardinal values. With these two values you can generate any smoothly fitting - (continuious first derivative) piece-wise cubic filter. - - - - - - - The Catmull-Rom filter is a well known standard Cubic Filter often used as a interpolation function. - This filter produces a reasonably sharp edge, but without a the pronounced gradient change on large - scale image enlargements that a 'Lagrange' filter can produce. - - - - - The Hermite filter is type of smoothed triangular interpolation Filter, - This filter rounds off strong edges while preserving flat 'color levels' in the original image. - - - - - The function implements the Mitchell-Netravali algorithm as described on - Wikipedia - - - - - The function implements the Robidoux algorithm. - - - - - - The function implements the Robidoux Sharp algorithm. - - - - - - The function implements the spline algorithm. - - - - The function implements the Robidoux Sharp algorithm. - - - - - - Initializes a new instance of the struct. - - The sampling radius. - The B-Spline value. - The Cardinal cubic value. - - - - - - - - - - - - - The function implements the Lanczos kernel algorithm as described on - Wikipedia. - - - - - Implements the Lanczos kernel algorithm with a radius of 2. - - - - - Implements the Lanczos kernel algorithm with a radius of 3. - - - - - Implements the Lanczos kernel algorithm with a radius of 5. - - - - - Implements the Lanczos kernel algorithm with a radius of 8. - - - - - Initializes a new instance of the struct. - - The sampling radius. - - - - - - - - - - - - - The function implements the nearest neighbor algorithm. This uses an unscaled filter - which will select the closest pixel to the new pixels position. - - - - - - - - - - - - - - The function implements the triangle (bilinear) algorithm. - Bilinear interpolation can be used where perfect image transformation with pixel matching is impossible, - so that one can calculate and assign appropriate intensity values to pixels. - - - - - - - - - - - - - - The function implements the welch algorithm. - - - - - - - - - - - - - - - Provides methods to help calculate the target rectangle when resizing using the - enumeration. - - - - - Calculates the target location and bounds to perform the resize operation against. - - The source image size. - The resize options. - - The tuple representing the location and the bounds - - - - - Points to a collection of weights allocated in . - - - - - Initializes a new instance of the struct. - - - - - Gets the start index for the destination row. - - - - - Gets the length of the kernel. - - - - - Gets the span representing the portion of the that this window covers. - - The . - - - - - Computes the sum of vectors in 'rowSpan' weighted by weight values, pointed by this instance. - - The input span of vectors - The weighted sum - - - - Copy the contents of altering - to the value . - - - - - Provides resize kernel values from an optimized contiguous memory region. - - - - - Gets the length of the destination row/column - - - - - Gets the maximum diameter of the kernels. - - - - - Gets a string of information to help debugging - - - - - Disposes instance releasing it's backing buffer. - - - - - Disposes the object and frees resources for the Garbage Collector. - - Whether to dispose of managed and unmanaged objects. - - - - Returns a for an index value between 0 and DestinationSize - 1. - - - - - Computes the weights to apply at each pixel when resizing. - - The type of sampler. - The - The destination size - The source size - The to use for buffer allocations - The - - - - Initializes the kernel map. - - - - - Builds a for the row (in ) - referencing the data at row within , - so the data reusable by other data rows. - - - - - Returns a referencing values of - at row . - - - - - Memory-optimized where repeating rows are stored only once. - - - - - Defines an image resizing operation with the given and dimensional parameters. - - - - - Initializes a new instance of the class. - - The resize options. - The source image size. - - - - Gets the destination width. - - - - - Gets the destination height. - - - - - Gets the resize rectangle. - - - - - Gets the resize options. - - - - - - - - Implements resizing of images using various resamplers. - - The pixel format. - - - - - - - - - - - - - Implements the resize algorithm using a sliding window of size - maximized by . - The height of the window is a multiple of the vertical kernel's maximum diameter. - When sliding the window, the contents of the bottom window band are copied to the new top band. - For more details, and visual explanation, see "ResizeWorker.pptx". - - - - - Defines a swizzle operation on an image. - - The swizzle function type. - - - - Initializes a new instance of the class. - - The swizzler operation. - - - - Gets the swizzler operation. - - - - - - - - The base class for all transform processors. Any processor that changes the dimensions of the image should inherit from this. - - The pixel format. - - - - Initializes a new instance of the class. - - The configuration which allows altering default behaviour or extending the library. - The source for the current processor instance. - The source area to process for the current processor instance. - - - - - - - Contains helper methods for working with transforms. - - - - - Updates the dimensional metadata of a transformed image - - The pixel format. - The image to update - - - - Contains utility methods for working with transforms. - - - - - Returns a value that indicates whether the specified matrix is degenerate - containing one or more values equivalent to or a - zero determinant and therefore cannot be used for linear transforms. - - The transform matrix. - - - - Returns a value that indicates whether the specified matrix is degenerate - containing one or more values equivalent to or a - zero determinant and therefore cannot be used for linear transforms. - - The transform matrix. - - - - Returns a value that indicates whether the specified matrix contains any values - that are not a number . - - The transform matrix. - The . - - - - Returns a value that indicates whether the specified matrix contains any values - that are not a number . - - The transform matrix. - The . - - - - Applies the projective transform against the given coordinates flattened into the 2D space. - - The "x" vector coordinate. - The "y" vector coordinate. - The transform matrix. - The . - - - - Creates a centered rotation matrix using the given rotation in degrees and the source size. - - The amount of rotation, in degrees. - The source image size. - The . - - - - Creates a centered rotation matrix using the given rotation in radians and the source size. - - The amount of rotation, in radians. - The source image size. - The . - - - - Creates a centered skew matrix from the give angles in degrees and the source size. - - The X angle, in degrees. - The Y angle, in degrees. - The source image size. - The . - - - - Creates a centered skew matrix from the give angles in radians and the source size. - - The X angle, in radians. - The Y angle, in radians. - The source image size. - The . - - - - Gets the centered transform matrix based upon the source and destination rectangles. - - The source image bounds. - The transformation matrix. - The - - - - Creates a matrix that performs a tapering projective transform. - - - The rectangular size of the image being transformed. - An enumeration that indicates the side of the rectangle that tapers. - An enumeration that indicates on which corners to taper the rectangle. - The amount to taper. - The - - - - Returns the rectangle bounds relative to the source for the given transformation matrix. - - The source rectangle. - The transformation matrix. - - The . - - - - - Returns the rectangle relative to the source for the given transformation matrix. - - The source rectangle. - The transformation matrix. - - The . - - - - - Returns the size relative to the source for the given transformation matrix. - - The source size. - The transformation matrix. - - The . - - - - - Returns the rectangle relative to the source for the given transformation matrix. - - The source rectangle. - The transformation matrix. - - The . - - - - - Returns the size relative to the source for the given transformation matrix. - - The source size. - The transformation matrix. - - The . - - - - - A helper class for constructing instances for use in projective transforms. - - - - - Prepends a matrix that performs a tapering projective transform. - - An enumeration that indicates the side of the rectangle that tapers. - An enumeration that indicates on which corners to taper the rectangle. - The amount to taper. - The . - - - - Appends a matrix that performs a tapering projective transform. - - An enumeration that indicates the side of the rectangle that tapers. - An enumeration that indicates on which corners to taper the rectangle. - The amount to taper. - The . - - - - Prepends a centered rotation matrix using the given rotation in degrees. - - The amount of rotation, in degrees. - The . - - - - Prepends a centered rotation matrix using the given rotation in radians. - - The amount of rotation, in radians. - The . - - - - Prepends a centered rotation matrix using the given rotation in degrees at the given origin. - - The amount of rotation, in radians. - The rotation origin point. - The . - - - - Prepends a centered rotation matrix using the given rotation in radians at the given origin. - - The amount of rotation, in radians. - The rotation origin point. - The . - - - - Appends a centered rotation matrix using the given rotation in degrees. - - The amount of rotation, in degrees. - The . - - - - Appends a centered rotation matrix using the given rotation in radians. - - The amount of rotation, in radians. - The . - - - - Appends a centered rotation matrix using the given rotation in degrees at the given origin. - - The amount of rotation, in radians. - The rotation origin point. - The . - - - - Appends a centered rotation matrix using the given rotation in radians at the given origin. - - The amount of rotation, in radians. - The rotation origin point. - The . - - - - Prepends a scale matrix from the given uniform scale. - - The uniform scale. - The . - - - - Prepends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Prepends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Appends a scale matrix from the given uniform scale. - - The uniform scale. - The . - - - - Appends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Appends a scale matrix from the given vector scale. - - The horizontal and vertical scale. - The . - - - - Prepends a centered skew matrix from the give angles in degrees. - - The X angle, in degrees. - The Y angle, in degrees. - The . - - - - Prepends a centered skew matrix from the give angles in radians. - - The X angle, in radians. - The Y angle, in radians. - The . - - - - Prepends a skew matrix using the given angles in degrees at the given origin. - - The X angle, in degrees. - The Y angle, in degrees. - The skew origin point. - The . - - - - Prepends a skew matrix using the given angles in radians at the given origin. - - The X angle, in radians. - The Y angle, in radians. - The skew origin point. - The . - - - - Appends a centered skew matrix from the give angles in degrees. - - The X angle, in degrees. - The Y angle, in degrees. - The . - - - - Appends a centered skew matrix from the give angles in radians. - - The X angle, in radians. - The Y angle, in radians. - The . - - - - Appends a skew matrix using the given angles in degrees at the given origin. - - The X angle, in degrees. - The Y angle, in degrees. - The skew origin point. - The . - - - - Appends a skew matrix using the given angles in radians at the given origin. - - The X angle, in radians. - The Y angle, in radians. - The skew origin point. - The . - - - - Prepends a translation matrix from the given vector. - - The translation position. - The . - - - - Prepends a translation matrix from the given vector. - - The translation position. - The . - - - - Appends a translation matrix from the given vector. - - The translation position. - The . - - - - Appends a translation matrix from the given vector. - - The translation position. - The . - - - - Prepends a raw matrix. - - The matrix to prepend. - - The resultant matrix is degenerate containing one or more values equivalent - to or a zero determinant and therefore cannot be used - for linear transforms. - - The . - - - - Appends a raw matrix. - - The matrix to append. - - The resultant matrix is degenerate containing one or more values equivalent - to or a zero determinant and therefore cannot be used - for linear transforms. - - The . - - - - Returns the combined matrix for a given source size. - - The source image size. - The . - - - - Returns the combined matrix for a given source rectangle. - - The rectangle in the source image. - - The resultant matrix is degenerate containing one or more values equivalent - to or a zero determinant and therefore cannot be used - for linear transforms. - - The . - - - - Provides enumeration over how the image should be resized. - - - - - Crops the resized image to fit the bounds of its container. - - - - - Pads the resized image to fit the bounds of its container. - If only one dimension is passed, will maintain the original aspect ratio. - - - - - Pads the image to fit the bound of the container without resizing the - original source. - When downscaling, performs the same functionality as - - - - - Constrains the resized image to fit the bounds of its container maintaining - the original aspect ratio. - - - - - Resizes the image until the shortest side reaches the set given dimension. - Upscaling is disabled in this mode and the original image will be returned - if attempted. - - - - - Stretches the resized image to fit the bounds of its container. - - - - - The target location and size of the resized image has been manually set. - - - - - The resize options for resizing images against certain modes. - - - - - Gets or sets the resize mode. - - - - - Gets or sets the anchor position. - - - - - Gets or sets the center coordinates. - - - - - Gets or sets the target size. - - - - - Gets or sets the sampler to perform the resize operation. - - - - - Gets or sets a value indicating whether to compress - or expand individual pixel colors the value on processing. - - - - - Gets or sets the target rectangle to resize into. - - - - - Gets or sets a value indicating whether to premultiply - the alpha (if it exists) during the resize operation. - - - - - Gets or sets the color to use as a background when padding an image. - - - - - Provides enumeration over how the image should be rotated. - - - - - Do not rotate the image. - - - - - Rotate the image by 90 degrees clockwise. - - - - - Rotate the image by 180 degrees clockwise. - - - - - Rotate the image by 270 degrees clockwise. - - - - - Enumerates the various options which determine how to taper corners - - - - - Taper the left or top corner - - - - - Taper the right or bottom corner - - - - - Taper the both sets of corners - - - - - Enumerates the various options which determine which side to taper - - - - - Taper the left side - - - - - Taper the top side - - - - - Taper the right side - - - - - Taper the bottom side - - - - - Specifies the position in a stream to use for reading. - - - - - Specifies the beginning of a stream. - - - - - Specifies the current position within a stream. - - - - - Provides methods to protect against invalid parameters for a DEBUG build. - - - Provides methods to protect against invalid parameters for a DEBUG build. - - - - - Verifies whether a specific condition is met, throwing an exception if it's false. - - The condition - The error message - - - - Verifies whether a condition (indicating disposed state) is met, throwing an ObjectDisposedException if it's true. - - Whether the object is disposed. - The name of the object. - - - - Verifies, that the target span is of same size than the 'other' span. - - The element type of the spans - The target span. - The 'other' span to compare 'target' to. - The name of the parameter that is to be checked. - - has a different size than - - - - - Verifies, that the `target` span has the length of 'minSpan', or longer. - - The element type of the spans - The target span. - The 'minSpan' span to compare 'target' to. - The name of the parameter that is to be checked. - - has less items than - - - - - Ensures that the value is not null. - - The target object, which cannot be null. - The name of the parameter that is to be checked. - The type of the value. - is null. - - - - Ensures that the target value is not null, empty, or whitespace. - - The target string, which should be checked against being null or empty. - Name of the parameter. - is null. - is empty or contains only blanks. - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - The type of the value. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - The type of the value. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - The type of the value. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - The type of the value. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - The type of the value. - - is less than the minimum value of greater than the maximum value. - - - - - Verifies, that the method parameter with specified target value is true - and throws an exception if it is found to be so. - - The target value, which cannot be false. - The name of the parameter that is to be checked. - The error message, if any to add to the exception. - - is false. - - - - - Verifies, that the method parameter with specified target value is false - and throws an exception if it is found to be so. - - The target value, which cannot be true. - The name of the parameter that is to be checked. - The error message, if any to add to the exception. - - is true. - - - - - Verifies, that the `source` span has the length of 'minLength', or longer. - - The element type of the spans. - The source span. - The minimum length. - The name of the parameter that is to be checked. - - has less than items. - - - - - Verifies, that the `source` span has the length of 'minLength', or longer. - - The element type of the spans. - The target span. - The minimum length. - The name of the parameter that is to be checked. - - has less than items. - - - - - Verifies that the 'destination' span is not shorter than 'source'. - - The source element type. - The destination element type. - The source span. - The destination span. - The name of the argument for 'destination'. - - - - Verifies that the 'destination' span is not shorter than 'source'. - - The source element type. - The destination element type. - The source span. - The destination span. - The name of the argument for 'destination'. - - - - Provides methods to protect against invalid parameters. - - - Provides methods to protect against invalid parameters. - - - - - Ensures that the value is a value type. - - The target object, which cannot be null. - The name of the parameter that is to be checked. - The type of the value. - is not a value type. - - - - Ensures that the value is not null. - - The target object, which cannot be null. - The name of the parameter that is to be checked. - The type of the value. - is null. - - - - Ensures that the target value is not null, empty, or whitespace. - - The target string, which should be checked against being null or empty. - Name of the parameter. - is null. - is empty or contains only blanks. - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - The type of the value. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - The type of the value. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - The type of the value. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - The type of the value. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - The type of the value. - - is less than the minimum value of greater than the maximum value. - - - - - Verifies, that the method parameter with specified target value is true - and throws an exception if it is found to be so. - - The target value, which cannot be false. - The name of the parameter that is to be checked. - The error message, if any to add to the exception. - - is false. - - - - - Verifies, that the method parameter with specified target value is false - and throws an exception if it is found to be so. - - The target value, which cannot be true. - The name of the parameter that is to be checked. - The error message, if any to add to the exception. - - is true. - - - - - Verifies, that the `source` span has the length of 'minLength', or longer. - - The element type of the spans. - The source span. - The minimum length. - The name of the parameter that is to be checked. - - has less than items. - - - - - Verifies, that the `source` span has the length of 'minLength', or longer. - - The element type of the spans. - The target span. - The minimum length. - The name of the parameter that is to be checked. - - has less than items. - - - - - Verifies that the 'destination' span is not shorter than 'source'. - - The source element type. - The destination element type. - The source span. - The destination span. - The name of the argument for 'destination'. - - - - Verifies that the 'destination' span is not shorter than 'source'. - - The source element type. - The destination element type. - The source span. - The destination span. - The name of the argument for 'destination'. - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Ensures that the specified value is less than a maximum value. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is less than or equal to a maximum value - and throws an exception if it is not. - - The target value, which should be validated. - The maximum value. - The name of the parameter that is to be checked. - - is greater than the maximum value. - - - - - Verifies that the specified value is greater than a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value - and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The name of the parameter that is to be checked. - - is less than the minimum value. - - - - - Verifies that the specified value is greater than or equal to a minimum value and less than - or equal to a maximum value and throws an exception if it is not. - - The target value, which should be validated. - The minimum value. - The maximum value. - The name of the parameter that is to be checked. - - is less than the minimum value of greater than the maximum value. - - - - - Helper methods to throw exceptions - - - - - Throws an when fails. - - - - - Throws an when fails. - - - - - Throws an when fails. - - - - - Throws an when fails. - - - - - Throws an when fails. - - - - - Throws an when fails. - - - - - Throws an when fails. - - - - - Throws an when fails. - - - - - Throws a new . - - The message to include in the exception. - The argument name. - Thrown with and . - - - - Throws a new . - - The argument name. - The message to include in the exception. - Thrown with and . - - - - Throws a new . - - The argument name. - The message to include in the exception. - Thrown with and . - - - - Provides single-precision floating point constants and static methods for trigonometric, logarithmic, and other common mathematical functions. - - MathF emulation on platforms that don't support it natively. - - - - Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π. - - - - - Returns the absolute value of a single-precision floating-point number. - - - A number that is greater than or equal to , but less than or equal to . - - - A single-precision floating-point number, x, such that 0 ≤ x ≤. - - - - - Returns the angle whose tangent is the quotient of two specified numbers. - - The y coordinate of a point. - The x coordinate of a point. - - An angle, θ, measured in radians, such that -π≤θ≤π, and tan(θ) = y / x, where - (x, y) is a point in the Cartesian plane. Observe the following: For (x, y) in - quadrant 1, 0 < θ < π/2.For (x, y) in quadrant 2, π/2 < θ≤π.For (x, y) in quadrant - 3, -π < θ < -π/2.For (x, y) in quadrant 4, -π/2 < θ < 0.For points on the boundaries - of the quadrants, the return value is the following:If y is 0 and x is not negative, - θ = 0.If y is 0 and x is negative, θ = π.If y is positive and x is 0, θ = π/2.If - y is negative and x is 0, θ = -π/2.If y is 0 and x is 0, θ = 0. If x or y is - , or if x and y are either or - , the method returns . - - - - - Returns the smallest integral value that is greater than or equal to the specified single-precision floating-point number. - - A single-precision floating-point number. - - The smallest integral value that is greater than or equal to . - If is equal to , , - or , that value is returned. - Note that this method returns a instead of an integral type. - - - - - Returns the cosine of the specified angle. - - An angle, measured in radians. - - The cosine of . If is equal to , , - or , this method returns . - - - - - Returns e raised to the specified power. - - A number specifying a power. - - The number e raised to the power . - If equals or , that value is returned. - If equals , 0 is returned. - - - - - Returns the largest integer less than or equal to the specified single-precision floating-point number. - - A single-precision floating-point number. - - The largest integer less than or equal to . - If is equal to , , - or , that value is returned. - - - - - Returns the larger of two single-precision floating-point numbers. - - The first of two single-precision floating-point numbers to compare. - The second of two single-precision floating-point numbers to compare. - - Parameter or , whichever is larger. - If , or , or both and are - equal to , is returned. - - - - - Returns the smaller of two single-precision floating-point numbers. - - The first of two single-precision floating-point numbers to compare. - The second of two single-precision floating-point numbers to compare. - - Parameter or , whichever is smaller. - If , , or both and are equal - to , is returned. - - - - - Returns a specified number raised to the specified power. - - A single-precision floating-point number to be raised to a power. - A single-precision floating-point number that specifies a power. - The number raised to the power . - - - - Rounds a single-precision floating-point value to the nearest integral value. - - A single-precision floating-point number to be rounded. - - The integer nearest . - If the fractional component of is halfway between two integers, one of which is even and the other odd, then the even number is returned. - Note that this method returns a instead of an integral type. - - - - - Rounds a single-precision floating-point value to the nearest integer. - A parameter specifies how to round the value if it is midway between two numbers. - - A single-precision floating-point number to be rounded. - Specification for how to round if it is midway between two other numbers. - - The integer nearest . If is halfway between two integers, one of which is even - and the other odd, then determines which of the two is returned. - Note that this method returns a instead of an integral type. - - - is not a valid value of . - - - - Returns the sine of the specified angle. - - An angle, measured in radians. - - The sine of . - If is equal to , , - or , this method returns . - - - - - Returns the square root of a specified number. - - The number whose square root is to be found. - - One of the values in the following table. - parameter Return value Zero or positive The positive square root of . - Negative Equals - Equals - . - - -
-
diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.xml.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.xml.meta deleted file mode 100644 index 598a81c8..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/SixLabors.ImageSharp.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: afad6e2db784c436897637bafaa2cd9d -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.dll deleted file mode 100644 index f2d83c51..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.dll.meta deleted file mode 100644 index f63e72b7..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 32c75a0b5a2b041d0b3537706a5fa82d -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.xml b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.xml deleted file mode 100644 index e243dcef..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - System.Buffers - - - - Provides a resource pool that enables reusing instances of type . - The type of the objects that are in the resource pool. - - - Initializes a new instance of the class. - - - Creates a new instance of the class. - A new instance of the class. - - - Creates a new instance of the class using the specifed configuration. - The maximum length of an array instance that may be stored in the pool. - The maximum number of array instances that may be stored in each bucket in the pool. The pool groups arrays of similar lengths into buckets for faster access. - A new instance of the class with the specified configuration. - - - Retrieves a buffer that is at least the requested length. - The minimum length of the array. - An array of type that is at least minimumLength in length. - - - Returns an array to the pool that was previously obtained using the method on the same instance. - A buffer to return to the pool that was previously obtained using the method. - Indicates whether the contents of the buffer should be cleared before reuse. If clearArray is set to true, and if the pool will store the buffer to enable subsequent reuse, the method will clear the array of its contents so that a subsequent caller using the method will not see the content of the previous caller. If clearArray is set to false or if the pool will release the buffer, the array&#39;s contents are left unchanged. - - - Gets a shared instance. - A shared instance. - - - \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.xml.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.xml.meta deleted file mode 100644 index 24ff6b04..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Buffers.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8b765598ff9384f88a7dde4719df439a -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.dll deleted file mode 100644 index 5d194705..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.dll.meta deleted file mode 100644 index 52b1cba6..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 98f7f51ba4e0d4eb5a8bf091dc15d2fa -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.xml b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.xml deleted file mode 100644 index 4d12fd71..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.xml +++ /dev/null @@ -1,355 +0,0 @@ - - - System.Memory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.xml.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.xml.meta deleted file mode 100644 index 7bea99c3..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Memory.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 39f5f2549987a418d9fc375080a5446d -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.dll deleted file mode 100644 index 08659724..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.dll.meta deleted file mode 100644 index 61ef2c7d..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 1bbb37768a74b44cc896cb70d671d785 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.xml b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.xml deleted file mode 100644 index da34d390..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.xml +++ /dev/null @@ -1,2621 +0,0 @@ - - - System.Numerics.Vectors - - - - Represents a 3x2 matrix. - - - Creates a 3x2 matrix from the specified components. - The value to assign to the first element in the first row. - The value to assign to the second element in the first row. - The value to assign to the first element in the second row. - The value to assign to the second element in the second row. - The value to assign to the first element in the third row. - The value to assign to the second element in the third row. - - - Adds each element in one matrix with its corresponding element in a second matrix. - The first matrix. - The second matrix. - The matrix that contains the summed values of value1 and value2. - - - Creates a rotation matrix using the given rotation in radians. - The amount of rotation, in radians. - The rotation matrix. - - - Creates a rotation matrix using the specified rotation in radians and a center point. - The amount of rotation, in radians. - The center point. - The rotation matrix. - - - Creates a scaling matrix from the specified X and Y components. - The value to scale by on the X axis. - The value to scale by on the Y axis. - The scaling matrix. - - - Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. - The uniform scale to use. - The center offset. - The scaling matrix. - - - Creates a scaling matrix that is offset by a given center point. - The value to scale by on the X axis. - The value to scale by on the Y axis. - The center point. - The scaling matrix. - - - Creates a scaling matrix that scales uniformly with the given scale. - The uniform scale to use. - The scaling matrix. - - - Creates a scaling matrix from the specified vector scale. - The scale to use. - The scaling matrix. - - - Creates a scaling matrix from the specified vector scale with an offset from the specified center point. - The scale to use. - The center offset. - The scaling matrix. - - - Creates a skew matrix from the specified angles in radians. - The X angle, in radians. - The Y angle, in radians. - The skew matrix. - - - Creates a skew matrix from the specified angles in radians and a center point. - The X angle, in radians. - The Y angle, in radians. - The center point. - The skew matrix. - - - Creates a translation matrix from the specified 2-dimensional vector. - The translation position. - The translation matrix. - - - Creates a translation matrix from the specified X and Y components. - The X position. - The Y position. - The translation matrix. - - - Returns a value that indicates whether this instance and another 3x2 matrix are equal. - The other matrix. - true if the two matrices are equal; otherwise, false. - - - Returns a value that indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false. - - - Calculates the determinant for this matrix. - The determinant. - - - Returns the hash code for this instance. - The hash code. - - - Gets the multiplicative identity matrix. - The multiplicative identify matrix. - - - Inverts the specified matrix. The return value indicates whether the operation succeeded. - The matrix to invert. - When this method returns, contains the inverted matrix if the operation succeeded. - true if matrix was converted successfully; otherwise, false. - - - Indicates whether the current matrix is the identity matrix. - true if the current matrix is the identity matrix; otherwise, false. - - - Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. - The first matrix. - The second matrix. - The relative weighting of matrix2. - The interpolated matrix. - - - The first element of the first row. - - - - The second element of the first row. - - - - The first element of the second row. - - - - The second element of the second row. - - - - The first element of the third row. - - - - The second element of the third row. - - - - Returns the matrix that results from multiplying two matrices together. - The first matrix. - The second matrix. - The product matrix. - - - Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. - The matrix to scale. - The scaling value to use. - The scaled matrix. - - - Negates the specified matrix by multiplying all its values by -1. - The matrix to negate. - The negated matrix. - - - Adds each element in one matrix with its corresponding element in a second matrix. - The first matrix. - The second matrix. - The matrix that contains the summed values. - - - Returns a value that indicates whether the specified matrices are equal. - The first matrix to compare. - The second matrix to compare. - true if value1 and value2 are equal; otherwise, false. - - - Returns a value that indicates whether the specified matrices are not equal. - The first matrix to compare. - The second matrix to compare. - true if value1 and value2 are not equal; otherwise, false. - - - Returns the matrix that results from multiplying two matrices together. - The first matrix. - The second matrix. - The product matrix. - - - Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. - The matrix to scale. - The scaling value to use. - The scaled matrix. - - - Subtracts each element in a second matrix from its corresponding element in a first matrix. - The first matrix. - The second matrix. - The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. - - - Negates the specified matrix by multiplying all its values by -1. - The matrix to negate. - The negated matrix. - - - Subtracts each element in a second matrix from its corresponding element in a first matrix. - The first matrix. - The second matrix. - The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. - - - Returns a string that represents this matrix. - The string representation of this matrix. - - - Gets or sets the translation component of this matrix. - The translation component of the current instance. - - - Represents a 4x4 matrix. - - - Creates a object from a specified object. - A 3x2 matrix. - - - Creates a 4x4 matrix from the specified components. - The value to assign to the first element in the first row. - The value to assign to the second element in the first row. - The value to assign to the third element in the first row. - The value to assign to the fourth element in the first row. - The value to assign to the first element in the second row. - The value to assign to the second element in the second row. - The value to assign to the third element in the second row. - The value to assign to the third element in the second row. - The value to assign to the first element in the third row. - The value to assign to the second element in the third row. - The value to assign to the third element in the third row. - The value to assign to the fourth element in the third row. - The value to assign to the first element in the fourth row. - The value to assign to the second element in the fourth row. - The value to assign to the third element in the fourth row. - The value to assign to the fourth element in the fourth row. - - - Adds each element in one matrix with its corresponding element in a second matrix. - The first matrix. - The second matrix. - The matrix that contains the summed values of value1 and value2. - - - Creates a spherical billboard that rotates around a specified object position. - The position of the object that the billboard will rotate around. - The position of the camera. - The up vector of the camera. - The forward vector of the camera. - The created billboard. - - - Creates a cylindrical billboard that rotates around a specified axis. - The position of the object that the billboard will rotate around. - The position of the camera. - The axis to rotate the billboard around. - The forward vector of the camera. - The forward vector of the object. - The billboard matrix. - - - Creates a matrix that rotates around an arbitrary vector. - The axis to rotate around. - The angle to rotate around axis, in radians. - The rotation matrix. - - - Creates a rotation matrix from the specified Quaternion rotation value. - The source Quaternion. - The rotation matrix. - - - Creates a rotation matrix from the specified yaw, pitch, and roll. - The angle of rotation, in radians, around the Y axis. - The angle of rotation, in radians, around the X axis. - The angle of rotation, in radians, around the Z axis. - The rotation matrix. - - - Creates a view matrix. - The position of the camera. - The target towards which the camera is pointing. - The direction that is &quot;up&quot; from the camera&#39;s point of view. - The view matrix. - - - Creates an orthographic perspective matrix from the given view volume dimensions. - The width of the view volume. - The height of the view volume. - The minimum Z-value of the view volume. - The maximum Z-value of the view volume. - The orthographic projection matrix. - - - Creates a customized orthographic projection matrix. - The minimum X-value of the view volume. - The maximum X-value of the view volume. - The minimum Y-value of the view volume. - The maximum Y-value of the view volume. - The minimum Z-value of the view volume. - The maximum Z-value of the view volume. - The orthographic projection matrix. - - - Creates a perspective projection matrix from the given view volume dimensions. - The width of the view volume at the near view plane. - The height of the view volume at the near view plane. - The distance to the near view plane. - The distance to the far view plane. - The perspective projection matrix. - nearPlaneDistance is less than or equal to zero. - -or- - farPlaneDistance is less than or equal to zero. - -or- - nearPlaneDistance is greater than or equal to farPlaneDistance. - - - Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. - The field of view in the y direction, in radians. - The aspect ratio, defined as view space width divided by height. - The distance to the near view plane. - The distance to the far view plane. - The perspective projection matrix. - fieldOfView is less than or equal to zero. - -or- - fieldOfView is greater than or equal to . - nearPlaneDistance is less than or equal to zero. - -or- - farPlaneDistance is less than or equal to zero. - -or- - nearPlaneDistance is greater than or equal to farPlaneDistance. - - - Creates a customized perspective projection matrix. - The minimum x-value of the view volume at the near view plane. - The maximum x-value of the view volume at the near view plane. - The minimum y-value of the view volume at the near view plane. - The maximum y-value of the view volume at the near view plane. - The distance to the near view plane. - The distance to the far view plane. - The perspective projection matrix. - nearPlaneDistance is less than or equal to zero. - -or- - farPlaneDistance is less than or equal to zero. - -or- - nearPlaneDistance is greater than or equal to farPlaneDistance. - - - Creates a matrix that reflects the coordinate system about a specified plane. - The plane about which to create a reflection. - A new matrix expressing the reflection. - - - Creates a matrix for rotating points around the X axis. - The amount, in radians, by which to rotate around the X axis. - The rotation matrix. - - - Creates a matrix for rotating points around the X axis from a center point. - The amount, in radians, by which to rotate around the X axis. - The center point. - The rotation matrix. - - - The amount, in radians, by which to rotate around the Y axis from a center point. - The amount, in radians, by which to rotate around the Y-axis. - The center point. - The rotation matrix. - - - Creates a matrix for rotating points around the Y axis. - The amount, in radians, by which to rotate around the Y-axis. - The rotation matrix. - - - Creates a matrix for rotating points around the Z axis. - The amount, in radians, by which to rotate around the Z-axis. - The rotation matrix. - - - Creates a matrix for rotating points around the Z axis from a center point. - The amount, in radians, by which to rotate around the Z-axis. - The center point. - The rotation matrix. - - - Creates a scaling matrix from the specified vector scale. - The scale to use. - The scaling matrix. - - - Creates a uniform scaling matrix that scale equally on each axis. - The uniform scaling factor. - The scaling matrix. - - - Creates a scaling matrix with a center point. - The vector that contains the amount to scale on each axis. - The center point. - The scaling matrix. - - - Creates a uniform scaling matrix that scales equally on each axis with a center point. - The uniform scaling factor. - The center point. - The scaling matrix. - - - Creates a scaling matrix from the specified X, Y, and Z components. - The value to scale by on the X axis. - The value to scale by on the Y axis. - The value to scale by on the Z axis. - The scaling matrix. - - - Creates a scaling matrix that is offset by a given center point. - The value to scale by on the X axis. - The value to scale by on the Y axis. - The value to scale by on the Z axis. - The center point. - The scaling matrix. - - - Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. - The direction from which the light that will cast the shadow is coming. - The plane onto which the new matrix should flatten geometry so as to cast a shadow. - A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. - - - Creates a translation matrix from the specified 3-dimensional vector. - The amount to translate in each axis. - The translation matrix. - - - Creates a translation matrix from the specified X, Y, and Z components. - The amount to translate on the X axis. - The amount to translate on the Y axis. - The amount to translate on the Z axis. - The translation matrix. - - - Creates a world matrix with the specified parameters. - The position of the object. - The forward direction of the object. - The upward direction of the object. Its value is usually [0, 1, 0]. - The world matrix. - - - Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. - The source matrix. - When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. - When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. - When the method returns, contains the translation component of the transformation matrix if the operation succeeded. - true if matrix was decomposed successfully; otherwise, false. - - - Returns a value that indicates whether this instance and another 4x4 matrix are equal. - The other matrix. - true if the two matrices are equal; otherwise, false. - - - Returns a value that indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false. - - - Calculates the determinant of the current 4x4 matrix. - The determinant. - - - Returns the hash code for this instance. - The hash code. - - - Gets the multiplicative identity matrix. - Gets the multiplicative identity matrix. - - - Inverts the specified matrix. The return value indicates whether the operation succeeded. - The matrix to invert. - When this method returns, contains the inverted matrix if the operation succeeded. - true if matrix was converted successfully; otherwise, false. - - - Indicates whether the current matrix is the identity matrix. - true if the current matrix is the identity matrix; otherwise, false. - - - Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. - The first matrix. - The second matrix. - The relative weighting of matrix2. - The interpolated matrix. - - - The first element of the first row. - - - - The second element of the first row. - - - - The third element of the first row. - - - - The fourth element of the first row. - - - - The first element of the second row. - - - - The second element of the second row. - - - - The third element of the second row. - - - - The fourth element of the second row. - - - - The first element of the third row. - - - - The second element of the third row. - - - - The third element of the third row. - - - - The fourth element of the third row. - - - - The first element of the fourth row. - - - - The second element of the fourth row. - - - - The third element of the fourth row. - - - - The fourth element of the fourth row. - - - - Returns the matrix that results from multiplying two matrices together. - The first matrix. - The second matrix. - The product matrix. - - - Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. - The matrix to scale. - The scaling value to use. - The scaled matrix. - - - Negates the specified matrix by multiplying all its values by -1. - The matrix to negate. - The negated matrix. - - - Adds each element in one matrix with its corresponding element in a second matrix. - The first matrix. - The second matrix. - The matrix that contains the summed values. - - - Returns a value that indicates whether the specified matrices are equal. - The first matrix to compare. - The second matrix to care - true if value1 and value2 are equal; otherwise, false. - - - Returns a value that indicates whether the specified matrices are not equal. - The first matrix to compare. - The second matrix to compare. - true if value1 and value2 are not equal; otherwise, false. - - - Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. - The matrix to scale. - The scaling value to use. - The scaled matrix. - - - Returns the matrix that results from multiplying two matrices together. - The first matrix. - The second matrix. - The product matrix. - - - Subtracts each element in a second matrix from its corresponding element in a first matrix. - The first matrix. - The second matrix. - The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. - - - Negates the specified matrix by multiplying all its values by -1. - The matrix to negate. - The negated matrix. - - - Subtracts each element in a second matrix from its corresponding element in a first matrix. - The first matrix. - The second matrix. - The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. - - - Returns a string that represents this matrix. - The string representation of this matrix. - - - Transforms the specified matrix by applying the specified Quaternion rotation. - The matrix to transform. - The rotation t apply. - The transformed matrix. - - - Gets or sets the translation component of this matrix. - The translation component of the current instance. - - - Transposes the rows and columns of a matrix. - The matrix to transpose. - The transposed matrix. - - - Represents a three-dimensional plane. - - - Creates a object from a specified four-dimensional vector. - A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. - - - Creates a object from a specified normal and the distance along the normal from the origin. - The plane&#39;s normal vector. - The plane&#39;s distance from the origin along its normal vector. - - - Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. - The X component of the normal. - The Y component of the normal. - The Z component of the normal. - The distance of the plane along its normal from the origin. - - - Creates a object that contains three specified points. - The first point defining the plane. - The second point defining the plane. - The third point defining the plane. - The plane containing the three points. - - - The distance of the plane along its normal from the origin. - - - - Calculates the dot product of a plane and a 4-dimensional vector. - The plane. - The four-dimensional vector. - The dot product. - - - Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. - The plane. - The 3-dimensional vector. - The dot product. - - - Returns the dot product of a specified three-dimensional vector and the vector of this plane. - The plane. - The three-dimensional vector. - The dot product. - - - Returns a value that indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false. - - - Returns a value that indicates whether this instance and another plane object are equal. - The other plane. - true if the two planes are equal; otherwise, false. - - - Returns the hash code for this instance. - The hash code. - - - The normal vector of the plane. - - - - Creates a new object whose normal vector is the source plane&#39;s normal vector normalized. - The source plane. - The normalized plane. - - - Returns a value that indicates whether two planes are equal. - The first plane to compare. - The second plane to compare. - true if value1 and value2 are equal; otherwise, false. - - - Returns a value that indicates whether two planes are not equal. - The first plane to compare. - The second plane to compare. - true if value1 and value2 are not equal; otherwise, false. - - - Returns the string representation of this plane object. - A string that represents this object. - - - Transforms a normalized plane by a 4x4 matrix. - The normalized plane to transform. - The transformation matrix to apply to plane. - The transformed plane. - - - Transforms a normalized plane by a Quaternion rotation. - The normalized plane to transform. - The Quaternion rotation to apply to the plane. - A new plane that results from applying the Quaternion rotation. - - - Represents a vector that is used to encode three-dimensional physical rotations. - - - Creates a quaternion from the specified vector and rotation parts. - The vector part of the quaternion. - The rotation part of the quaternion. - - - Constructs a quaternion from the specified components. - The value to assign to the X component of the quaternion. - The value to assign to the Y component of the quaternion. - The value to assign to the Z component of the quaternion. - The value to assign to the W component of the quaternion. - - - Adds each element in one quaternion with its corresponding element in a second quaternion. - The first quaternion. - The second quaternion. - The quaternion that contains the summed values of value1 and value2. - - - Concatenates two quaternions. - The first quaternion rotation in the series. - The second quaternion rotation in the series. - A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. - - - Returns the conjugate of a specified quaternion. - The quaternion. - A new quaternion that is the conjugate of value. - - - Creates a quaternion from a vector and an angle to rotate about the vector. - The vector to rotate around. - The angle, in radians, to rotate around the vector. - The newly created quaternion. - - - Creates a quaternion from the specified rotation matrix. - The rotation matrix. - The newly created quaternion. - - - Creates a new quaternion from the given yaw, pitch, and roll. - The yaw angle, in radians, around the Y axis. - The pitch angle, in radians, around the X axis. - The roll angle, in radians, around the Z axis. - The resulting quaternion. - - - Divides one quaternion by a second quaternion. - The dividend. - The divisor. - The quaternion that results from dividing value1 by value2. - - - Calculates the dot product of two quaternions. - The first quaternion. - The second quaternion. - The dot product. - - - Returns a value that indicates whether this instance and another quaternion are equal. - The other quaternion. - true if the two quaternions are equal; otherwise, false. - - - Returns a value that indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false. - - - Returns the hash code for this instance. - The hash code. - - - Gets a quaternion that represents no rotation. - A quaternion whose values are (0, 0, 0, 1). - - - Returns the inverse of a quaternion. - The quaternion. - The inverted quaternion. - - - Gets a value that indicates whether the current instance is the identity quaternion. - true if the current instance is the identity quaternion; otherwise, false. - - - Calculates the length of the quaternion. - The computed length of the quaternion. - - - Calculates the squared length of the quaternion. - The length squared of the quaternion. - - - Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. - The first quaternion. - The second quaternion. - The relative weight of quaternion2 in the interpolation. - The interpolated quaternion. - - - Returns the quaternion that results from multiplying two quaternions together. - The first quaternion. - The second quaternion. - The product quaternion. - - - Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. - The source quaternion. - The scalar value. - The scaled quaternion. - - - Reverses the sign of each component of the quaternion. - The quaternion to negate. - The negated quaternion. - - - Divides each component of a specified by its length. - The quaternion to normalize. - The normalized quaternion. - - - Adds each element in one quaternion with its corresponding element in a second quaternion. - The first quaternion. - The second quaternion. - The quaternion that contains the summed values of value1 and value2. - - - Divides one quaternion by a second quaternion. - The dividend. - The divisor. - The quaternion that results from dividing value1 by value2. - - - Returns a value that indicates whether two quaternions are equal. - The first quaternion to compare. - The second quaternion to compare. - true if the two quaternions are equal; otherwise, false. - - - Returns a value that indicates whether two quaternions are not equal. - The first quaternion to compare. - The second quaternion to compare. - true if value1 and value2 are not equal; otherwise, false. - - - Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. - The source quaternion. - The scalar value. - The scaled quaternion. - - - Returns the quaternion that results from multiplying two quaternions together. - The first quaternion. - The second quaternion. - The product quaternion. - - - Subtracts each element in a second quaternion from its corresponding element in a first quaternion. - The first quaternion. - The second quaternion. - The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. - - - Reverses the sign of each component of the quaternion. - The quaternion to negate. - The negated quaternion. - - - Interpolates between two quaternions, using spherical linear interpolation. - The first quaternion. - The second quaternion. - The relative weight of the second quaternion in the interpolation. - The interpolated quaternion. - - - Subtracts each element in a second quaternion from its corresponding element in a first quaternion. - The first quaternion. - The second quaternion. - The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. - - - Returns a string that represents this quaternion. - The string representation of this quaternion. - - - The rotation component of the quaternion. - - - - The X value of the vector component of the quaternion. - - - - The Y value of the vector component of the quaternion. - - - - The Z value of the vector component of the quaternion. - - - - Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. - The vector type. T can be any primitive numeric type. - - - Creates a vector whose components are of a specified type. - The numeric type that defines the type of the components in the vector. - - - Creates a vector from a specified array. - A numeric array. - values is null. - - - Creates a vector from a specified array starting at a specified index position. - A numeric array. - The starting index position from which to create the vector. - values is null. - index is less than zero. - -or- - The length of values minus index is less than . - - - Copies the vector instance to a specified destination array. - The array to receive a copy of the vector values. - destination is null. - The number of elements in the current vector is greater than the number of elements available in the destination array. - - - Copies the vector instance to a specified destination array starting at a specified index position. - The array to receive a copy of the vector values. - The starting index in destination at which to begin the copy operation. - destination is null. - The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. - index is less than zero or greater than the last index in destination. - - - Returns the number of elements stored in the vector. - The number of elements stored in the vector. - Access to the property getter via reflection is not supported. - - - Returns a value that indicates whether this instance is equal to a specified vector. - The vector to compare with this instance. - true if the current instance and other are equal; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with this instance. - true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. - - - Returns the hash code for this instance. - The hash code. - - - Gets the element at a specified index. - The index of the element to return. - The element at index index. - index is less than zero. - -or- - index is greater than or equal to . - - - Returns a vector containing all ones. - A vector containing all ones. - - - Adds two vectors together. - The first vector to add. - The second vector to add. - The summed vector. - - - Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. - The first vector. - The second vector. - The vector that results from the bitwise And of left and right. - - - Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. - The first vector. - The second vector. - The vector that results from the bitwise Or of the elements in left and right. - - - Divides the first vector by the second. - The first vector. - The second vector. - The vector that results from dividing left by right. - - - Returns a value that indicates whether each pair of elements in two specified vectors are equal. - The first vector to compare. - The second vector to compare. - true if left and right are equal; otherwise, false. - - - Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. - The first vector. - The second vector. - The vector that results from the bitwise XOr of the elements in left and right. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Reinterprets the bits of the specified vector into a vector of type . - The vector to reinterpret. - The reinterpreted vector. - - - Returns a value that indicates whether any single pair of elements in the specified vectors is equal. - The first vector to compare. - The second vector to compare. - true if any element pairs in left and right are equal. false if no element pairs are equal. - - - Multiplies two vectors together. - The first vector. - The second vector. - The product vector. - - - Multiplies a vector by a specified scalar value. - The source vector. - A scalar value. - The scaled vector. - - - Multiplies a vector by the given scalar. - The scalar value. - The source vector. - The scaled vector. - - - Returns a new vector whose elements are obtained by taking the one&#39;s complement of a specified vector&#39;s elements. - The source vector. - The one&#39;s complement vector. - - - Subtracts the second vector from the first. - The first vector. - The second vector. - The vector that results from subtracting right from left. - - - Negates a given vector. - The vector to negate. - The negated vector. - - - Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. - A or that defines the format of individual elements. - A format provider that supplies culture-specific formatting information. - The string representation of the current instance. - - - Returns the string representation of this vector using default formatting. - The string representation of this vector. - - - Returns the string representation of this vector using the specified format string to format individual elements. - A or that defines the format of individual elements. - The string representation of the current instance. - - - Returns a vector containing all zeroes. - A vector containing all zeroes. - - - Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. - - - Returns a new vector whose elements are the absolute values of the given vector&#39;s elements. - The source vector. - The vector type. T can be any primitive numeric type. - The absolute value vector. - - - Returns a new vector whose values are the sum of each pair of elements from two given vectors. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The summed vector. - - - Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a vector of integers. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a vector of long integers. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a vector of signed bytes. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a vector of unsigned integers. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. - The source vector. - The vector type. T can be any primitive numeric type. - The reinterpreted vector. - - - Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. - The integral mask vector used to drive selection. - The first source vector. - The second source vector. - The new vector with elements selected based on the mask. - - - Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. - The integral mask vector used to drive selection. - The first source vector. - The second source vector. - The new vector with elements selected based on the mask. - - - Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. - The integral mask vector used to drive selection. - The first source vector. - The second source vector. - The vector type. T can be any primitive numeric type. - The new vector with elements selected based on the mask. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns a new vector whose values are the result of dividing the first vector&#39;s elements by the corresponding elements in the second vector. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The divided vector. - - - Returns the dot product of two vectors. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The dot product. - - - Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. - The first vector to compare. - The second vector to compare. - The resulting long integer vector. - - - Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Returns a value that indicates whether each pair of elements in the given vectors is equal. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if all elements in left and right are equal; otherwise, false. - - - Returns a value that indicates whether any single pair of elements in the given vectors is equal. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if any element pair in left and right is equal; otherwise, false. - - - Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. - The first vector to compare. - The second vector to compare. - The resulting long integer vector. - - - Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if all elements in left are greater than the corresponding elements in right; otherwise, false. - - - Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if any element in left is greater than the corresponding element in right; otherwise, false. - - - Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. - The first vector to compare. - The second vector to compare. - The resulting long integer vector. - - - Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. - - - Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. - - - Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. - true if vector operations are subject to hardware acceleration; otherwise, false. - - - Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector - - - Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. - The first vector to compare. - The second vector to compare. - The resulting long integer vector. - - - Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if all of the elements in left are less than the corresponding elements in right; otherwise, false. - - - Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if any element in left is less than the corresponding element in right; otherwise, false. - - - Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. - The first vector to compare. - The second vector to compare. - The resulting long integer vector. - - - Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. - The first vector to compare. - The second vector to compare. - The resulting integral vector. - - - Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. - - - Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - true if any element in left is less than or equal to the corresponding element in right; otherwise, false. - - - Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - The maximum vector. - - - Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. - The first vector to compare. - The second vector to compare. - The vector type. T can be any primitive numeric type. - The minimum vector. - - - Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. - The scalar value. - The vector. - The vector type. T can be any primitive numeric type. - The scaled vector. - - - Returns a new vector whose values are the product of each pair of elements in two specified vectors. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The product vector. - - - Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. - The vector. - The scalar value. - The vector type. T can be any primitive numeric type. - The scaled vector. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns a new vector whose elements are the negation of the corresponding element in the specified vector. - The source vector. - The vector type. T can be any primitive numeric type. - The negated vector. - - - Returns a new vector whose elements are obtained by taking the one&#39;s complement of a specified vector&#39;s elements. - The source vector. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Returns a new vector whose elements are the square roots of a specified vector&#39;s elements. - The source vector. - The vector type. T can be any primitive numeric type. - The square root vector. - - - Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The difference vector. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. - The first vector. - The second vector. - The vector type. T can be any primitive numeric type. - The resulting vector. - - - Represents a vector with two single-precision floating-point values. - - - Creates a new object whose two elements have the same value. - The value to assign to both elements. - - - Creates a vector whose elements have the specified values. - The value to assign to the field. - The value to assign to the field. - - - Returns a vector whose elements are the absolute values of each of the specified vector&#39;s elements. - A vector. - The absolute value vector. - - - Adds two vectors together. - The first vector to add. - The second vector to add. - The summed vector. - - - Restricts a vector between a minimum and a maximum value. - The vector to restrict. - The minimum value. - The maximum value. - The restricted vector. - - - Copies the elements of the vector to a specified array. - The destination array. - array is null. - The number of elements in the current instance is greater than in the array. - array is multidimensional. - - - Copies the elements of the vector to a specified array starting at a specified index position. - The destination array. - The index at which to copy the first element of the vector. - array is null. - The number of elements in the current instance is greater than in the array. - index is less than zero. - -or- - index is greater than or equal to the array length. - array is multidimensional. - - - Computes the Euclidean distance between the two given points. - The first point. - The second point. - The distance. - - - Returns the Euclidean distance squared between two specified points. - The first point. - The second point. - The distance squared. - - - Divides the first vector by the second. - The first vector. - The second vector. - The vector resulting from the division. - - - Divides the specified vector by a specified scalar value. - The vector. - The scalar value. - The vector that results from the division. - - - Returns the dot product of two vectors. - The first vector. - The second vector. - The dot product. - - - Returns a value that indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false. - - - Returns a value that indicates whether this instance and another vector are equal. - The other vector. - true if the two vectors are equal; otherwise, false. - - - Returns the hash code for this instance. - The hash code. - - - Returns the length of the vector. - The vector&#39;s length. - - - Returns the length of the vector squared. - The vector&#39;s length squared. - - - Performs a linear interpolation between two vectors based on the given weighting. - The first vector. - The second vector. - A value between 0 and 1 that indicates the weight of value2. - The interpolated vector. - - - Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. - The first vector. - The second vector. - The maximized vector. - - - Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. - The first vector. - The second vector. - The minimized vector. - - - Multiplies two vectors together. - The first vector. - The second vector. - The product vector. - - - Multiplies a vector by a specified scalar. - The vector to multiply. - The scalar value. - The scaled vector. - - - Multiplies a scalar value by a specified vector. - The scaled value. - The vector. - The scaled vector. - - - Negates a specified vector. - The vector to negate. - The negated vector. - - - Returns a vector with the same direction as the specified vector, but with a length of one. - The vector to normalize. - The normalized vector. - - - Gets a vector whose 2 elements are equal to one. - A vector whose two elements are equal to one (that is, it returns the vector (1,1). - - - Adds two vectors together. - The first vector to add. - The second vector to add. - The summed vector. - - - Divides the first vector by the second. - The first vector. - The second vector. - The vector that results from dividing left by right. - - - Divides the specified vector by a specified scalar value. - The vector. - The scalar value. - The result of the division. - - - Returns a value that indicates whether each pair of elements in two specified vectors is equal. - The first vector to compare. - The second vector to compare. - true if left and right are equal; otherwise, false. - - - Returns a value that indicates whether two specified vectors are not equal. - The first vector to compare. - The second vector to compare. - true if left and right are not equal; otherwise, false. - - - Multiplies two vectors together. - The first vector. - The second vector. - The product vector. - - - Multiples the specified vector by the specified scalar value. - The vector. - The scalar value. - The scaled vector. - - - Multiples the scalar value by the specified vector. - The vector. - The scalar value. - The scaled vector. - - - Subtracts the second vector from the first. - The first vector. - The second vector. - The vector that results from subtracting right from left. - - - Negates the specified vector. - The vector to negate. - The negated vector. - - - Returns the reflection of a vector off a surface that has the specified normal. - The source vector. - The normal of the surface being reflected off. - The reflected vector. - - - Returns a vector whose elements are the square root of each of a specified vector&#39;s elements. - A vector. - The square root vector. - - - Subtracts the second vector from the first. - The first vector. - The second vector. - The difference vector. - - - Returns the string representation of the current instance using default formatting. - The string representation of the current instance. - - - Returns the string representation of the current instance using the specified format string to format individual elements. - A or that defines the format of individual elements. - The string representation of the current instance. - - - Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. - A or that defines the format of individual elements. - A format provider that supplies culture-specific formatting information. - The string representation of the current instance. - - - Transforms a vector by a specified 3x2 matrix. - The vector to transform. - The transformation matrix. - The transformed vector. - - - Transforms a vector by a specified 4x4 matrix. - The vector to transform. - The transformation matrix. - The transformed vector. - - - Transforms a vector by the specified Quaternion rotation value. - The vector to rotate. - The rotation to apply. - The transformed vector. - - - Transforms a vector normal by the given 3x2 matrix. - The source vector. - The matrix. - The transformed vector. - - - Transforms a vector normal by the given 4x4 matrix. - The source vector. - The matrix. - The transformed vector. - - - Gets the vector (1,0). - The vector (1,0). - - - Gets the vector (0,1). - The vector (0,1). - - - The X component of the vector. - - - - The Y component of the vector. - - - - Returns a vector whose 2 elements are equal to zero. - A vector whose two elements are equal to zero (that is, it returns the vector (0,0). - - - Represents a vector with three single-precision floating-point values. - - - Creates a new object whose three elements have the same value. - The value to assign to all three elements. - - - Creates a new object from the specified object and the specified value. - The vector with two elements. - The additional value to assign to the field. - - - Creates a vector whose elements have the specified values. - The value to assign to the field. - The value to assign to the field. - The value to assign to the field. - - - Returns a vector whose elements are the absolute values of each of the specified vector&#39;s elements. - A vector. - The absolute value vector. - - - Adds two vectors together. - The first vector to add. - The second vector to add. - The summed vector. - - - Restricts a vector between a minimum and a maximum value. - The vector to restrict. - The minimum value. - The maximum value. - The restricted vector. - - - Copies the elements of the vector to a specified array. - The destination array. - array is null. - The number of elements in the current instance is greater than in the array. - array is multidimensional. - - - Copies the elements of the vector to a specified array starting at a specified index position. - The destination array. - The index at which to copy the first element of the vector. - array is null. - The number of elements in the current instance is greater than in the array. - index is less than zero. - -or- - index is greater than or equal to the array length. - array is multidimensional. - - - Computes the cross product of two vectors. - The first vector. - The second vector. - The cross product. - - - Computes the Euclidean distance between the two given points. - The first point. - The second point. - The distance. - - - Returns the Euclidean distance squared between two specified points. - The first point. - The second point. - The distance squared. - - - Divides the specified vector by a specified scalar value. - The vector. - The scalar value. - The vector that results from the division. - - - Divides the first vector by the second. - The first vector. - The second vector. - The vector resulting from the division. - - - Returns the dot product of two vectors. - The first vector. - The second vector. - The dot product. - - - Returns a value that indicates whether this instance and another vector are equal. - The other vector. - true if the two vectors are equal; otherwise, false. - - - Returns a value that indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false. - - - Returns the hash code for this instance. - The hash code. - - - Returns the length of this vector object. - The vector&#39;s length. - - - Returns the length of the vector squared. - The vector&#39;s length squared. - - - Performs a linear interpolation between two vectors based on the given weighting. - The first vector. - The second vector. - A value between 0 and 1 that indicates the weight of value2. - The interpolated vector. - - - Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. - The first vector. - The second vector. - The maximized vector. - - - Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. - The first vector. - The second vector. - The minimized vector. - - - Multiplies a scalar value by a specified vector. - The scaled value. - The vector. - The scaled vector. - - - Multiplies two vectors together. - The first vector. - The second vector. - The product vector. - - - Multiplies a vector by a specified scalar. - The vector to multiply. - The scalar value. - The scaled vector. - - - Negates a specified vector. - The vector to negate. - The negated vector. - - - Returns a vector with the same direction as the specified vector, but with a length of one. - The vector to normalize. - The normalized vector. - - - Gets a vector whose 3 elements are equal to one. - A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). - - - Adds two vectors together. - The first vector to add. - The second vector to add. - The summed vector. - - - Divides the first vector by the second. - The first vector. - The second vector. - The vector that results from dividing left by right. - - - Divides the specified vector by a specified scalar value. - The vector. - The scalar value. - The result of the division. - - - Returns a value that indicates whether each pair of elements in two specified vectors is equal. - The first vector to compare. - The second vector to compare. - true if left and right are equal; otherwise, false. - - - Returns a value that indicates whether two specified vectors are not equal. - The first vector to compare. - The second vector to compare. - true if left and right are not equal; otherwise, false. - - - Multiplies two vectors together. - The first vector. - The second vector. - The product vector. - - - Multiples the specified vector by the specified scalar value. - The vector. - The scalar value. - The scaled vector. - - - Multiples the scalar value by the specified vector. - The vector. - The scalar value. - The scaled vector. - - - Subtracts the second vector from the first. - The first vector. - The second vector. - The vector that results from subtracting right from left. - - - Negates the specified vector. - The vector to negate. - The negated vector. - - - Returns the reflection of a vector off a surface that has the specified normal. - The source vector. - The normal of the surface being reflected off. - The reflected vector. - - - Returns a vector whose elements are the square root of each of a specified vector&#39;s elements. - A vector. - The square root vector. - - - Subtracts the second vector from the first. - The first vector. - The second vector. - The difference vector. - - - Returns the string representation of the current instance using default formatting. - The string representation of the current instance. - - - Returns the string representation of the current instance using the specified format string to format individual elements. - A or that defines the format of individual elements. - The string representation of the current instance. - - - Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. - A or that defines the format of individual elements. - A format provider that supplies culture-specific formatting information. - The string representation of the current instance. - - - Transforms a vector by a specified 4x4 matrix. - The vector to transform. - The transformation matrix. - The transformed vector. - - - Transforms a vector by the specified Quaternion rotation value. - The vector to rotate. - The rotation to apply. - The transformed vector. - - - Transforms a vector normal by the given 4x4 matrix. - The source vector. - The matrix. - The transformed vector. - - - Gets the vector (1,0,0). - The vector (1,0,0). - - - Gets the vector (0,1,0). - The vector (0,1,0).. - - - Gets the vector (0,0,1). - The vector (0,0,1). - - - The X component of the vector. - - - - The Y component of the vector. - - - - The Z component of the vector. - - - - Gets a vector whose 3 elements are equal to zero. - A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). - - - Represents a vector with four single-precision floating-point values. - - - Creates a new object whose four elements have the same value. - The value to assign to all four elements. - - - Constructs a new object from the specified object and a W component. - The vector to use for the X, Y, and Z components. - The W component. - - - Creates a new object from the specified object and a Z and a W component. - The vector to use for the X and Y components. - The Z component. - The W component. - - - Creates a vector whose elements have the specified values. - The value to assign to the field. - The value to assign to the field. - The value to assign to the field. - The value to assign to the field. - - - Returns a vector whose elements are the absolute values of each of the specified vector&#39;s elements. - A vector. - The absolute value vector. - - - Adds two vectors together. - The first vector to add. - The second vector to add. - The summed vector. - - - Restricts a vector between a minimum and a maximum value. - The vector to restrict. - The minimum value. - The maximum value. - The restricted vector. - - - Copies the elements of the vector to a specified array. - The destination array. - array is null. - The number of elements in the current instance is greater than in the array. - array is multidimensional. - - - Copies the elements of the vector to a specified array starting at a specified index position. - The destination array. - The index at which to copy the first element of the vector. - array is null. - The number of elements in the current instance is greater than in the array. - index is less than zero. - -or- - index is greater than or equal to the array length. - array is multidimensional. - - - Computes the Euclidean distance between the two given points. - The first point. - The second point. - The distance. - - - Returns the Euclidean distance squared between two specified points. - The first point. - The second point. - The distance squared. - - - Divides the first vector by the second. - The first vector. - The second vector. - The vector resulting from the division. - - - Divides the specified vector by a specified scalar value. - The vector. - The scalar value. - The vector that results from the division. - - - Returns the dot product of two vectors. - The first vector. - The second vector. - The dot product. - - - Returns a value that indicates whether this instance and another vector are equal. - The other vector. - true if the two vectors are equal; otherwise, false. - - - Returns a value that indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false. - - - Returns the hash code for this instance. - The hash code. - - - Returns the length of this vector object. - The vector&#39;s length. - - - Returns the length of the vector squared. - The vector&#39;s length squared. - - - Performs a linear interpolation between two vectors based on the given weighting. - The first vector. - The second vector. - A value between 0 and 1 that indicates the weight of value2. - The interpolated vector. - - - Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. - The first vector. - The second vector. - The maximized vector. - - - Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. - The first vector. - The second vector. - The minimized vector. - - - Multiplies two vectors together. - The first vector. - The second vector. - The product vector. - - - Multiplies a vector by a specified scalar. - The vector to multiply. - The scalar value. - The scaled vector. - - - Multiplies a scalar value by a specified vector. - The scaled value. - The vector. - The scaled vector. - - - Negates a specified vector. - The vector to negate. - The negated vector. - - - Returns a vector with the same direction as the specified vector, but with a length of one. - The vector to normalize. - The normalized vector. - - - Gets a vector whose 4 elements are equal to one. - Returns . - - - Adds two vectors together. - The first vector to add. - The second vector to add. - The summed vector. - - - Divides the first vector by the second. - The first vector. - The second vector. - The vector that results from dividing left by right. - - - Divides the specified vector by a specified scalar value. - The vector. - The scalar value. - The result of the division. - - - Returns a value that indicates whether each pair of elements in two specified vectors is equal. - The first vector to compare. - The second vector to compare. - true if left and right are equal; otherwise, false. - - - Returns a value that indicates whether two specified vectors are not equal. - The first vector to compare. - The second vector to compare. - true if left and right are not equal; otherwise, false. - - - Multiplies two vectors together. - The first vector. - The second vector. - The product vector. - - - Multiples the specified vector by the specified scalar value. - The vector. - The scalar value. - The scaled vector. - - - Multiples the scalar value by the specified vector. - The vector. - The scalar value. - The scaled vector. - - - Subtracts the second vector from the first. - The first vector. - The second vector. - The vector that results from subtracting right from left. - - - Negates the specified vector. - The vector to negate. - The negated vector. - - - Returns a vector whose elements are the square root of each of a specified vector&#39;s elements. - A vector. - The square root vector. - - - Subtracts the second vector from the first. - The first vector. - The second vector. - The difference vector. - - - Returns the string representation of the current instance using default formatting. - The string representation of the current instance. - - - Returns the string representation of the current instance using the specified format string to format individual elements. - A or that defines the format of individual elements. - The string representation of the current instance. - - - Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. - A or that defines the format of individual elements. - A format provider that supplies culture-specific formatting information. - The string representation of the current instance. - - - Transforms a four-dimensional vector by the specified Quaternion rotation value. - The vector to rotate. - The rotation to apply. - The transformed vector. - - - Transforms a four-dimensional vector by a specified 4x4 matrix. - The vector to transform. - The transformation matrix. - The transformed vector. - - - Transforms a three-dimensional vector by the specified Quaternion rotation value. - The vector to rotate. - The rotation to apply. - The transformed vector. - - - Transforms a two-dimensional vector by a specified 4x4 matrix. - The vector to transform. - The transformation matrix. - The transformed vector. - - - Transforms a two-dimensional vector by the specified Quaternion rotation value. - The vector to rotate. - The rotation to apply. - The transformed vector. - - - Transforms a three-dimensional vector by a specified 4x4 matrix. - The vector to transform. - The transformation matrix. - The transformed vector. - - - Gets the vector (0,0,0,1). - The vector (0,0,0,1). - - - Gets the vector (1,0,0,0). - The vector (1,0,0,0). - - - Gets the vector (0,1,0,0). - The vector (0,1,0,0).. - - - Gets a vector whose 4 elements are equal to zero. - The vector (0,0,1,0). - - - The W component of the vector. - - - - The X component of the vector. - - - - The Y component of the vector. - - - - The Z component of the vector. - - - - Gets a vector whose 4 elements are equal to zero. - A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). - - - \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.xml.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.xml.meta deleted file mode 100644 index 8f9b4dda..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Numerics.Vectors.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6071e4c33784d45738202535a1484d2d -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.dll deleted file mode 100644 index c5ba4e40..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.dll.meta deleted file mode 100644 index c41cbecd..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 25348f08448a048959da2d2d9feec78a -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.xml b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.xml deleted file mode 100644 index 9d794922..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - - System.Runtime.CompilerServices.Unsafe - - - - Contains generic, low-level functionality for manipulating pointers. - - - Adds an element offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of offset to pointer. - - - Adds an element offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of offset to pointer. - - - Adds an element offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of offset to pointer. - - - Adds an element offset to the given void pointer. - The void pointer to add the offset to. - The offset to add. - The type of void pointer. - A new void pointer that reflects the addition of offset to the specified pointer. - - - Adds a byte offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of byte offset to pointer. - - - Adds a byte offset to the given reference. - The reference to add the offset to. - The offset to add. - The type of reference. - A new reference that reflects the addition of byte offset to pointer. - - - Determines whether the specified references point to the same location. - The first reference to compare. - The second reference to compare. - The type of reference. - - if and point to the same location; otherwise, . - - - Casts the given object to the specified type. - The object to cast. - The type which the object will be cast to. - The original object, casted to the given type. - - - Reinterprets the given reference as a reference to a value of type . - The reference to reinterpret. - The type of reference to reinterpret. - The desired type of the reference. - A reference to a value of type . - - - Returns a pointer to the given by-ref parameter. - The object whose pointer is obtained. - The type of object. - A pointer to the given value. - - - Reinterprets the given read-only reference as a reference. - The read-only reference to reinterpret. - The type of reference. - A reference to a value of type . - - - Reinterprets the given location as a reference to a value of type . - The location of the value to reference. - The type of the interpreted location. - A reference to a value of type . - - - Determines the byte offset from origin to target from the given references. - The reference to origin. - The reference to target. - The type of reference. - Byte offset from origin to target i.e. - . - - - Copies a value of type to the given location. - The location to copy to. - A pointer to the value to copy. - The type of value to copy. - - - Copies a value of type to the given location. - The location to copy to. - A reference to the value to copy. - The type of value to copy. - - - Copies bytes from the source address to the destination address. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Copies bytes from the source address to the destination address. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Copies bytes from the source address to the destination address without assuming architecture dependent alignment of the addresses. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Copies bytes from the source address to the destination address without assuming architecture dependent alignment of the addresses. - The destination address to copy to. - The source address to copy from. - The number of bytes to copy. - - - Initializes a block of memory at the given location with a given initial value. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Initializes a block of memory at the given location with a given initial value. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Initializes a block of memory at the given location with a given initial value without assuming architecture dependent alignment of the address. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Initializes a block of memory at the given location with a given initial value without assuming architecture dependent alignment of the address. - The address of the start of the memory block to initialize. - The value to initialize the block to. - The number of bytes to initialize. - - - Returns a value that indicates whether a specified reference is greater than another specified reference. - The first value to compare. - The second value to compare. - The type of the reference. - - if is greater than ; otherwise, . - - - Returns a value that indicates whether a specified reference is less than another specified reference. - The first value to compare. - The second value to compare. - The type of the reference. - - if is less than ; otherwise, . - - - Determines if a given reference to a value of type is a null reference. - The reference to check. - The type of the reference. - - if is a null reference; otherwise, . - - - Returns a reference to a value of type that is a null reference. - The type of the reference. - A reference to a value of type that is a null reference. - - - Reads a value of type from the given location. - The location to read from. - The type to read. - An object of type read from the given location. - - - Reads a value of type from the given location without assuming architecture dependent alignment of the addresses. - The location to read from. - The type to read. - An object of type read from the given location. - - - Reads a value of type from the given location without assuming architecture dependent alignment of the addresses. - The location to read from. - The type to read. - An object of type read from the given location. - - - Returns the size of an object of the given type parameter. - The type of object whose size is retrieved. - The size of an object of type . - - - Bypasses definite assignment rules for a given value. - The uninitialized object. - The type of the uninitialized object. - - - Subtracts an element offset from the given reference. - The reference to subtract the offset from. - The offset to subtract. - The type of reference. - A new reference that reflects the subtraction of offset from pointer. - - - Subtracts an element offset from the given reference. - The reference to subtract the offset from. - The offset to subtract. - The type of reference. - A new reference that reflects the subtraction of offset from pointer. - - - Subtracts an element offset from the given reference. - The reference to subtract the offset from. - The offset to subtract. - The type of reference. - A new reference that reflects the subraction of offset from pointer. - - - Subtracts an element offset from the given void pointer. - The void pointer to subtract the offset from. - The offset to subtract. - The type of the void pointer. - A new void pointer that reflects the subtraction of offset from the specified pointer. - - - Subtracts a byte offset from the given reference. - The reference to subtract the offset from. - The offset to subtract. - The type of reference. - A new reference that reflects the subtraction of byte offset from pointer. - - - Subtracts a byte offset from the given reference. - The reference to subtract the offset from. - The offset to subtract. - The type of reference. - A new reference that reflects the subraction of byte offset from pointer. - - - Returns a to a boxed value. - The value to unbox. - The type to be unboxed. - - is , and is a non-nullable value type. - - is not a boxed value type. - --or- - - is not a boxed . - - cannot be found. - A to the boxed value . - - - Writes a value of type to the given location. - The location to write to. - The value to write. - The type of value to write. - - - Writes a value of type to the given location without assuming architecture dependent alignment of the addresses. - The location to write to. - The value to write. - The type of value to write. - - - Writes a value of type to the given location without assuming architecture dependent alignment of the addresses. - The location to write to. - The value to write. - The type of value to write. - - - \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.xml.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.xml.meta deleted file mode 100644 index 699881f2..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Runtime.CompilerServices.Unsafe.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: db6ede2adb6e14618959b2fe9281bdfa -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.dll b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.dll deleted file mode 100644 index 09fc6802..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.dll and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.dll.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.dll.meta deleted file mode 100644 index 216dc595..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.dll.meta +++ /dev/null @@ -1,46 +0,0 @@ -fileFormatVersion: 2 -guid: 9f63d81fdec6f499bab68427df82edf1 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.xml b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.xml deleted file mode 100644 index 29222284..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - System.Text.Encoding.CodePages - - - - Provides access to an encoding provider for code pages that otherwise are available only in the desktop .NET Framework. - - - Returns the encoding associated with the specified code page identifier. - The code page identifier of the preferred encoding which the encoding provider may support. - The encoding associated with the specified code page identifier, or if the provider does not support the requested codepage encoding. - - - Returns the encoding associated with the specified code page name. - The code page name of the preferred encoding which the encoding provider may support. - The encoding associated with the specified code page, or if the provider does not support the requested encoding. - - - Returns an array that contains all the encodings that are supported by the . - An array that contains all the supported encodings. - - - Gets an encoding provider for code pages supported in the desktop .NET Framework but not in the current .NET Framework platform. - An encoding provider that allows access to encodings not supported on the current .NET Framework platform. - - - \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.xml.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.xml.meta deleted file mode 100644 index 10b36f10..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/System.Text.Encoding.CodePages.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 20ba24933917942cf9224f82d9e17109 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.config b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.config deleted file mode 100644 index be5f2af9..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.config.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.config.meta deleted file mode 100644 index 55566f6b..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.config.meta +++ /dev/null @@ -1,40 +0,0 @@ -fileFormatVersion: 2 -guid: 283582e0fcd16ed409f749e6d7f169a2 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.meta deleted file mode 100644 index ddbc981c..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 080a33cc99a93e04f919698d4ba695dd -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/WXTextureEditorWindow.cs b/Assets/WX-WASM-SDK/Editor/TextureEditor/WXTextureEditorWindow.cs deleted file mode 100644 index 8389c287..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/WXTextureEditorWindow.cs +++ /dev/null @@ -1,496 +0,0 @@ -using UnityEngine; -using System.Collections; -using UnityEditor; -using System.IO; -using System.Collections.Generic; -using LitJson; -using System.Text; -using System.Linq; -using System; - -namespace WeChatWASM -{ - - - public class WXReplaceTextureData - { - public string path; - public int width; - public int height; - } - - public class WXBundlePicDepsData - { - public string bundlePath; - public List pics; - public bool isCached; - } - - public class WXFileCachedData - { - public string filePath; - public string md5; - } - - - public class JSTextureTaskConf - { - public string dst; - public string dataPath; - public bool useDXT5; - public List textureList; - } - - public class JSTextureData { - public string p; - public int w; - public int h; - } - - public class WXTextureFileCacheScriptObject - { - public int Version; - public DateTime UpdateTime; - public int CostTimeInSeconds; - public List cachedDatas = new List(); - } - - public class WXTextureReplacerScriptObject - { - public int Version; - public DateTime UpdateTime; - public List bundlePicDeps = new List(); - } - - public class WXTextureEditorWindow : EditorWindow - { - public static WXEditorScriptObject miniGameConf; - - [MenuItem("微信小游戏 / 包体瘦身--压缩纹理")] - public static void Open() - { - miniGameConf = UnityUtil.GetEditorConf(); - var win = GetWindow(typeof(WXTextureEditorWindow), false, "包体瘦身--压缩纹理", true);//创建窗口 - win.minSize = new Vector2(600, 380); - win.maxSize = new Vector2(600, 380); - win.Show(); - } - - public static void Log(string type,string msg) { - - if (type == "Error") { - UnityEngine.Debug.LogError(msg); - } else if (type == "Log") { - UnityEngine.Debug.Log(msg); - } else if (type == "Warn") { - UnityEngine.Debug.LogWarning(msg); - } - - } - - private static WXTextureReplacerScriptObject GetTextureEditorCacheConf() - { - var BundlePicsFilePath = Path.Combine(GetDestDir(), "BundlePicsFile.json"); - string BundlePicsFileJson = ""; - if (File.Exists(BundlePicsFilePath)) - { - using (FileStream fileStream = new FileStream(BundlePicsFilePath, FileMode.Open, FileAccess.Read)) - { - using (StreamReader reader = new StreamReader(fileStream)) - { - BundlePicsFileJson = reader.ReadToEnd(); - } - } - } - WXTextureReplacerScriptObject wXTextureReplacerScriptObject = JsonMapper.ToObject(BundlePicsFileJson); - Dictionary> cacheMap = new Dictionary>(); - if (wXTextureReplacerScriptObject == null) wXTextureReplacerScriptObject = new WXTextureReplacerScriptObject(); - if (wXTextureReplacerScriptObject.bundlePicDeps == null) wXTextureReplacerScriptObject.bundlePicDeps = new List(); - return wXTextureReplacerScriptObject; - } - - public static void CreateJSTask() - { - - WXTextureReplacerScriptObject wXTextureReplacerScriptObject = GetTextureEditorCacheConf(); - List list = new List(); - Dictionary> cacheMap = new Dictionary>(); - foreach (var item in wXTextureReplacerScriptObject.bundlePicDeps) - { - if(item.pics == null) - { - continue; - } - list = list.Union(item.pics).ToList(); - cacheMap.Add(item.bundlePath, item.pics); - } - var conf = new JSTextureTaskConf() - { - dst = GetDestDir(), - dataPath = Application.dataPath, - useDXT5 = miniGameConf.CompressTexture.useDXT5, - textureList = list, - }; - - File.WriteAllText(Application.dataPath + "/WX-WASM-SDK/Editor/Node/conf.js", "module.exports = " + JsonMapper.ToJson(conf)); - - UnityEngine.Debug.LogError($"最后一步请安装 Nodejs 然后进入{Application.dataPath}/WX-WASM-SDK/Editor/Node 目录用命令行,执行 ’node compress_astc_only.js‘ (开发阶段使用) 或 ’node compress_all.js‘(上线时候使用) 命令来生成纹理。"); - - ModifiyJsFile(cacheMap); - } - - public static void ModifiyJsFile(Dictionary> picDeps) { - - - //修改使用纹理dxt - string content = File.ReadAllText(Path.Combine(Application.dataPath, "WX-WASM-SDK", "wechat-default", "unity-sdk", "texture.js"), Encoding.UTF8); - - content = content.Replace("\"$UseDXT5$\"", miniGameConf.CompressTexture.useDXT5 ? "true" : "false"); - - File.WriteAllText(Path.Combine(miniGameConf.ProjectConf.DST, "minigame", "unity-sdk", "texture.js"), content, Encoding.UTF8); - - Dictionary> picDepsShort = new Dictionary>(); - foreach(var item in picDeps) - { - if (item.Key != "unity_default_resources") - { - var list = new List(); - if (item.Value == null) { - continue; - } - foreach (var data in item.Value) { - list.Add(new JSTextureData() - { - h = data.height, - w = data.width, - p = data.path - }); - } - picDepsShort.Add(item.Key,list); - } - } - - var textureConfigPath = Path.Combine(miniGameConf.ProjectConf.DST, "minigame", "texture-config.js"); - - if (miniGameConf.CompressTexture.parallelWithBundle) - { - - File.WriteAllText(textureConfigPath, "GameGlobal.USED_TEXTURE_COMPRESSION=true;GameGlobal.TEXTURE_PARALLEL_BUNDLE=true;GameGlobal.TEXTURE_BUNDLES = " + JsonMapper.ToJson(picDepsShort) , Encoding.UTF8); - } - else - { - File.WriteAllText(textureConfigPath, "GameGlobal.USED_TEXTURE_COMPRESSION=true;GameGlobal.TEXTURE_PARALLEL_BUNDLE=false;GameGlobal.TEXTURE_BUNDLES = ''", Encoding.UTF8); - } - - - } - - public static string GetDestDir() { - var dstDir = miniGameConf.ProjectConf.DST + "/webgl-min"; - if (!string.IsNullOrEmpty(miniGameConf.CompressTexture.dstMinDir)) - { - dstDir = miniGameConf.CompressTexture.dstMinDir; - } - return dstDir; - } - - public static void ReplaceBundle() - { - - if (string.IsNullOrEmpty(miniGameConf.CompressTexture.bundleSuffix)) { - UnityEngine.Debug.LogError("bundle后缀不能为空!"); - return; - } - if (string.IsNullOrEmpty(miniGameConf.ProjectConf.DST)) { - UnityEngine.Debug.LogError("请先转换为小游戏!"); - return; - } - if (!File.Exists(miniGameConf.ProjectConf.DST+"/webgl/index.html")) { - UnityEngine.Debug.LogError("请先转换为小游戏!并确保导出目录下存在webgl目录!"); - return; - } - UnityEngine.Debug.Log("Start! 【" + System.DateTime.Now.ToString("T") + "】"); - - var dstDir = GetDestDir(); - var dstTexturePath = dstDir + "/Assets/Textures"; - var sourceDir = miniGameConf.ProjectConf.DST + "/webgl"; - - var path = ""; - var exePath = Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe"); - var classDataPath = Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/TextureEditor/classdata.tpk"); - var bundlePathArg = string.IsNullOrEmpty(miniGameConf.CompressTexture.bundleDir) ? "" : $" -bd {miniGameConf.CompressTexture.bundleDir}"; -#if UNITY_EDITOR_OSX - var monoPath = Path.Combine(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Unity.app/Contents/MonoBleedingEdge/bin/mono"); - Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe"); - WeChatWASM.UnityUtil.RunCmd(monoPath, string.Format($" {exePath} -b {miniGameConf.CompressTexture.bundleSuffix} " + - $" -d {dstDir}" + - $" -dt {dstTexturePath}" + - $" -s {sourceDir}" + - $" -c {classDataPath}" + - $" {bundlePathArg}"), path, - (current, total, extInfo) => { - EditorUtility.DisplayProgressBar($"TextureMin Bundle处理中,当前:{current},总共:{total}", $"Handling:{extInfo}", current * 1.0f / total); - }); - EditorUtility.ClearProgressBar(); -#else - exePath = Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/TextureEditor/Release/WXTextureMin.exe"); - WeChatWASM.UnityUtil.RunCmd(exePath, string.Format($" -b {miniGameConf.CompressTexture.bundleSuffix} " + - $" -d {dstDir}" + - $" -dt {dstTexturePath}" + - $" -s {sourceDir}" + - $" -c {classDataPath}" + - $" {bundlePathArg}"), path, - (current, total, extInfo) => { - EditorUtility.DisplayProgressBar($"TextureMin Bundle处理中,当前:{current},总共:{total}", $"Handling:{extInfo}", current * 1.0f / total); - }); - EditorUtility.ClearProgressBar(); -#endif - - - - - - OnReplaceEnd(); - } - - private static void OnReplaceEnd() { - - CreateJSTask(); - - - if (miniGameConf.ProjectConf.assetLoadType == 1) - { - - DirectoryInfo TheFolder = new DirectoryInfo(miniGameConf.ProjectConf.DST + "/minigame/data-package/"); - var dstDataFiles = TheFolder.GetFiles("*.txt"); - if (dstDataFiles.Length != 1) - { - Debug.LogError("目录minigame/data-package/无法找到data首资源文件, 无法进行首资源包替换"); - return; - } - var dstDataFile = dstDataFiles[0].FullName; - var sourceDataFile = Path.Combine(GetDestDir(), Path.GetFileName(dstDataFile)); - if (!File.Exists(sourceDataFile)) - { - Debug.LogError($"sourceDataFile not exist {sourceDataFile}"); - return; - } - File.Delete(dstDataFile); - File.Copy(sourceDataFile, dstDataFile); - - } - // 替换资源文件后更新文件大小 - // var info = new FileInfo(sourceDataFile); - // var oldSize = WXEditorWindow.GetWindow().dataFileSize; - // var newSize = info.Length.ToString(); - // string[] files = {"game.js"}; - // Rule[] rules = { - // new Rule() { - // old="DATA_FILE_SIZE: \"" + oldSize + "\"", - // newStr="DATA_FILE_SIZE: \"" + newSize + "\"" - // } - // }; - // WXEditorWindow.GetWindow().ReplaceFileContent(files, rules); - - UnityEngine.Debug.Log("Done! 【" + System.DateTime.Now.ToString("T") + "】"); - } - - private void OnDisable() - { - EditorUtility.SetDirty(miniGameConf); - } - - private void OnEnable() - { - miniGameConf = UnityUtil.GetEditorConf(); - } - - private void OnGUI() - { - - var labelStyle = new GUIStyle(EditorStyles.boldLabel); - labelStyle.fontSize = 14; - - labelStyle.margin.left = 20; - labelStyle.margin.top = 10; - labelStyle.margin.bottom = 10; - - GUILayout.Label("基本设置", labelStyle); - - var inputStyle = new GUIStyle(EditorStyles.textField); - inputStyle.fontSize = 14; - inputStyle.margin.left = 20; - inputStyle.margin.bottom = 10; - inputStyle.margin.right = 20; - - GUIStyle toggleStyle = new GUIStyle(GUI.skin.toggle); - toggleStyle.margin.left = 20; - toggleStyle.margin.right = 20; - - miniGameConf.CompressTexture.bundleSuffix = EditorGUILayout.TextField(new GUIContent("bunlde文件后缀(?)", "多个不同后缀可用;分割开来"),miniGameConf.CompressTexture.bundleSuffix, inputStyle); - - GUILayout.Label(new GUIContent("功能选项(?)", "每次变更了下列选项都需要重新发布小游戏包"), labelStyle); - GUILayout.BeginHorizontal(); - - var labelStyle2 = new GUIStyle(EditorStyles.label); - - labelStyle2.margin.left = 20; - GUILayout.Label(new GUIContent("支持PC端压缩纹理(?)", "使PC微信也支持压缩纹理,不过会在开发阶段增加纹理生成耗时。"), labelStyle2, GUILayout.Height(22), GUILayout.Width(150)); - - miniGameConf.CompressTexture.useDXT5 = GUILayout.Toggle(miniGameConf.CompressTexture.useDXT5, "", GUILayout.Height(22), GUILayout.Width(50)); - - GUILayout.Label(new GUIContent("纹理与bundle并行加载(?)", "默认纹理是解析bundle后才加载,勾选后加载bundle时bundle对应纹理就会同时加载。"), labelStyle2, GUILayout.Height(22), GUILayout.Width(150)); - - miniGameConf.CompressTexture.parallelWithBundle = GUILayout.Toggle(miniGameConf.CompressTexture.parallelWithBundle, "", GUILayout.Height(22), GUILayout.Width(50)); - - GUILayout.EndHorizontal(); - - GUILayout.Label(new GUIContent("自定义目录(?)", "默认不用选择"), labelStyle); - - var labelStyle3 = new GUIStyle(EditorStyles.boldLabel); - labelStyle3.fontSize = 12; - - labelStyle3.margin.left = 20; - labelStyle3.margin.top = 10; - labelStyle3.margin.bottom = 10; - - GUILayout.Label("bundle路径", labelStyle3); - - var chooseBundlePathButtonClicked = false; - var openBundleButtonClicked = false; - var resetBundleButtonClicked = false; - - int pathButtonHeight = 28; - GUIStyle pathLabelStyle = new GUIStyle(GUI.skin.textField); - pathLabelStyle.fontSize = 12; - pathLabelStyle.alignment = TextAnchor.MiddleLeft; - pathLabelStyle.margin.top = 6; - pathLabelStyle.margin.bottom = 6; - pathLabelStyle.margin.left = 20; - - if (string.IsNullOrEmpty(miniGameConf.CompressTexture.bundleDir)) - { - GUIStyle pathButtonStyle2 = new GUIStyle(GUI.skin.button); - pathButtonStyle2.fontSize = 12; - pathButtonStyle2.margin.left = 20; - - chooseBundlePathButtonClicked = GUILayout.Button("选择自定义bundle路径,默认不用选", pathButtonStyle2, GUILayout.Height(30), GUILayout.Width(300)); - } - else - { - GUILayout.BeginHorizontal(); - // 路径框 - GUILayout.Label(miniGameConf.CompressTexture.bundleDir, pathLabelStyle, GUILayout.Height(pathButtonHeight - 6), GUILayout.ExpandWidth(true), GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 126)); - openBundleButtonClicked = GUILayout.Button("打开", GUILayout.Height(pathButtonHeight), GUILayout.Width(40)); - resetBundleButtonClicked = GUILayout.Button("重选", GUILayout.Height(pathButtonHeight), GUILayout.Width(40)); - GUILayout.EndHorizontal(); - } - EditorGUILayout.Space(); - - - if (chooseBundlePathButtonClicked) - { - // 弹出选目录窗口 - var dstPath = EditorUtility.SaveFolderPanel("选择你的bundle目录", "", ""); - - if (dstPath != "") - { - miniGameConf.CompressTexture.bundleDir = dstPath; - } - - } - - if (openBundleButtonClicked) - { - UnityUtil.ShowInExplorer(miniGameConf.CompressTexture.bundleDir); - } - if (resetBundleButtonClicked) - { - miniGameConf.CompressTexture.bundleDir = ""; - } - - - - GUILayout.Label("自定义资源处理后存放路径", labelStyle3); - - var chooseDstPathButtonClicked = false; - var openDstButtonClicked = false; - var resetDstButtonClicked = false; - - - if (string.IsNullOrEmpty(miniGameConf.CompressTexture.dstMinDir)) - { - GUIStyle pathButtonStyle2 = new GUIStyle(GUI.skin.button); - pathButtonStyle2.fontSize = 12; - pathButtonStyle2.margin.left = 20; - - chooseDstPathButtonClicked = GUILayout.Button("选择自定义资源处理后存放路径,默认不用选", pathButtonStyle2, GUILayout.Height(30), GUILayout.Width(300)); - } - else - { - GUILayout.BeginHorizontal(); - // 路径框 - GUILayout.Label(miniGameConf.CompressTexture.dstMinDir, pathLabelStyle, GUILayout.Height(pathButtonHeight - 6), GUILayout.ExpandWidth(true), GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 126)); - openDstButtonClicked = GUILayout.Button("打开", GUILayout.Height(pathButtonHeight), GUILayout.Width(40)); - resetDstButtonClicked = GUILayout.Button("重选", GUILayout.Height(pathButtonHeight), GUILayout.Width(40)); - GUILayout.EndHorizontal(); - } - EditorGUILayout.Space(); - - - if (chooseDstPathButtonClicked) - { - // 弹出选目录窗口 - var dstPath = EditorUtility.SaveFolderPanel("选择你的自定义资源处理后存放路径", "", ""); - - if (dstPath != "") - { - miniGameConf.CompressTexture.dstMinDir = dstPath; - } - - } - - if (openDstButtonClicked) - { - UnityUtil.ShowInExplorer(miniGameConf.CompressTexture.dstMinDir); - } - if (resetDstButtonClicked) - { - miniGameConf.CompressTexture.dstMinDir = ""; - } - - - - - GUILayout.Label("操作", labelStyle); - - GUIStyle pathButtonStyle = new GUIStyle(GUI.skin.button); - pathButtonStyle.fontSize = 12; - pathButtonStyle.margin.left = 20; - pathButtonStyle.margin.right = 20; - - EditorGUILayout.BeginHorizontal(); - - - var replaceTexture = GUILayout.Button(new GUIContent("处理资源(?)", "处理完成后会在导出目录生成webgl-min目录,bundle文件要换成使用webgl-min目录下的bundle文件,xx.webgl.data.unityweb.bin.txt文件也要换成使用webgl-min目录下对应的文件,注意要将导出目录里面Assets目录下的都上传至CDN对应路径,小游戏里才会显示成正常的压缩纹理。注意bundle文件不能开启crc校验,否则会展示异常。"), pathButtonStyle, GUILayout.Height(40), GUILayout.Width(140)); - - - var goReadMe = GUILayout.Button(new GUIContent("README"), pathButtonStyle, GUILayout.Height(40), GUILayout.Width(80)); - - EditorGUILayout.EndHorizontal(); - - if (replaceTexture) - { - ReplaceBundle(); - } - - if (goReadMe) - { - Application.OpenURL("https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/blob/main/Design/CompressedTexture.md"); - } - - } - - } - -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/WXTextureEditorWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/WXTextureEditorWindow.cs.meta deleted file mode 100644 index a73a8bd2..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/WXTextureEditorWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8eef393830c294a8594fb794afe03957 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/classdata.tpk b/Assets/WX-WASM-SDK/Editor/TextureEditor/classdata.tpk deleted file mode 100644 index 9dffb20a..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/TextureEditor/classdata.tpk and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/TextureEditor/classdata.tpk.meta b/Assets/WX-WASM-SDK/Editor/TextureEditor/classdata.tpk.meta deleted file mode 100644 index f45128aa..00000000 --- a/Assets/WX-WASM-SDK/Editor/TextureEditor/classdata.tpk.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 7effdffff4ef64cc1855f2f1ab492810 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/UnityUtil.cs b/Assets/WX-WASM-SDK/Editor/UnityUtil.cs deleted file mode 100644 index 9e34af39..00000000 --- a/Assets/WX-WASM-SDK/Editor/UnityUtil.cs +++ /dev/null @@ -1,291 +0,0 @@ -using System; -using System.IO; -using System.Security.Cryptography; -using System.Text; -using UnityEditor; -using UnityEngine; - -namespace WeChatWASM -{ - /** - * 工具函数 - */ - public class UnityUtil - { - private static bool IsInMacOS - { - get - { - return UnityEngine.SystemInfo.operatingSystem.IndexOf("Mac OS") != -1; - } - } - - private static bool IsInWinOS - { - get - { - return UnityEngine.SystemInfo.operatingSystem.IndexOf("Windows") != -1; - } - } - - private static void OpenInMac(string path) - { - bool openInsidesOfFolder = false; - - // try mac - string macPath = path.Replace("\\", "/"); // mac finder doesn't like backward slashes - - if (Directory.Exists(macPath)) // if path requested is a folder, automatically open insides of that folder - { - openInsidesOfFolder = true; - } - - if (!macPath.StartsWith("\"")) - { - macPath = "\"" + macPath; - } - - if (!macPath.EndsWith("\"")) - { - macPath = macPath + "\""; - } - - string arguments = (openInsidesOfFolder ? "" : "-R ") + macPath; - - try - { - System.Diagnostics.Process.Start("open", arguments); - } - catch (System.ComponentModel.Win32Exception e) - { - // tried to open mac finder in windows - // just silently skip error - // we currently have no platform define for the current OS we are in, so we resort to this - e.HelpLink = ""; // do anything with this variable to silence warning about not using it - } - } - - private static void OpenInWin(string path) - { - bool openInsidesOfFolder = false; - - // try windows - string winPath = path.Replace("/", "\\"); // windows explorer doesn't like forward slashes - - if (Directory.Exists(winPath)) // if path requested is a folder, automatically open insides of that folder - { - openInsidesOfFolder = true; - } - - try - { - System.Diagnostics.Process.Start("explorer.exe", (openInsidesOfFolder ? "/root," : "/select,") + winPath); - } - catch (System.ComponentModel.Win32Exception e) - { - // tried to open win explorer in mac - // just silently skip error - // we currently have no platform define for the current OS we are in, so we resort to this - e.HelpLink = ""; // do anything with this variable to silence warning about not using it - } - } - - public static void ShowInExplorer(string path) - { - if (IsInWinOS) - { - OpenInWin(path); - } - else if (IsInMacOS) - { - OpenInMac(path); - } - else // couldn't determine OS - { - OpenInWin(path); - OpenInMac(path); - } - } - - public static string GetMd5Str(string ConvertString) - { - MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); - string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString)), 4, 8); - t2 = t2.Replace("-", ""); - - t2 = t2.ToLower(); - - return t2; - } - - public static string GetMd5Str(byte[] bytes) - { - MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); - string t2 = BitConverter.ToString(md5.ComputeHash(bytes), 4, 8); - t2 = t2.Replace("-", ""); - - t2 = t2.ToLower(); - - return t2; - } - - public static string BuildFileMd5(string filename, int length = 16) - { - string filemd5 = null; - try - { - var fileStream = File.OpenRead(filename); - var md5 = MD5.Create(); - var fileMD5Bytes = md5.ComputeHash(fileStream);//计算指定Stream 对象的哈希值 - filemd5 = BitConverter.ToString(fileMD5Bytes).Replace("-", "").ToLower(); - fileStream.Close(); - - } - catch (Exception ex) - { - Debug.LogError(ex); - } - return filemd5.Substring(8, length); - } - - public static void DelectDir(string srcPath) - { - if (!Directory.Exists(srcPath)) - { - return; - } - try - { - DirectoryInfo dir = new DirectoryInfo(srcPath); - FileSystemInfo[] fileinfo = dir.GetFileSystemInfos(); //返回目录中所有文件和子目录 - - foreach (FileSystemInfo i in fileinfo) - { - if (i is DirectoryInfo) //判断是否文件夹 - { - DirectoryInfo subdir = new DirectoryInfo(i.FullName); - subdir.Delete(true); //删除子目录和文件 - } - else - { //如果 使用了 streamreader 在删除前 必须先关闭流 ,否则无法删除 sr.close(); - File.Delete(i.FullName); //删除指定文件 - } - } - } - catch (Exception e) - { - throw e; - } - } - - public static void CreateDir(string srcPath) - { - - if (!Directory.Exists(srcPath)) - { - DirectoryInfo dir = new DirectoryInfo(srcPath); - CreateDir(dir.Parent.ToString()); - Directory.CreateDirectory(srcPath); - } - return; - } - - public static void CopyDir(string srcPath, string destPath) - { - if (!Directory.Exists(srcPath)) - { - return; - } - DirectoryInfo dir = new DirectoryInfo(srcPath); - FileSystemInfo[] fileinfo = dir.GetFileSystemInfos(); //获取目录下(不包含子目录)的文件和子目录 - foreach (FileSystemInfo i in fileinfo) - { - if (i is DirectoryInfo) //判断是否文件夹 - { - if (!Directory.Exists(destPath + "/" + i.Name)) - { - Directory.CreateDirectory(destPath + "/" + i.Name); //目标目录下不存在此文件夹即创建子文件夹 - } - CopyDir(i.FullName, destPath + "/" + i.Name); //递归调用复制子文件夹 - } - else - { - File.Copy(i.FullName, destPath + "/" + i.Name, true); //不是文件夹即复制文件,true表示可以覆盖同名文件 - File.Delete(i.FullName); - } - } - } - - public static WXEditorScriptObject GetEditorConf() - { - var path = "Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset"; - var config = AssetDatabase.LoadAssetAtPath(path, typeof(WXEditorScriptObject)) as WXEditorScriptObject; - if (config == null) - { - AssetDatabase.CreateAsset(EditorWindow.CreateInstance(), path); - config = AssetDatabase.LoadAssetAtPath(path, typeof(WXEditorScriptObject)) as WXEditorScriptObject; - } - return config; - } - - public static void RunCmd(string cmd, string args, string workdir = null, Action progressUpdate = null) - { - Debug.Log($"RunCmd {cmd} {args}"); - var p = CreateCmdProcess(cmd, args, workdir); - - while (!p.StandardOutput.EndOfStream) - { - string line = p.StandardOutput.ReadLine(); - if (line.StartsWith("#WXTextureMinProgress#")) - { - var aProgress = line.Split('#'); - if (aProgress.Length < 5) - { - Debug.LogError($"{line} invalid!"); - continue; - } - if (progressUpdate != null) - { - //0:"" - //1:WXTextureMinProgress - //2:curent - //3:total - //4:extInfo - int current, total = 1; - int.TryParse(aProgress[2], out current); - int.TryParse(aProgress[3], out total); - progressUpdate(current, total, aProgress[4]); - } - } - else - { - Debug.Log(line); - } - } - var err = p.StandardError.ReadToEnd(); - if (!string.IsNullOrEmpty(err)) - { - Debug.LogError(err); - } - p.Close(); - } - - public static System.Diagnostics.Process CreateCmdProcess(string cmd, string args, string workdir = null) - { - var pStartInfo = new System.Diagnostics.ProcessStartInfo(cmd); - pStartInfo.Arguments = args; - pStartInfo.CreateNoWindow = true; - pStartInfo.UseShellExecute = false; - pStartInfo.RedirectStandardError = true; - pStartInfo.RedirectStandardInput = true; - pStartInfo.RedirectStandardOutput = true; - pStartInfo.StandardErrorEncoding = System.Text.UTF8Encoding.UTF8; - pStartInfo.StandardOutputEncoding = System.Text.UTF8Encoding.UTF8; - if (!string.IsNullOrEmpty(workdir)) - pStartInfo.WorkingDirectory = workdir; - return System.Diagnostics.Process.Start(pStartInfo); - } - - } - -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Editor/UnityUtil.cs.meta b/Assets/WX-WASM-SDK/Editor/UnityUtil.cs.meta deleted file mode 100644 index 2cfff6c0..00000000 --- a/Assets/WX-WASM-SDK/Editor/UnityUtil.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 01167ebf5cba252429d2bb9a704fcfd0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/WXEditorScriptObject.cs b/Assets/WX-WASM-SDK/Editor/WXEditorScriptObject.cs deleted file mode 100644 index 8a5ed352..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXEditorScriptObject.cs +++ /dev/null @@ -1,226 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections.Generic; -using System.Collections; - -namespace WeChatWASM -{ - - [Serializable] - public class WXProjectConf - { - /// - /// 小游戏项目名 - /// - public string projectName; - /// - /// 游戏appid - /// - public string Appid; - /// - /// 游戏资源CDN - /// - public string CDN; - /// - /// 首包资源加载方式 - /// - public int assetLoadType; - /// - /// 视频url - /// - public string VideoUrl; - /// - /// 导出路径(绝对路径) - /// - public string DST = ""; - /// - /// AB包CDN地址 - /// - public string StreamCDN = ""; - /// - /// bundle的hash长度 - /// - public int bundleHashLength = 32; - /// - /// 路径中包含什么标识符表示下载bundle,需要自动缓存 - /// - public string bundlePathIdentifier = "StreamingAssets;"; - /// - /// 排除路径下指定类型文件不缓存 - /// - public string bundleExcludeExtensions = "json;"; - /// - /// Assets目录对应CDN地址 - /// - public string AssetsUrl = ""; - - /// - /// 游戏内存大小(MB) - /// - public int MemorySize = 256; - - /// - /// callmain完成后是否立即隐藏加载封面 - /// - public bool HideAfterCallMain = true; - - /// - /// 预下载列表 - /// - public string preloadFiles = ""; - - /// - /// 游戏方向 - /// - public WXScreenOritation Orientation = WXScreenOritation.Portrait; - - /// - /// 启动视频封面图/背景图 - /// - public string bgImageSrc = "Assets/WX-WASM-SDK/wechat-default/images/background.jpg"; - - /// - /// 拼接在DATA_CDN和首包资源文件名的路径,用于首包资源没放到DATA_CDN根目录的情况 - /// - public string dataFileSubPrefix = ""; - - /// - /// 最大缓存容量,单位MB - /// - public int maxStorage = 200; - - /// - /// 清理缓存时默认额外清理的大小,单位Bytes,默认值30MB - /// - public int defaultReleaseSize = 31457280; - - /// - /// 纹理中hash长度 - /// - public int texturesHashLength = 8; - - /// - /// 纹理存储路径 - /// - public string texturesPath = "Assets/Textures"; - - /// - /// 是否缓存纹理 - /// - public bool needCacheTextures = true; - - /// - /// 加载进度条的宽度,默认240 - /// - public int loadingBarWidth = 240; - - /// - /// 是否需要启动时自动检查小游戏是否有新版本 - /// - public bool needCheckUpdate = false; - } - - [Serializable] - public class CompressTexture - { - /// - /// 自动将图片尺寸减小一半 - /// - public bool halfSize = false; - /// - /// 使用pc端压缩纹理 - /// - public bool useDXT5 = false; - /// - /// bundle文件后缀 - /// - public string bundleSuffix = "bundle"; - /// - /// 是否加载bundle时同时加载对应纹理 - /// - public bool parallelWithBundle = false; - /// - /// 自定义bundle路径 - /// - public string bundleDir; - /// - /// 自定义生成目录路径 - /// - public string dstMinDir; - } - - [Serializable] - public class SDKOptions - { - /// - /// 使用微信音频API - /// - public bool UseAudioApi = false; - /// - /// 使用好友关系链 - /// - public bool UseFriendRelation = false; - /// - /// 使用压缩纹理替换(beta) - /// - public bool UseCompressedTexture = false; - } - - [Serializable] - public class CompileOptions - { - /// - /// Development Build - /// - public bool DevelopBuild = false; - /// - /// Autoconnect Profiler - /// - public bool AutoProfile = false; - /// - /// Scripts Only Build - /// - public bool ScriptOnly = false; - /// - /// Profiling Funcs - /// - public bool profilingFuncs = false; - /// - /// WebGL2.0 - /// - public bool Webgl2 = false; - /// - /// DeleteStreamingAssets - /// - public bool DeleteStreamingAssets = true; - /// - /// ProfilingMemory - /// - public bool ProfilingMemory = false; - } - - - public enum WXScreenOritation - { - Portrait, Landscape, LandscapeLeft, LandscapeRight - }; - - public class WXEditorScriptObject : ScriptableObject - { - - public WXProjectConf ProjectConf; - public SDKOptions SDKOptions; - public CompileOptions CompileOptions; - /// - /// 压缩纹理配置 - /// - public CompressTexture CompressTexture; - /// - /// 小游戏里会预先加载的key - /// - public List PlayerPrefsKeys = new List(); - } - - -} diff --git a/Assets/WX-WASM-SDK/Editor/WXEditorScriptObject.cs.meta b/Assets/WX-WASM-SDK/Editor/WXEditorScriptObject.cs.meta deleted file mode 100644 index 93658168..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXEditorScriptObject.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8958f46b6ca6d6440b590cbfa69e1103 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs b/Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs deleted file mode 100644 index 92c2ca65..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs +++ /dev/null @@ -1,1304 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System; -using System.Text.RegularExpressions; -using UnityEngine.Rendering; -using LitJson; - -namespace WeChatWASM -{ - /// - /// 脚本调用的话可修改 Assets/WX-WASM-SDK/Editor/MiniGameConfig.asset配置,然后调用WXEditorWindow 的 DoExport方法导出小游戏 - /// - public class WXEditorWindow : EditorWindow - { - - string projectName = ""; - string appid = ""; - string cdn = ""; - string videoUrl = ""; - public static string dst = ""; - string streamCDN = ""; - int bundleHashLength = 32; - string bundlePathIdentifier = "StreamingAssets;"; - string bundleExcludeExtensions = "json;"; - string preloadFiles = ""; // 预下载文件名, 以,分隔文件 - // string audioPrefix = ""; - bool useAudioApi = false; - bool useFriendRelation = false; - bool developBuild = false; - bool autoProfile = false; - bool scriptOnly = false; - bool profilingFuncs = false; - bool profilingMemory = false; - bool deleteStreamingAssets = true; - int assetLoadType = 0; // 首包资源加载方式 - bool webgl2 = false; - - int orientation = 0; - - static string SDKFilePath = ""; - - public static WXEditorScriptObject config; - - public static string webglDir = "webgl"; //导出的webgl目录 - public static string miniGameDir = "minigame"; // 生成小游戏的目录 - public static string audioDir = "Assets"; //音频资源目录 - public string codeMd5 = ""; - public string dataMd5 = ""; - public string dataFileSize = ""; - public Texture tex; - public string defaultImgSrc = "Assets/WX-WASM-SDK/wechat-default/images/background.jpg"; - public string bgImageSrc = ""; - public int memorySize = 0; - public bool hideAfterCallMain = true; - - public string dataFileSubPrefix = ""; - public int maxStorage = 200; - public int defaultReleaseSize = 31457280; - public int texturesHashLength = 8; - public string texturesPath = "Assets/Textures"; - public bool needCacheTextures = false; - public int loadingBarWidth = 240; - public bool needCheckUpdate = false; - - [MenuItem("微信小游戏 / 转换小游戏", false, 1)] - public static void Open() - { - -#if !(UNITY_2018_1_OR_NEWER) - UnityEngine.Debug.LogError("目前仅支持 Unity2018及以上的版本!"); -#endif - var win = GetWindow(typeof(WXEditorWindow), false, "转换微信小游戏", true);//创建窗口 - win.minSize = new Vector2(650, 800); - win.maxSize = new Vector2(1600, 950); - win.Show(); - // 打开面板时自动检查更新 - PluginUpdateManager.CheckUpdte(); - Init(); - } - - public static void Init() { - - PlayerSettings.WebGL.threadsSupport = false; - PlayerSettings.runInBackground = false; - - PlayerSettings.WebGL.compressionFormat = WebGLCompressionFormat.Disabled; -#if UNITY_2020_1_OR_NEWER - PlayerSettings.WebGL.template = "PROJECT:WXTemplate2020"; -#else - PlayerSettings.WebGL.template = "PROJECT:WXTemplate"; -#endif - - - PlayerSettings.WebGL.linkerTarget = WebGLLinkerTarget.Wasm; - - PlayerSettings.WebGL.dataCaching = false; - - -#if UNITY_2021_2_OR_NEWER - PlayerSettings.WebGL.debugSymbolMode = WebGLDebugSymbolMode.Embedded; -#else - PlayerSettings.WebGL.debugSymbols = true; -#endif - - - EditorSettings.spritePackerMode = SpritePackerMode.AlwaysOnAtlas; - - } - - public void OnEnable() - { - Init(); - LoadData(); - UpdateGraphicAPI(); - } - - - public void LoadData() { - - SDKFilePath = Path.Combine(Application.dataPath, "WX-WASM-SDK", "wechat-default", "unity-sdk", "index.js"); - config = UnityUtil.GetEditorConf(); - projectName = config.ProjectConf.projectName; - appid = config.ProjectConf.Appid; - cdn = config.ProjectConf.CDN; - assetLoadType = config.ProjectConf.assetLoadType; - videoUrl = config.ProjectConf.VideoUrl; - orientation = (int)config.ProjectConf.Orientation; - dst = config.ProjectConf.DST; - // streamCDN = config.ProjectConf.StreamCDN; - bundleHashLength = config.ProjectConf.bundleHashLength; - bundlePathIdentifier = config.ProjectConf.bundlePathIdentifier; - bundleExcludeExtensions = config.ProjectConf.bundleExcludeExtensions; - preloadFiles = config.ProjectConf.preloadFiles; - developBuild = config.CompileOptions.DevelopBuild; - autoProfile = config.CompileOptions.AutoProfile; - scriptOnly = config.CompileOptions.ScriptOnly; - profilingFuncs = config.CompileOptions.profilingFuncs; - profilingMemory = config.CompileOptions.ProfilingMemory; - deleteStreamingAssets = config.CompileOptions.DeleteStreamingAssets; - webgl2 = config.CompileOptions.Webgl2; - useAudioApi = config.SDKOptions.UseAudioApi; - // audioPrefix = config.ProjectConf.AssetsUrl; - useFriendRelation = config.SDKOptions.UseFriendRelation; - bgImageSrc = config.ProjectConf.bgImageSrc; - tex = AssetDatabase.LoadAssetAtPath(bgImageSrc); - memorySize = config.ProjectConf.MemorySize; - hideAfterCallMain = config.ProjectConf.HideAfterCallMain; - - // 不常用配置,先只通过MiniGameConfig.assets修改 - dataFileSubPrefix = config.ProjectConf.dataFileSubPrefix; - maxStorage = config.ProjectConf.maxStorage; - defaultReleaseSize = config.ProjectConf.defaultReleaseSize; - texturesHashLength = config.ProjectConf.texturesHashLength; - texturesPath = config.ProjectConf.texturesPath; - needCacheTextures = config.ProjectConf.needCacheTextures; - loadingBarWidth = config.ProjectConf.loadingBarWidth; - needCheckUpdate = config.ProjectConf.needCheckUpdate; - } - - private void OnFocus() - { - LoadData(); - } - - private void OnDisable() - { - EditorUtility.SetDirty(config); - } - - private void OnLostFocus() { - - config.ProjectConf.projectName = projectName; - config.ProjectConf.Appid = appid; - config.ProjectConf.CDN = cdn; - config.ProjectConf.assetLoadType = assetLoadType; - config.ProjectConf.VideoUrl = videoUrl; - config.ProjectConf.Orientation = (WXScreenOritation)orientation; - config.ProjectConf.DST = dst; - // config.ProjectConf.StreamCDN = streamCDN; - config.ProjectConf.bundleHashLength = bundleHashLength; - config.ProjectConf.bundlePathIdentifier = bundlePathIdentifier; - config.ProjectConf.bundleExcludeExtensions = bundleExcludeExtensions; - config.ProjectConf.preloadFiles = preloadFiles; - config.CompileOptions.DevelopBuild = developBuild; - config.CompileOptions.AutoProfile = autoProfile; - config.CompileOptions.ScriptOnly = scriptOnly; - config.CompileOptions.profilingFuncs = profilingFuncs; - config.CompileOptions.ProfilingMemory = profilingMemory; - config.CompileOptions.DeleteStreamingAssets = deleteStreamingAssets; - config.CompileOptions.Webgl2 = webgl2; - config.SDKOptions.UseAudioApi = useAudioApi; - // config.ProjectConf.AssetsUrl = audioPrefix; - config.SDKOptions.UseFriendRelation = useFriendRelation; - config.ProjectConf.bgImageSrc = bgImageSrc; - config.ProjectConf.MemorySize = memorySize; - config.ProjectConf.HideAfterCallMain = hideAfterCallMain; - - config.ProjectConf.dataFileSubPrefix = dataFileSubPrefix; - config.ProjectConf.maxStorage = maxStorage; - config.ProjectConf.defaultReleaseSize = defaultReleaseSize; - config.ProjectConf.texturesHashLength = texturesHashLength; - config.ProjectConf.texturesPath = texturesPath; - config.ProjectConf.needCacheTextures = needCacheTextures; - config.ProjectConf.loadingBarWidth = loadingBarWidth; - config.ProjectConf.needCheckUpdate = needCheckUpdate; - } - - - static string[] GetScenePaths() - { - List scenes = new List(); - for (int i = 0; i < EditorBuildSettings.scenes.Length; i++) - { - var scene = EditorBuildSettings.scenes[i]; - UnityEngine.Debug.LogFormat("[Builder] Scenes [{0}]: {1}, [{2}]", i, scene.path, scene.enabled ? "x" : " "); - - if (scene.enabled) - { - scenes.Add(scene.path); - } - } - - return scenes.ToArray(); - } - - private int Build() - { - PlayerSettings.WebGL.emscriptenArgs = ""; - PlayerSettings.runInBackground = false; - if (memorySize != 0) - { - if (memorySize >= 1024) - { - UnityEngine.Debug.LogErrorFormat($"memorySize必须小于1024,请查看GIT文档优化Unity WebGL的内存"); - return -1; - } - PlayerSettings.WebGL.emscriptenArgs += $" -s TOTAL_MEMORY={memorySize}MB"; - } - if (profilingMemory) - { - PlayerSettings.WebGL.emscriptenArgs += " --memoryprofiler "; - } - if (profilingFuncs) - { -#if !(UNITY_2021_2_OR_NEWER) - PlayerSettings.WebGL.emscriptenArgs += " --profiling-funcs"; -#else - PlayerSettings.WebGL.debugSymbolMode = WebGLDebugSymbolMode.Embedded; -#endif - } - - - UnityEngine.Debug.Log("[Builder] Starting to build WebGL project ... "); - - UnityEngine.Debug.Log("PlayerSettings.WebGL.emscriptenArgs : "+ PlayerSettings.WebGL.emscriptenArgs); - - // PlayerSettings.WebGL.memorySize = memorySize; - - - BuildOptions option = BuildOptions.None; - - if (developBuild) - { - option |= BuildOptions.Development; - } - if (autoProfile) - { - option |= BuildOptions.ConnectWithProfiler; - } - - if (scriptOnly) - { - option |= BuildOptions.BuildScriptsOnly; - } - - - if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.WebGL) - { - UnityEngine.Debug.LogFormat("[Builder] Current target is: {0}, switching to: {1}", EditorUserBuildSettings.activeBuildTarget, BuildTarget.WebGL); - if (!EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WebGL, BuildTarget.WebGL)) - { - UnityEngine.Debug.LogFormat("[Builder] Switching to {0}/{1} failed!", BuildTargetGroup.WebGL, BuildTarget.WebGL); - return -1; - } - } - - var projDir = Path.Combine(dst, webglDir); - - var result = BuildPipeline.BuildPlayer(GetScenePaths(), projDir, BuildTarget.WebGL, option); - if (result.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded) - { - UnityEngine.Debug.LogFormat($"[Builder] BuildPlayer failed. emscriptenArgs:%s", PlayerSettings.WebGL.emscriptenArgs); - return -1; - } - - UnityEngine.Debug.LogFormat("[Builder] Done: " + projDir); - return 0; - - } - - private static bool CopyDirectory(string SourcePath, string DestinationPath, bool overwriteexisting) - { - bool ret = false; - var separator = Path.DirectorySeparatorChar; - var ignoreFiles = new List() { "unityNamespace.js" }; - // eventEmitter - 改名为event-emitter - // loading和libs 是可交互视频用到的文件,先下掉可交互方案 - var ignoreDirs = new List() { "eventEmitter", "loading", "libs" }; - try - { - - if (Directory.Exists(SourcePath)) - { - if (Directory.Exists(DestinationPath) == false) - { - Directory.CreateDirectory(DestinationPath); - } else - { - // 已经存在,删掉目录下无用的文件 - foreach(string filename in ignoreFiles) - { - var filepath = Path.Combine(DestinationPath, filename); - if (File.Exists(filepath)) - { - File.Delete(filepath); - } - } - foreach(string dir in ignoreDirs) - { - var dirpath = Path.Combine(DestinationPath, dir); - if (Directory.Exists(dirpath)) - { - Directory.Delete(dirpath); - } - } - } - - foreach (string fls in Directory.GetFiles(SourcePath)) - { - - FileInfo flinfo = new FileInfo(fls); - if (flinfo.Extension == ".meta" || ignoreFiles.Contains(flinfo.Name)) - { - continue; - } - - flinfo.CopyTo(Path.Combine(DestinationPath, flinfo.Name), overwriteexisting); - - - - - } - foreach (string drs in Directory.GetDirectories(SourcePath)) - { - DirectoryInfo drinfo = new DirectoryInfo(drs); - if (ignoreDirs.Contains(drinfo.Name)) - { - continue; - } - if (CopyDirectory(drs, Path.Combine(DestinationPath, drinfo.Name), overwriteexisting) == false) - ret = false; - } - } - ret = true; - } - catch (Exception ex) - { - ret = false; - UnityEngine.Debug.LogError(ex); - } - return ret; - } - - private static bool CopyMusicDirectory(string SourcePath, string DestinationPath, bool overwriteexisting) - { - bool ret = false; - try - { - - if (Directory.Exists(SourcePath)) - { - - - foreach (string fls in Directory.GetFiles(SourcePath)) - { - - FileInfo flinfo = new FileInfo(fls); - string[] suffix = { ".wav",".mp3", "m4a", "aac", "mp4" }; - if (Array.IndexOf(suffix, flinfo.Extension.ToLower())>-1) { - UnityUtil.CreateDir(DestinationPath); - flinfo.CopyTo(Path.Combine(DestinationPath, flinfo.Name), overwriteexisting); - } - - } - foreach (string drs in Directory.GetDirectories(SourcePath)) - { - DirectoryInfo drinfo = new DirectoryInfo(drs); - if (CopyMusicDirectory(drs, Path.Combine(DestinationPath, drinfo.Name), overwriteexisting) == false) - ret = false; - } - } - ret = true; - } - catch (Exception ex) - { - ret = false; - UnityEngine.Debug.LogError(ex); - } - return ret; - - } - - private void ConvertCode() - { - - UnityEngine.Debug.LogFormat("[Converter] Starting to adapt framewor. Dst: " + dst); - - UnityUtil.DelectDir(Path.Combine(dst, miniGameDir)); - -#if UNITY_2020_1_OR_NEWER - string text = File.ReadAllText(Path.Combine(dst, webglDir, "Build", "webgl.framework.js"), Encoding.UTF8); -#else - string text = File.ReadAllText(Path.Combine(dst, webglDir, "Build", "webgl.wasm.framework.unityweb"), Encoding.UTF8); -#endif - int i; - for (i = 0; i < ReplaceRules.rules.Length; i++) - { - var rule = ReplaceRules.rules[i]; - text = Regex.Replace(text, rule.old, rule.newStr); - } - if (PlayerSettings.WebGL.exceptionSupport == WebGLExceptionSupport.None) - { - Rule[] rules = { - new Rule() - { - old = "console.log\\(\"Exception at", - newStr= "if(Module.IsWxGame);console.log(\"Exception at" - }, - new Rule() - { - old = "throw ptr", - newStr = "if(Module.IsWxGame)window.WXWASMSDK.WXUncaughtException(true);else throw ptr" - }, - }; - foreach (var rule in rules) - { - text = Regex.Replace(text, rule.old, rule.newStr); - } - } - if (text.Contains("UnityModule")) - { - text += ";GameGlobal.unityNamespace.UnityModule = UnityModule;"; - } - else - { - if (text.StartsWith("(") && text.EndsWith(")")) - { - text = text.Substring(1, text.Length - 2); - } - text = "GameGlobal.unityNamespace.UnityModule = " + text; - } - - if (!Directory.Exists(Path.Combine(dst, miniGameDir))) - { - Directory.CreateDirectory(Path.Combine(dst, miniGameDir)); - } - - File.WriteAllText(Path.Combine(dst, miniGameDir, "webgl.wasm.framework.unityweb.js"), text, new UTF8Encoding(false)); - - - - UnityEngine.Debug.LogFormat("[Converter] adapt framework done! "); - - - } - /// - /// 删掉导出目录webgl目录下旧资源包 - /// - private void RemoveOldAssetPackage(string dstDir) - { - try - { - - if (Directory.Exists(dstDir)) - { - foreach (string path in Directory.GetFiles(dstDir)) - { - FileInfo fileInfo = new FileInfo(path); - if (fileInfo.Name.Contains("webgl.data.unityweb.bin.txt")) - { - File.Delete(fileInfo.FullName); - } - } - } - } - catch (Exception ex) - { - UnityEngine.Debug.LogError(ex); - } - } - /// - /// 等brotli之后,统计下资源包加brotli压缩后代码包是否超过了20M(小游戏代码分包总大小限制) - /// - private void checkNeedCopyDataPackage(bool brotliError) - { - // 如果brotli失败,使用CDN加载 - if (brotliError) { - // brotli失败后,因为无法知道wasmcode大小,则得不到最终小游戏总包体大小。不能使用小游戏分包加载资源,还原成cdn的方式。 - if (assetLoadType == 1) { - UnityEngine.Debug.LogWarning("brotli失败,无法检测文件大小,请上传资源文件到CDN"); - assetLoadType = 0; - } - ShowNotification(new GUIContent("Brotli压缩失败,请到转出目录手动压缩!!!")); - } - if ((assetLoadType == 1)) - { -#if UNITY_2020_1_OR_NEWER - var dataPath = Path.Combine(dst, webglDir, "Build", "webgl.data"); -#else - var dataPath = Path.Combine(dst, webglDir, "Build", "webgl.data.unityweb"); -#endif - var brcodePath = Path.Combine(dst, miniGameDir, "wasmcode", codeMd5 + ".webgl.wasm.code.unityweb.wasm.br"); - var brcodeInfo = new FileInfo(brcodePath); - var brcodeSize = brcodeInfo.Length; - if (brcodeSize + int.Parse(dataFileSize) > 20971520) - { - ShowNotification(new GUIContent("资源文件过大,不适宜用代码分包加载")); - throw new Exception("资源文件过大,不适宜用代码分包加载"); - } else - { - File.Copy(dataPath, Path.Combine(dst, miniGameDir, "data-package", dataMd5 + ".webgl.data.unityweb.bin.txt"), true); - } - } - var loadDataFromCdn = assetLoadType == 0; - Rule[] rules = - { - new Rule() - { - old="$DEPLOY_URL", - newStr= cdn - }, - new Rule() - { - old="$LOAD_DATA_FROM_SUBPACKAGE", - newStr = loadDataFromCdn ? "false" : "true" - } - }; - string[] files = { "game.js", "game.json", "project.config.json" }; - ReplaceFileContent(files, rules); - } - - public int GenerateBinFile(bool isFromConvert = false) - { - UnityEngine.Debug.LogFormat("[Converter] Starting to genarate md5 and copy files"); - -#if UNITY_2020_1_OR_NEWER - var codePath = Path.Combine(dst, webglDir, "Build", "webgl.wasm"); -#else - var codePath = Path.Combine(dst, webglDir, "Build", "webgl.wasm.code.unityweb"); -#endif - codeMd5 = UnityUtil.BuildFileMd5(codePath); - -#if UNITY_2020_1_OR_NEWER - var dataPath = Path.Combine(dst, webglDir, "Build", "webgl.data"); -#else - var dataPath = Path.Combine(dst, webglDir, "Build", "webgl.data.unityweb"); -#endif - dataMd5 = UnityUtil.BuildFileMd5(dataPath); - -#if UNITY_2020_1_OR_NEWER - var symbolPath = Path.Combine(dst, webglDir, "Build", "webgl.symbols.json"); -#else - var symbolPath = Path.Combine(dst, webglDir, "Build", "webgl.wasm.symbols.unityweb"); -#endif - - RemoveOldAssetPackage(Path.Combine(dst, webglDir)); - RemoveOldAssetPackage(Path.Combine(dst, webglDir+"-min")); - - File.Copy(dataPath, Path.Combine(dst, webglDir, dataMd5 + ".webgl.data.unityweb.bin.txt"), true); - - CopyDirectory(Path.Combine(Application.dataPath, "WX-WASM-SDK", "wechat-default"), Path.Combine(dst, miniGameDir), true); - - // FIX: 2021.2版本生成symbol有bug,导出时生成symbol报错,有symbol才copy - // 代码分包需要symbol文件以进行增量更新 - if (File.Exists(symbolPath)) { - File.Copy(symbolPath, Path.Combine(dst, miniGameDir, "webgl.wasm.symbols.unityweb"), true); - } - - var info = new FileInfo(dataPath); - dataFileSize = info.Length.ToString(); - - UnityEngine.Debug.LogFormat("[Converter] that to genarate md5 and copy files ended"); - - ModifyWeChatConfigs(isFromConvert); - - ModifySDKFile(); - - ClearFriendRelationCode(); - - if (useAudioApi) { - CopyMusicDirectory(Application.dataPath, Path.Combine(dst, webglDir ,audioDir), true); - } - // 如果没有StreamingAssets目录,默认生成 - if (!Directory.Exists(Path.Combine(dst, webglDir, "StreamingAssets"))) { - Directory.CreateDirectory(Path.Combine(dst, webglDir, "StreamingAssets")); - } - return Brotlib(codePath); - - } - - private void ModifySDKFile() - { - var config = UnityUtil.GetEditorConf(); - string content = File.ReadAllText(SDKFilePath, Encoding.UTF8); - content = content.Replace("$unityVersion$", Application.unityVersion); - - File.WriteAllText(Path.Combine(dst, miniGameDir, "unity-sdk", "index.js"), content, Encoding.UTF8); - - content = File.ReadAllText(Path.Combine(Application.dataPath, "WX-WASM-SDK", "wechat-default", "unity-sdk", "storage.js"), Encoding.UTF8); - - var PreLoadKeys = config.PlayerPrefsKeys.Count > 0 ? JsonMapper.ToJson(config.PlayerPrefsKeys) : "[]"; - - content = content.Replace("\"$PreLoadKeys\"", PreLoadKeys); - - File.WriteAllText(Path.Combine(dst, miniGameDir, "unity-sdk", "storage.js"), content, Encoding.UTF8); - - //修改纹理dxt - content = File.ReadAllText(Path.Combine(Application.dataPath, "WX-WASM-SDK", "wechat-default", "unity-sdk", "texture.js"), Encoding.UTF8); - - content = content.Replace("\"$UseDXT5$\"", config.CompressTexture.useDXT5 ? "true" : "false"); - - File.WriteAllText(Path.Combine(dst, miniGameDir, "unity-sdk", "texture.js"), content, Encoding.UTF8); - - } - - class PreloadFile - { - public PreloadFile(string fn, string rp) - { - fileName = fn; - relativePath = rp; - } - public string fileName; - public string relativePath; - }; - /// - /// 从webgl目录模糊搜索preloadfiles中的文件,作为预下载的列表 - /// - private string GetPreloadList(string strPreloadfiles) - { - - if (strPreloadfiles == "") - { - return ""; - } - string preloadList = ""; - var streamingAssetsPath = Path.Combine(dst, webglDir + "/StreamingAssets"); - var fileNames = strPreloadfiles.Split(new char[] { ';' }); - List preloadFiles = new List(); - foreach(var fileName in fileNames) - { - if (fileName.Trim() == "") continue; - preloadFiles.Add(new PreloadFile(fileName, "")); - } - - if (Directory.Exists(streamingAssetsPath)) - { - foreach (string path in Directory.GetFiles(streamingAssetsPath, "*", SearchOption.AllDirectories)) - { - FileInfo fileInfo = new FileInfo(path); - foreach (var preloadFile in preloadFiles) - { - if (fileInfo.Name.Contains(preloadFile.fileName)) - { - // 相对于StreamingAssets的路径 - var relativePath = path.Substring(streamingAssetsPath.Length + 1).Replace('\\', '/'); - preloadFile.relativePath = relativePath; - break; - } - } - } - } - else - { - UnityEngine.Debug.LogError("没有找到StreamingAssets目录, 无法生成预下载列表"); - } - foreach (var preloadFile in preloadFiles) - { - if (preloadFile.relativePath == "") - { - UnityEngine.Debug.LogError($"并非所有预下载的文件都被找到,剩余:{preloadFile.fileName}"); - continue; - } - preloadList += ("\"" + preloadFile.relativePath + "\", \r"); - } - return preloadList; - } - - public string HandleLoadingImage() - { - var info = AssetDatabase.LoadAssetAtPath(bgImageSrc); - var oldFilename = Path.GetFileName(defaultImgSrc); - var newFilename = Path.GetFileName(bgImageSrc); - if (bgImageSrc != defaultImgSrc) - { - // 图片宽高不能超过2048 - if (info.width > 2048 || info.height > 2048) - { - throw new Exception("封面图宽高不可超过2048"); - } - File.Delete(Path.Combine(dst, miniGameDir, "images", oldFilename)); - File.Copy(bgImageSrc, Path.Combine(dst, miniGameDir, "images", newFilename), true); - return "images/" + Path.GetFileName(bgImageSrc); - } else - { - return "images/" + Path.GetFileName(defaultImgSrc); - } - } - - public void ModifyWeChatConfigs(bool isFromConvert = false) - { - UnityEngine.Debug.LogFormat("[Converter] Starting to modify configs"); - - var config = UnityUtil.GetEditorConf(); - - var PRELOAD_LIST = GetPreloadList(preloadFiles); - var imgSrc = HandleLoadingImage(); - - var bundlePathIdentifierStr = GetArrayString(bundlePathIdentifier); - var excludeFileExtensionsStr = GetArrayString(bundleExcludeExtensions); - - var screenOrientation = new List(){"portrait", "landscape", "landscapeLeft", "landscapeRight"}[orientation]; - - Rule[] replaceArrayList = - { - new Rule() - { - old="$GAME_NAME", - newStr="webgl" - }, - new Rule() - { - old="$PROJECT_NAME", - newStr=projectName == "" ? "webgl" : projectName, - }, - new Rule() - { - old="$APP_ID", - newStr=appid - }, - new Rule() - { - old="$ORIENTATION", - newStr=screenOrientation - }, - new Rule() - { - old="$LOADING_VIDEO_URL", - newStr=videoUrl - }, - new Rule() - { - old="$CODE_MD5", - newStr=codeMd5 - }, - new Rule() - { - old="$DATA_MD5", - newStr=dataMd5 - }, - // new Rule() - // { - // old="$DATA_FILE_SIZE", - // newStr=dataFileSize - // }, - new Rule() - { - old="$STREAM_CDN", - newStr=streamCDN - }, - new Rule() - { - old="$AUDIO_PREFIX", - newStr=cdn + "/Assets" - }, - - new Rule() - { - old="\"$PRELOAD_LIST\"", - newStr=PRELOAD_LIST - }, - new Rule() - { - old="$BACKGROUND_IMAGE", - newStr=imgSrc - }, - new Rule() - { - old="$HIDE_AFTER_CALLMAIN", - newStr = hideAfterCallMain ? "true" : "false" - }, - new Rule() - { - old="$BUNDLE_HASH_LENGTH", - newStr=bundleHashLength.ToString() - }, - new Rule() - { - old="$BUNDLE_PATH_IDENTIFIER", - newStr=bundlePathIdentifierStr - }, - new Rule() - { - old="$EXCLUDE_FILE_EXTENSIONS", - newStr=excludeFileExtensionsStr - }, - new Rule() - { - old="$WEBGL_VERSION", - newStr=webgl2? "2" : "1" - }, - new Rule() - { - old="$UNITY_VERSION", - newStr=Application.unityVersion - }, - new Rule() - { - old="$PLUGIN_VERSION", - newStr=WXPluginVersion.pluginVersion - }, - new Rule() - { - old="$DATA_FILE_SUB_PREFIX", - newStr=dataFileSubPrefix - }, - new Rule() - { - old="$MAX_STORAGE_SIZE", - newStr=maxStorage.ToString() - }, - new Rule() - { - old="$DEFAULT_RELEASE_SIZE", - newStr=defaultReleaseSize.ToString() - }, - new Rule() - { - old="$TEXTURE_HASH_LENGTH", - newStr=texturesHashLength.ToString() - }, - new Rule() - { - old="$TEXTURES_PATH", - newStr=texturesPath - }, - new Rule() - { - old="$NEED_CACHE_TEXTURES", - newStr=needCacheTextures ? "true" : "false" - }, - new Rule() - { - old="$LOADING_BAR_WIDTH", - newStr=loadingBarWidth.ToString() - }, - new Rule() - { - old="$NEED_CHECK_UPDATE", - newStr=needCheckUpdate ? "true" : "false" - } - }; - - List replaceList = new List(replaceArrayList); - List files = new List { "game.js", "game.json", "project.config.json", "unity-namespace.js" }; - - - - ReplaceFileContent(files.ToArray(), replaceList.ToArray()); - - - - - UnityEngine.Debug.LogFormat("[Converter] that to modify configs ended"); - - - - } - /// - /// 对文件做内容替换 - /// - /// - /// - public void ReplaceFileContent(string[] files, Rule[] replaceList) - { - if (files.Length != 0 && replaceList.Length != 0) - { - for (int i = 0; i < files.Length; i++) - { - var filePath = Path.Combine(dst, miniGameDir, files[i]); - string text = File.ReadAllText(filePath, Encoding.UTF8); - for (int j = 0; j < replaceList.Length; j++) - { - var rule = replaceList[j]; - text = text.Replace(rule.old, rule.newStr); - } - File.WriteAllText(filePath, text, new UTF8Encoding(false)); - } - } - } - - /// - /// 按;分隔字符串,将分隔后每一项作为字符串用,连接 - /// eg: input "i1;i2;i3" => output: `"i1", "i2", "i3"` - /// - /// - public string GetArrayString(string inp) { - var result = ""; - var iterms = new List(inp.Split(new char[] {';'})); - iterms.ForEach((iterm) => { - if (!string.IsNullOrEmpty(iterm.Trim())) { - result += ("\"" + iterm.Trim() + "\", "); - } - }); - if (!string.IsNullOrEmpty(result)) { - result = result.Substring(0, result.Length - 2); - } - return result; - } - - private int Brotlib(string filePath) - { - UnityEngine.Debug.LogFormat("[Converter] Starting to generate Brotlib file"); - - - var exePath = ""; - var path = ""; -#if UNITY_EDITOR_OSX - exePath = Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/Brotli/macos/brotli"); -#else - exePath = Path.Combine(Application.dataPath, "WX-WASM-SDK/Editor/Brotli/win_x86_64/brotli.exe"); -#endif - var dstPath = Path.Combine(dst, miniGameDir, "wasmcode", codeMd5 + ".webgl.wasm.code.unityweb.wasm.br"); - WeChatWASM.UnityUtil.RunCmd(exePath, string.Format($" --force --quality 11" + - $" --input {filePath}" + - $" --output {dstPath}"), path); - return 0; - } - - /// - /// 如果没有使用好友关系链的话,自动删掉无用代码 - /// - private void ClearFriendRelationCode() - { - if (!useFriendRelation) - { - var filePath = Path.Combine(dst, miniGameDir, "game.json"); - - string content = File.ReadAllText(filePath, Encoding.UTF8); - content = content.Replace("\"openDataContext\": \"open-data\",", ""); - File.WriteAllText(filePath, content); - - string openDataDir = Path.Combine(dst, miniGameDir, "open-data"); - - UnityUtil.DelectDir(openDataDir); - - Directory.Delete(openDataDir, true); - } - - } - - public static void DrawProObjectField( - GUIContent label, - SerializedProperty value, - Type objType, - GUIStyle style, - bool allowSceneObjects, - Texture objIcon = null) where T : UnityEngine.Object - { - - T tObj = value.objectReferenceValue as T; - - if (objIcon == null) - { - objIcon = EditorGUIUtility.FindTexture("PrefabNormal Icon"); - } - style.imagePosition = ImagePosition.ImageLeft; - - int pickerID = 455454425; - - if (tObj != null) - { - EditorGUILayout.LabelField(label, - new GUIContent(tObj.name, objIcon), style); - } - - if (GUILayout.Button("Select")) - { - EditorGUIUtility.ShowObjectPicker( - tObj, allowSceneObjects, "", pickerID); - - } - if (Event.current.commandName == "ObjectSelectorUpdated") - { - if (EditorGUIUtility.GetObjectPickerControlID() == pickerID) - { - tObj = EditorGUIUtility.GetObjectPickerObject() as T; - value.objectReferenceValue = tObj; - } - } - - } - - - private void OnGUI() - { - var labelStyle = new GUIStyle(EditorStyles.boldLabel); - labelStyle.fontSize = 14; - - labelStyle.margin.left = 20; - labelStyle.margin.top = 10; - labelStyle.margin.bottom = 10; - - GUILayout.Label("基本设置", labelStyle); - - var inputStyle = new GUIStyle(EditorStyles.textField); - inputStyle.fontSize = 14; - inputStyle.margin.left = 20; - inputStyle.margin.bottom = 10; - inputStyle.margin.right = 20; - - var intPopupStyle = new GUIStyle(EditorStyles.popup); - intPopupStyle.fontSize = 14; - intPopupStyle.margin.left = 20; - intPopupStyle.margin.bottom = 15; - intPopupStyle.margin.right = 20; - - appid = EditorGUILayout.TextField("游戏appid", appid, inputStyle); - cdn = EditorGUILayout.TextField("游戏资源CDN", cdn, inputStyle); - projectName = EditorGUILayout.TextField("小游戏项目名", projectName, inputStyle); - orientation = EditorGUILayout.IntPopup("游戏方向", orientation, new[] { "Portrait", "Landscape", "LandscapeLeft", "LandscapeRight" }, new[] { 0, 1, 2, 3 }, intPopupStyle); - var totalMemoryFieldDesc = new GUIContent("最大内存(MB)", "预留的初始内存值,需评估游戏最大内存峰值进行设置,消除内存自动增长带来的峰值尖刺。请查看GIT文档<优化Unity WebGL的内存>"); - memorySize = EditorGUILayout.IntField(totalMemoryFieldDesc, memorySize, inputStyle); - - GUILayout.Label("导出路径", labelStyle); - - var choosePathButtonClicked = false; - var openTargetButtonClicked = false; - var resetButtonClicked = false; - - if (dst == "") - { - GUIStyle pathButtonStyle = new GUIStyle(GUI.skin.button); - pathButtonStyle.fontSize = 12; - pathButtonStyle.margin.left = 20; - - choosePathButtonClicked = GUILayout.Button("选择导出路径", pathButtonStyle, GUILayout.Height(30), GUILayout.Width(200)); - } - else - { - - int pathButtonHeight = 28; - GUIStyle pathLabelStyle = new GUIStyle(GUI.skin.textField); - pathLabelStyle.fontSize = 12; - pathLabelStyle.alignment = TextAnchor.MiddleLeft; - pathLabelStyle.margin.top = 6; - pathLabelStyle.margin.bottom = 6; - pathLabelStyle.margin.left = 20; - - GUILayout.BeginHorizontal(); - // 路径框 - GUILayout.Label(dst, pathLabelStyle, GUILayout.Height(pathButtonHeight - 6), GUILayout.ExpandWidth(true), GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 126)); - openTargetButtonClicked = GUILayout.Button("打开", GUILayout.Height(pathButtonHeight), GUILayout.Width(40)); - resetButtonClicked = GUILayout.Button("重选", GUILayout.Height(pathButtonHeight), GUILayout.Width(40)); - GUILayout.EndHorizontal(); - } - EditorGUILayout.Space(); - - GUILayout.Label("启动Loader设置", labelStyle); - EditorGUILayout.BeginHorizontal(); - GUILayout.Space(20); - tex = (Texture)EditorGUILayout.ObjectField("启动背景图/视频封面", tex, typeof(Texture2D), false); - var currentBgSrc = AssetDatabase.GetAssetPath(tex); - TextureImporter texInfo = (TextureImporter)AssetImporter.GetAtPath(currentBgSrc); - if (!string.IsNullOrEmpty(currentBgSrc) && currentBgSrc != bgImageSrc) - { - bgImageSrc = currentBgSrc; - var config = UnityUtil.GetEditorConf(); - config.ProjectConf.bgImageSrc = bgImageSrc; - EditorUtility.SetDirty(config); - AssetDatabase.SaveAssets(); - } - GUILayout.Space(20); - EditorGUILayout.EndHorizontal(); - - videoUrl = EditorGUILayout.TextField("加载阶段视频url", videoUrl, inputStyle); - - var optionsList = new List(); - optionsList.Add(new GUIContent("CDN")); - optionsList.Add(new GUIContent("小游戏分包")); - GUIContent assetLoadTypeLabel = new GUIContent("首包资源加载方式", "选择'CDN'通过传统CDN加载资源。选择'小游戏分包'通过小游戏代码分包加载资源。小游戏分包有总大小20M限制,若资源加代码总大小超过20M,会自动切换为传统CDN加载"); - - assetLoadType = EditorGUILayout.IntPopup(assetLoadTypeLabel, assetLoadType, optionsList.ToArray(), new[] { 0, 1 }, intPopupStyle); - - // audioPrefix = EditorGUILayout.TextField("Assets目录对应CDN地址", audioPrefix, inputStyle); - - // memorySize = EditorGUILayout.IntField("游戏内存大小(MB)", memorySize, inputStyle); - - // EditorGUILayout.Space(); - - // GUILayout.Label("AssetBundle缓存配置", labelStyle); - - // streamCDN = EditorGUILayout.TextField("Bundle包CDN地址", streamCDN, inputStyle); - // var bundlePathFieldDesc = new GUIContent("路径标识符(;分隔)", "下载路径中包含标识符可判定为下载Bundle,可自动缓存。默认值StreamingAssets"); - // bundlePathIdentifier = EditorGUILayout.TextField(bundlePathFieldDesc, bundlePathIdentifier, inputStyle); - - var bundleExcludeExtensionsFieldDesc = new GUIContent("不自动缓存文件类型(;分隔)", "当请求url包含资源'cdn+StreamingAssets'时会自动缓存,但StreamingAssets目录下不是所有文件都需缓存,此选项配置不需要自动缓存的文件拓展名。默认值json"); - bundleExcludeExtensions = EditorGUILayout.TextField(bundleExcludeExtensionsFieldDesc, bundleExcludeExtensions, inputStyle); - - var bundleHashLengthFieldDesc = new GUIContent("Bundle名中Hash长度", "自定义Bundle文件名中hash部分长度,默认值32,用于缓存控制。"); - bundleHashLength = EditorGUILayout.IntField(bundleHashLengthFieldDesc, bundleHashLength, inputStyle); - - EditorGUILayout.Space(); - - GUILayout.Label("预下载选项", labelStyle); - GUILayout.BeginHorizontal(); - preloadFiles = EditorGUILayout.TextField("文件列表(;间隔,模糊匹配)", preloadFiles, inputStyle); - - GUILayout.EndHorizontal(); - - EditorGUILayout.Space(); - - GUIStyle toggleStyle = new GUIStyle(GUI.skin.toggle); - toggleStyle.margin.left = 20; - toggleStyle.margin.right = 20; - - GUILayout.Label("SDK功能选项", labelStyle); - GUILayout.BeginHorizontal(); - useFriendRelation = GUILayout.Toggle(useFriendRelation, "使用好友关系链", toggleStyle); - useAudioApi = GUILayout.Toggle(useAudioApi, "使用微信音频API", toggleStyle); - GUILayout.EndHorizontal(); - EditorGUILayout.Space(); - - - - - EditorGUILayout.Space(); - EditorGUILayout.Space(); - - GUILayout.Label("调试编译选项", labelStyle); - GUILayout.BeginHorizontal(); - - developBuild = GUILayout.Toggle(developBuild, "Development Build",toggleStyle); - autoProfile = GUILayout.Toggle(autoProfile, "Autoconnect Profiler", toggleStyle); - scriptOnly = GUILayout.Toggle(scriptOnly, "Scripts Only Build", toggleStyle); - - GUILayout.EndHorizontal(); - GUILayout.BeginHorizontal(); - - profilingFuncs = GUILayout.Toggle(profilingFuncs, "Profiling Funcs ", toggleStyle); - profilingMemory = GUILayout.Toggle(profilingMemory, "Profiling Memory ", toggleStyle); - - - var oldwebgl2 = webgl2; - webgl2 = GUILayout.Toggle(webgl2, "WebGL2.0(beta)", toggleStyle); - if (oldwebgl2 != webgl2) UpdateGraphicAPI(); - GUILayout.EndHorizontal(); - EditorGUILayout.Space(); - - deleteStreamingAssets = GUILayout.Toggle(deleteStreamingAssets, "ClearStreamingAssets", toggleStyle); - - - GUIStyle exportButtonStyle = new GUIStyle(GUI.skin.button); - exportButtonStyle.fontSize = 14; - exportButtonStyle.margin.left = 20; - exportButtonStyle.margin.top = 40; - - EditorGUILayout.BeginHorizontal(); - - - var isExportBtnPressed = GUILayout.Button("导出WEBGL并转换为小游戏(常用)", exportButtonStyle, GUILayout.Height(40), GUILayout.Width(EditorGUIUtility.currentViewWidth - 270)); - - var isConvertBtnPressed = GUILayout.Button("将WEBGL转为小游戏(不常用)", exportButtonStyle, GUILayout.Height(40), GUILayout.Width(210)); - - EditorGUILayout.EndHorizontal(); - - - if (isExportBtnPressed) - { - - DoExport(true); - - } - - if (isConvertBtnPressed) - { - DoExport(false); - } - - if (choosePathButtonClicked) - { - // 弹出选目录窗口 - var dstPath = EditorUtility.SaveFolderPanel("选择你的游戏导出目录", "", ""); - - if (dstPath != "") - { - dst = dstPath; - OnLostFocus(); - } - - - } - - if (openTargetButtonClicked) - { - UnityUtil.ShowInExplorer(dst); - } - if (resetButtonClicked) - { - dst = ""; - } - - - EditorGUILayout.Space(); - - } - - private void UpdateGraphicAPI() - { - PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.WebGL, false); - - GraphicsDeviceType[] targets = new GraphicsDeviceType[] { }; - if (webgl2) - { - PlayerSettings.SetGraphicsAPIs(BuildTarget.WebGL, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES3 }); - } - else - { - PlayerSettings.SetGraphicsAPIs(BuildTarget.WebGL, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES2 }); - } - } - - // 可以调用这个来集成 - public void DoExport(bool buildWebGL) { - - OnLostFocus(); - EditorUtility.SetDirty(config); - AssetDatabase.SaveAssets(); - - if (dst == "") - { - ShowNotification(new GUIContent("请先选择游戏导出路径")); - } - else - { - -#if UNITY_EDITOR_OSX - // MacSetAuth(); -#endif - //仅删除StreamingAssets目录 - if (deleteStreamingAssets) - { - UnityUtil.DelectDir(Path.Combine(dst, webglDir + "/StreamingAssets")); - } - - if (buildWebGL && Build() != 0) - { - return; - } - - ConvertCode(); - - int res = GenerateBinFile(); - if (res == 0) - { - checkNeedCopyDataPackage(false); - UnityEngine.Debug.LogFormat("[Converter] All done!"); - ShowNotification(new GUIContent("转换完成")); - } - else - { - checkNeedCopyDataPackage(true); - } - - // 如果是2021版本,官方symbols产生有BUG,这里需要用工具将embedded的函数名提取出来 -#if UNITY_2021_2_OR_NEWER - var path = "Assets/WX-WASM-SDK/Editor/Node"; - var nodePath = "node"; -#if UNITY_EDITOR_OSX - nodePath = "/usr/local/bin/node"; -#endif - WeChatWASM.UnityUtil.RunCmd(nodePath, string.Format($"--experimental-modules dump_wasm_symbol.mjs {dst}"), path); - UnityEngine.Debug.LogError($"Unity 2021版本使用Embeded Symbols, 代码包中含有函数名体积较大, 发布前使用代码分包工具进行优化"); -#endif - - } - } - - - } -} diff --git a/Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs.meta deleted file mode 100644 index 832b5219..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2e5f1a161b7fddc4fa91129b6686dd9a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/WXPlayerPrefsWindow.cs b/Assets/WX-WASM-SDK/Editor/WXPlayerPrefsWindow.cs deleted file mode 100644 index 332064a4..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXPlayerPrefsWindow.cs +++ /dev/null @@ -1,149 +0,0 @@ -using UnityEngine; -using UnityEditor; - -namespace WeChatWASM -{ - public class WXPlayerPrefsWindow : EditorWindow - { - - public WXEditorScriptObject config; - public string tempKey = ""; - - - - [MenuItem("微信小游戏 / PlayerPrefs优化 / 配置KeyName")] - public static void Open() - { - - var win = GetWindow(typeof(WXPlayerPrefsWindow), false, "配置PlayerPrefs用到的KeyName", true);//创建窗口 - win.minSize = new Vector2(700, 300); - //win.maxSize = new Vector2(400, 200); - win.Show(); - - } - - public void LoadData() - { - - config = UnityUtil.GetEditorConf(); - - } - - public void OnEnable() - { - LoadData(); - } - - private void OnFocus() - { - LoadData(); - } - - - private void OnLostFocus() - { - - EditorUtility.SetDirty(config); - AssetDatabase.SaveAssets(); - } - - - private void OnGUI() - { - var labelStyle = new GUIStyle(EditorStyles.boldLabel); - labelStyle.fontSize = 14; - - labelStyle.margin.left = 20; - labelStyle.margin.top = 10; - labelStyle.margin.bottom = 10; - - GUILayout.Label("设置PlayerPrefs用到的KeyName,能加快第一次的查询速度", labelStyle); - - GUIStyle pathButtonStyle = new GUIStyle(GUI.skin.button); - pathButtonStyle.fontSize = 12; - pathButtonStyle.margin.left = 20; - - var inputStyle = new GUIStyle(EditorStyles.textField); - inputStyle.fontSize = 14; - inputStyle.margin.left = 20; - inputStyle.margin.bottom = 10; - inputStyle.margin.right = 20; - - var intPopupStyle = new GUIStyle(EditorStyles.popup); - intPopupStyle.fontSize = 14; - intPopupStyle.margin.left = 20; - intPopupStyle.margin.bottom = 15; - intPopupStyle.margin.right = 20; - - - int pathButtonHeight = 28; - GUIStyle pathLabelStyle = new GUIStyle(GUI.skin.textField); - - pathLabelStyle.fontSize = 12; - pathLabelStyle.alignment = TextAnchor.MiddleLeft; - pathLabelStyle.margin.top = 6; - pathLabelStyle.margin.bottom = 6; - pathLabelStyle.margin.left = 20; - - - tempKey = EditorGUILayout.TextField("KeyName", tempKey, inputStyle); - - - EditorGUILayout.Space(); - EditorGUILayout.Space(); - - var clickAdd = GUILayout.Button("添加", pathButtonStyle, GUILayout.Height(30), GUILayout.Width(200)); - - if (clickAdd) - { - - if (string.IsNullOrEmpty(tempKey)) - { - Debug.LogError("Key不能为空!"); - return; - } - if (config.PlayerPrefsKeys.Contains(tempKey)) { - Debug.LogError("目录已经添加!"); - return; - } - - config.PlayerPrefsKeys.Add(tempKey); - OnLostFocus(); - tempKey = ""; - } - - EditorGUILayout.Space(); - EditorGUILayout.Space(); - - GUILayout.Label("已添加Key:", labelStyle); - - if (config.PlayerPrefsKeys != null && config.PlayerPrefsKeys.Count > 0) - { - for (int i = 0; i < config.PlayerPrefsKeys.Count; i++) - { - string options = config.PlayerPrefsKeys[i]; - - GUILayout.BeginHorizontal(); - // 路径框 - GUILayout.Label(options, pathLabelStyle, GUILayout.Height(pathButtonHeight - 6), GUILayout.ExpandWidth(true), GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 190)); - - var isDelete = GUILayout.Button("删除", GUILayout.Height(pathButtonHeight), GUILayout.Width(40)); - if (isDelete) - { - config.PlayerPrefsKeys.Remove(options); - OnLostFocus(); - } - GUILayout.EndHorizontal(); - } - - } - - - - - } - - - - } -} diff --git a/Assets/WX-WASM-SDK/Editor/WXPlayerPrefsWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/WXPlayerPrefsWindow.cs.meta deleted file mode 100644 index 53c6a19e..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXPlayerPrefsWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ec878ef36b44d4b14afdeb23ad64bf73 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/WXPluginVersion.cs b/Assets/WX-WASM-SDK/Editor/WXPluginVersion.cs deleted file mode 100644 index 993b7437..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXPluginVersion.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace WeChatWASM -{ - public class WXPluginVersion - { - public static string pluginVersion = "202207281523"; //这一行不要改他,导出的时候会自动替换 - } - public class WXPluginConf - { - public string version; - public string filePath; - } -} diff --git a/Assets/WX-WASM-SDK/Editor/WXPluginVersion.cs.meta b/Assets/WX-WASM-SDK/Editor/WXPluginVersion.cs.meta deleted file mode 100644 index da2b4d26..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXPluginVersion.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: cb82141090cf5cd49a139a4a7d5cb5a8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/WXUpdateWindow.cs b/Assets/WX-WASM-SDK/Editor/WXUpdateWindow.cs deleted file mode 100644 index bd6ea3a3..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXUpdateWindow.cs +++ /dev/null @@ -1,124 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Net; -using System; -using System.IO; - -namespace WeChatWASM -{ - public class PluginUpdateManager { - public static string checkUrl = "https://game.weixin.qq.com/cgi-bin/gamewxagwasmsplitwap/getunityplugininfo"; - - public static string downloadUrl = ""; - - [Serializable] - public struct InfoStruct { - public string url; - public string version; - } - [Serializable] - public struct DataStruct { - - public InfoStruct info; - } - - public struct VersionRes { - public int errcode; - public string errmsg; - - public DataStruct data; - } - - public static bool CheckUpdte() - { - HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(checkUrl); - httpWebRequest.ContentType = "application/json"; - httpWebRequest.Method = "GET"; - httpWebRequest.Timeout = 20000; - - HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); - StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream()); - string responseContent = streamReader.ReadToEnd(); - httpWebResponse.Close(); - streamReader.Close(); - - var res = JsonUtility.FromJson(responseContent); - - if (res.errcode == 0) { - long.TryParse(res.data.info.version, out long onlineVersion); - long.TryParse(WXPluginVersion.pluginVersion, out long nowVersion); - - if (onlineVersion > nowVersion) - { - downloadUrl = res.data.info.url; - OpenDownloadUrl(); - return true; - } - } - // 请求错误和无更新都不需要下载 - return false; - } - public static void OpenDownloadUrl() - { - Selection.activeObject = AssetDatabase.LoadAssetAtPath("Assets/WX-WASM-SDK/CHANGELOG.md", typeof(UnityEngine.Object)); - if (EditorUtility.DisplayDialog("微信小游戏插件更新提示", "插件有更新\n是否立即更新", "是", "否")) - { - Application.OpenURL(downloadUrl); - } else - { - Debug.Log("有更新版本插件,请及时更新:" + downloadUrl + ""); - } - } - } - public class WXUpdateWindow : EditorWindow - { - [MenuItem("微信小游戏 / 插件管理")] - public static void Open() - { - - var win = GetWindow(typeof(WXUpdateWindow), false, "微信小游戏转换插件管理", true);//创建窗口 - win.minSize = new Vector2(400, 250); - win.maxSize = new Vector2(400, 250); - win.Show(); - - } - - private void OnGUI() - { - - var labelStyle = new GUIStyle(EditorStyles.boldLabel); - labelStyle.fontSize = 16; - - labelStyle.margin.left = (int)(EditorGUIUtility.currentViewWidth / 2 - 100); - labelStyle.margin.top = 50; - labelStyle.margin.bottom = 10; - - GUILayout.Label("当前版本:" + WXPluginVersion.pluginVersion, labelStyle); - - - GUIStyle exportButtonStyle = new GUIStyle(GUI.skin.button); - exportButtonStyle.fontSize = 14; - exportButtonStyle.margin.left = 20; - exportButtonStyle.margin.top = 40; - var isCheckBtnPressed = GUILayout.Button("检查更新", exportButtonStyle, GUILayout.Height(40), GUILayout.Width(EditorGUIUtility.currentViewWidth - 40)); - - if (isCheckBtnPressed) - { - if (PluginUpdateManager.CheckUpdte()) - { - ShowNotification(new GUIContent("有新版可以下载,请尽快更新!")); - } - else - { - ShowNotification(new GUIContent("当前已是最新!")); - } - } - - var openChangeLog = GUILayout.Button("更新日志", exportButtonStyle, GUILayout.Height(40), GUILayout.Width(EditorGUIUtility.currentViewWidth - 40)); - if (openChangeLog) - { - Selection.activeObject = AssetDatabase.LoadAssetAtPath("Assets/WX-WASM-SDK/CHANGELOG.md", typeof(UnityEngine.Object)); - } - } - } -} diff --git a/Assets/WX-WASM-SDK/Editor/WXUpdateWindow.cs.meta b/Assets/WX-WASM-SDK/Editor/WXUpdateWindow.cs.meta deleted file mode 100644 index 4e022282..00000000 --- a/Assets/WX-WASM-SDK/Editor/WXUpdateWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: affa22e6d78ab8144860f7d42012c6dc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/astcenc-avx2 b/Assets/WX-WASM-SDK/Editor/astcenc-avx2 deleted file mode 100755 index daf7a07a..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/astcenc-avx2 and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/astcenc-avx2.exe.meta b/Assets/WX-WASM-SDK/Editor/astcenc-avx2.exe.meta deleted file mode 100644 index b86daa55..00000000 --- a/Assets/WX-WASM-SDK/Editor/astcenc-avx2.exe.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: fff90a9752fcf4776ac78b63a2dc5bbe -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/astcenc-avx2.meta b/Assets/WX-WASM-SDK/Editor/astcenc-avx2.meta deleted file mode 100644 index a471bae7..00000000 --- a/Assets/WX-WASM-SDK/Editor/astcenc-avx2.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6b232cba92cc6824f86621d84087c874 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/astcenc-neon b/Assets/WX-WASM-SDK/Editor/astcenc-neon deleted file mode 100755 index 60e94ea5..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/astcenc-neon and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/astcenc-neon.meta b/Assets/WX-WASM-SDK/Editor/astcenc-neon.meta deleted file mode 100644 index b67af2e6..00000000 --- a/Assets/WX-WASM-SDK/Editor/astcenc-neon.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f0c009da700fa459b8bc383da2f22b04 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/astcenc-sse4.1.exe.meta b/Assets/WX-WASM-SDK/Editor/astcenc-sse4.1.exe.meta deleted file mode 100644 index 64746331..00000000 --- a/Assets/WX-WASM-SDK/Editor/astcenc-sse4.1.exe.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ef04dda9954cb475e837d171f41edddc -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/convert.exe.meta b/Assets/WX-WASM-SDK/Editor/convert.exe.meta deleted file mode 100644 index 0ef52c26..00000000 --- a/Assets/WX-WASM-SDK/Editor/convert.exe.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 0f23cc7cad673124cba2684fe768a345 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/pngquant b/Assets/WX-WASM-SDK/Editor/pngquant deleted file mode 100755 index fb7d3844..00000000 Binary files a/Assets/WX-WASM-SDK/Editor/pngquant and /dev/null differ diff --git a/Assets/WX-WASM-SDK/Editor/pngquant.exe.meta b/Assets/WX-WASM-SDK/Editor/pngquant.exe.meta deleted file mode 100644 index 251e3495..00000000 --- a/Assets/WX-WASM-SDK/Editor/pngquant.exe.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 33f2ecc6bd637416a867bd317d8fe151 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Editor/pngquant.meta b/Assets/WX-WASM-SDK/Editor/pngquant.meta deleted file mode 100644 index a9820324..00000000 --- a/Assets/WX-WASM-SDK/Editor/pngquant.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9c8a26c1e0f8d45e7a9101be92d8adbf -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/HideLoadingPage.cs b/Assets/WX-WASM-SDK/HideLoadingPage.cs deleted file mode 100644 index c51fd4d4..00000000 --- a/Assets/WX-WASM-SDK/HideLoadingPage.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using UnityEngine; -using WeChatWASM; - -class CheckFrame : MonoBehaviour -{ - int frameCnt = 0; - private void Update() - { - frameCnt++; - if (frameCnt == 2) - { - #if UNITY_WEBGL && !UNITY_EDITOR - WX.HideLoadingPage(); - #endif - Destroy(this); - } - } -} - -class HideLoadingPage : MonoBehaviour -{ - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] - static void OnGameLaunch() - { - var gameObject = new GameObject("HideLoadingPage"); - gameObject.AddComponent(); - DontDestroyOnLoad(gameObject); - } -} diff --git a/Assets/WX-WASM-SDK/HideLoadingPage.cs.meta b/Assets/WX-WASM-SDK/HideLoadingPage.cs.meta deleted file mode 100644 index 7c239830..00000000 --- a/Assets/WX-WASM-SDK/HideLoadingPage.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 28cdb455a291e4dbe8461c89cee5fbda -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson.meta b/Assets/WX-WASM-SDK/LitJson.meta deleted file mode 100644 index 7510ef84..00000000 --- a/Assets/WX-WASM-SDK/LitJson.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: daf2ebf122d944454950109082ca218f -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/Extensions.cs b/Assets/WX-WASM-SDK/LitJson/Extensions.cs deleted file mode 100644 index 2eac2618..00000000 --- a/Assets/WX-WASM-SDK/LitJson/Extensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using UnityEngine; -using System.Collections; -using System; - -namespace LitJson.Extensions { - - /// - /// 拓展方法 - /// - public static class Extensions { - - public static void WriteProperty(this JsonWriter w,string name,long value){ - w.WritePropertyName(name); - w.Write(value); - } - - public static void WriteProperty(this JsonWriter w,string name,string value){ - w.WritePropertyName(name); - w.Write(value); - } - - public static void WriteProperty(this JsonWriter w,string name,bool value){ - w.WritePropertyName(name); - w.Write(value); - } - - public static void WriteProperty(this JsonWriter w,string name,double value){ - w.WritePropertyName(name); - w.Write(value); - } - - } - - /// - /// 跳过序列化的标签 - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] - public sealed class JsonIgnore : Attribute - { - - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/LitJson/Extensions.cs.meta b/Assets/WX-WASM-SDK/LitJson/Extensions.cs.meta deleted file mode 100644 index c800e189..00000000 --- a/Assets/WX-WASM-SDK/LitJson/Extensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 400863f70eb9d4413a8916361870278b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/IJsonWrapper.cs b/Assets/WX-WASM-SDK/LitJson/IJsonWrapper.cs deleted file mode 100644 index 9b7e2d16..00000000 --- a/Assets/WX-WASM-SDK/LitJson/IJsonWrapper.cs +++ /dev/null @@ -1,60 +0,0 @@ -#region Header -/** - * IJsonWrapper.cs - * Interface that represents a type capable of handling all kinds of JSON - * data. This is mainly used when mapping objects through JsonMapper, and - * it's implemented by JsonData. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System.Collections; -using System.Collections.Specialized; - - -namespace LitJson -{ - public enum JsonType - { - None, - - Object, - Array, - String, - Int, - Long, - Double, - Boolean - } - - public interface IJsonWrapper : IList, IOrderedDictionary - { - bool IsArray { get; } - bool IsBoolean { get; } - bool IsDouble { get; } - bool IsInt { get; } - bool IsLong { get; } - bool IsObject { get; } - bool IsString { get; } - - bool GetBoolean (); - double GetDouble (); - int GetInt (); - JsonType GetJsonType (); - long GetLong (); - string GetString (); - - void SetBoolean (bool val); - void SetDouble (double val); - void SetInt (int val); - void SetJsonType (JsonType type); - void SetLong (long val); - void SetString (string val); - - string ToJson (); - void ToJson (JsonWriter writer); - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/IJsonWrapper.cs.meta b/Assets/WX-WASM-SDK/LitJson/IJsonWrapper.cs.meta deleted file mode 100644 index 3ece6f5f..00000000 --- a/Assets/WX-WASM-SDK/LitJson/IJsonWrapper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: eb2f54a2abf601f47b1ab025d7613baf -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/JsonData.cs b/Assets/WX-WASM-SDK/LitJson/JsonData.cs deleted file mode 100644 index e89e4b14..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonData.cs +++ /dev/null @@ -1,1059 +0,0 @@ -#region Header -/** - * JsonData.cs - * Generic type to hold JSON data (objects, arrays, and so on). This is - * the default type returned by JsonMapper.ToObject(). - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; - - -namespace LitJson -{ - public class JsonData : IJsonWrapper, IEquatable - { - #region Fields - private IList inst_array; - private bool inst_boolean; - private double inst_double; - private int inst_int; - private long inst_long; - private IDictionary inst_object; - private string inst_string; - private string json; - private JsonType type; - - // Used to implement the IOrderedDictionary interface - private IList> object_list; - #endregion - - - #region Properties - public int Count { - get { return EnsureCollection ().Count; } - } - - public bool IsArray { - get { return type == JsonType.Array; } - } - - public bool IsBoolean { - get { return type == JsonType.Boolean; } - } - - public bool IsDouble { - get { return type == JsonType.Double; } - } - - public bool IsInt { - get { return type == JsonType.Int; } - } - - public bool IsLong { - get { return type == JsonType.Long; } - } - - public bool IsObject { - get { return type == JsonType.Object; } - } - - public bool IsString { - get { return type == JsonType.String; } - } - - public ICollection Keys { - get { EnsureDictionary (); return inst_object.Keys; } - } - - /// - /// Determines whether the json contains an element that has the specified key. - /// - /// The key to locate in the json. - /// true if the json contains an element that has the specified key; otherwise, false. - public Boolean ContainsKey(String key) { - EnsureDictionary(); - return this.inst_object.Keys.Contains(key); - } - #endregion - - - #region ICollection Properties - int ICollection.Count { - get { - return Count; - } - } - - bool ICollection.IsSynchronized { - get { - return EnsureCollection ().IsSynchronized; - } - } - - object ICollection.SyncRoot { - get { - return EnsureCollection ().SyncRoot; - } - } - #endregion - - - #region IDictionary Properties - bool IDictionary.IsFixedSize { - get { - return EnsureDictionary ().IsFixedSize; - } - } - - bool IDictionary.IsReadOnly { - get { - return EnsureDictionary ().IsReadOnly; - } - } - - ICollection IDictionary.Keys { - get { - EnsureDictionary (); - IList keys = new List (); - - foreach (KeyValuePair entry in - object_list) { - keys.Add (entry.Key); - } - - return (ICollection) keys; - } - } - - ICollection IDictionary.Values { - get { - EnsureDictionary (); - IList values = new List (); - - foreach (KeyValuePair entry in - object_list) { - values.Add (entry.Value); - } - - return (ICollection) values; - } - } - #endregion - - - - #region IJsonWrapper Properties - bool IJsonWrapper.IsArray { - get { return IsArray; } - } - - bool IJsonWrapper.IsBoolean { - get { return IsBoolean; } - } - - bool IJsonWrapper.IsDouble { - get { return IsDouble; } - } - - bool IJsonWrapper.IsInt { - get { return IsInt; } - } - - bool IJsonWrapper.IsLong { - get { return IsLong; } - } - - bool IJsonWrapper.IsObject { - get { return IsObject; } - } - - bool IJsonWrapper.IsString { - get { return IsString; } - } - #endregion - - - #region IList Properties - bool IList.IsFixedSize { - get { - return EnsureList ().IsFixedSize; - } - } - - bool IList.IsReadOnly { - get { - return EnsureList ().IsReadOnly; - } - } - #endregion - - - #region IDictionary Indexer - object IDictionary.this[object key] { - get { - return EnsureDictionary ()[key]; - } - - set { - if (! (key is String)) - throw new ArgumentException ( - "The key has to be a string"); - - JsonData data = ToJsonData (value); - - this[(string) key] = data; - } - } - #endregion - - - #region IOrderedDictionary Indexer - object IOrderedDictionary.this[int idx] { - get { - EnsureDictionary (); - return object_list[idx].Value; - } - - set { - EnsureDictionary (); - JsonData data = ToJsonData (value); - - KeyValuePair old_entry = object_list[idx]; - - inst_object[old_entry.Key] = data; - - KeyValuePair entry = - new KeyValuePair (old_entry.Key, data); - - object_list[idx] = entry; - } - } - #endregion - - - #region IList Indexer - object IList.this[int index] { - get { - return EnsureList ()[index]; - } - - set { - EnsureList (); - JsonData data = ToJsonData (value); - - this[index] = data; - } - } - #endregion - - - #region Public Indexers - public JsonData this[string prop_name] { - get { - EnsureDictionary (); - return inst_object[prop_name]; - } - - set { - EnsureDictionary (); - - KeyValuePair entry = - new KeyValuePair (prop_name, value); - - if (inst_object.ContainsKey (prop_name)) { - for (int i = 0; i < object_list.Count; i++) { - if (object_list[i].Key == prop_name) { - object_list[i] = entry; - break; - } - } - } else - object_list.Add (entry); - - inst_object[prop_name] = value; - - json = null; - } - } - - public JsonData this[int index] { - get { - EnsureCollection (); - - if (type == JsonType.Array) - return inst_array[index]; - - return object_list[index].Value; - } - - set { - EnsureCollection (); - - if (type == JsonType.Array) - inst_array[index] = value; - else { - KeyValuePair entry = object_list[index]; - KeyValuePair new_entry = - new KeyValuePair (entry.Key, value); - - object_list[index] = new_entry; - inst_object[entry.Key] = value; - } - - json = null; - } - } - #endregion - - - #region Constructors - public JsonData () - { - } - - public JsonData (bool boolean) - { - type = JsonType.Boolean; - inst_boolean = boolean; - } - - public JsonData (double number) - { - type = JsonType.Double; - inst_double = number; - } - - public JsonData (int number) - { - type = JsonType.Int; - inst_int = number; - } - - public JsonData (long number) - { - type = JsonType.Long; - inst_long = number; - } - - public JsonData (object obj) - { - if (obj is Boolean) { - type = JsonType.Boolean; - inst_boolean = (bool) obj; - return; - } - - if (obj is Double) { - type = JsonType.Double; - inst_double = (double) obj; - return; - } - - if (obj is Int32) { - type = JsonType.Int; - inst_int = (int) obj; - return; - } - - if (obj is Int64) { - type = JsonType.Long; - inst_long = (long) obj; - return; - } - - if (obj is String) { - type = JsonType.String; - inst_string = (string) obj; - return; - } - - throw new ArgumentException ( - "Unable to wrap the given object with JsonData"); - } - - public JsonData (string str) - { - type = JsonType.String; - inst_string = str; - } - #endregion - - - #region Implicit Conversions - public static implicit operator JsonData (Boolean data) - { - return new JsonData (data); - } - - public static implicit operator JsonData (Double data) - { - return new JsonData (data); - } - - public static implicit operator JsonData (Int32 data) - { - return new JsonData (data); - } - - public static implicit operator JsonData (Int64 data) - { - return new JsonData (data); - } - - public static implicit operator JsonData (String data) - { - return new JsonData (data); - } - #endregion - - - #region Explicit Conversions - public static explicit operator Boolean (JsonData data) - { - if (data.type != JsonType.Boolean) - throw new InvalidCastException ( - "Instance of JsonData doesn't hold a double"); - - return data.inst_boolean; - } - - public static explicit operator Double (JsonData data) - { - if (data.type != JsonType.Double) - throw new InvalidCastException ( - "Instance of JsonData doesn't hold a double"); - - return data.inst_double; - } - - public static explicit operator Int32(JsonData data) - { - if (data.type != JsonType.Int && data.type != JsonType.Long) - { - throw new InvalidCastException( - "Instance of JsonData doesn't hold an int"); - } - - // cast may truncate data... but that's up to the user to consider - return data.type == JsonType.Int ? data.inst_int : (int)data.inst_long; - } - - public static explicit operator Int64(JsonData data) - { - if (data.type != JsonType.Long && data.type != JsonType.Int) - { - throw new InvalidCastException( - "Instance of JsonData doesn't hold a long"); - } - - return data.type == JsonType.Long ? data.inst_long : data.inst_int; - } - - public static explicit operator String (JsonData data) - { - if (data.type != JsonType.String) - throw new InvalidCastException ( - "Instance of JsonData doesn't hold a string"); - - return data.inst_string; - } - #endregion - - - #region ICollection Methods - void ICollection.CopyTo (Array array, int index) - { - EnsureCollection ().CopyTo (array, index); - } - #endregion - - - #region IDictionary Methods - void IDictionary.Add (object key, object value) - { - JsonData data = ToJsonData (value); - - EnsureDictionary ().Add (key, data); - - KeyValuePair entry = - new KeyValuePair ((string) key, data); - object_list.Add (entry); - - json = null; - } - - void IDictionary.Clear () - { - EnsureDictionary ().Clear (); - object_list.Clear (); - json = null; - } - - bool IDictionary.Contains (object key) - { - return EnsureDictionary ().Contains (key); - } - - IDictionaryEnumerator IDictionary.GetEnumerator () - { - return ((IOrderedDictionary) this).GetEnumerator (); - } - - void IDictionary.Remove (object key) - { - EnsureDictionary ().Remove (key); - - for (int i = 0; i < object_list.Count; i++) { - if (object_list[i].Key == (string) key) { - object_list.RemoveAt (i); - break; - } - } - - json = null; - } - #endregion - - - #region IEnumerable Methods - IEnumerator IEnumerable.GetEnumerator () - { - return EnsureCollection ().GetEnumerator (); - } - #endregion - - - #region IJsonWrapper Methods - bool IJsonWrapper.GetBoolean () - { - if (type != JsonType.Boolean) - throw new InvalidOperationException ( - "JsonData instance doesn't hold a boolean"); - - return inst_boolean; - } - - double IJsonWrapper.GetDouble () - { - if (type != JsonType.Double) - throw new InvalidOperationException ( - "JsonData instance doesn't hold a double"); - - return inst_double; - } - - int IJsonWrapper.GetInt () - { - if (type != JsonType.Int) - throw new InvalidOperationException ( - "JsonData instance doesn't hold an int"); - - return inst_int; - } - - long IJsonWrapper.GetLong () - { - if (type != JsonType.Long) - throw new InvalidOperationException ( - "JsonData instance doesn't hold a long"); - - return inst_long; - } - - string IJsonWrapper.GetString () - { - if (type != JsonType.String) - throw new InvalidOperationException ( - "JsonData instance doesn't hold a string"); - - return inst_string; - } - - void IJsonWrapper.SetBoolean (bool val) - { - type = JsonType.Boolean; - inst_boolean = val; - json = null; - } - - void IJsonWrapper.SetDouble (double val) - { - type = JsonType.Double; - inst_double = val; - json = null; - } - - void IJsonWrapper.SetInt (int val) - { - type = JsonType.Int; - inst_int = val; - json = null; - } - - void IJsonWrapper.SetLong (long val) - { - type = JsonType.Long; - inst_long = val; - json = null; - } - - void IJsonWrapper.SetString (string val) - { - type = JsonType.String; - inst_string = val; - json = null; - } - - string IJsonWrapper.ToJson () - { - return ToJson (); - } - - void IJsonWrapper.ToJson (JsonWriter writer) - { - ToJson (writer); - } - #endregion - - - #region IList Methods - int IList.Add (object value) - { - return Add (value); - } - - void IList.Clear () - { - EnsureList ().Clear (); - json = null; - } - - bool IList.Contains (object value) - { - return EnsureList ().Contains (value); - } - - int IList.IndexOf (object value) - { - return EnsureList ().IndexOf (value); - } - - void IList.Insert (int index, object value) - { - EnsureList ().Insert (index, value); - json = null; - } - - void IList.Remove (object value) - { - EnsureList ().Remove (value); - json = null; - } - - void IList.RemoveAt (int index) - { - EnsureList ().RemoveAt (index); - json = null; - } - #endregion - - - #region IOrderedDictionary Methods - IDictionaryEnumerator IOrderedDictionary.GetEnumerator () - { - EnsureDictionary (); - - return new OrderedDictionaryEnumerator ( - object_list.GetEnumerator ()); - } - - void IOrderedDictionary.Insert (int idx, object key, object value) - { - string property = (string) key; - JsonData data = ToJsonData (value); - - this[property] = data; - - KeyValuePair entry = - new KeyValuePair (property, data); - - object_list.Insert (idx, entry); - } - - void IOrderedDictionary.RemoveAt (int idx) - { - EnsureDictionary (); - - inst_object.Remove (object_list[idx].Key); - object_list.RemoveAt (idx); - } - #endregion - - - #region Private Methods - private ICollection EnsureCollection () - { - if (type == JsonType.Array) - return (ICollection) inst_array; - - if (type == JsonType.Object) - return (ICollection) inst_object; - - throw new InvalidOperationException ( - "The JsonData instance has to be initialized first"); - } - - private IDictionary EnsureDictionary () - { - if (type == JsonType.Object) - return (IDictionary) inst_object; - - if (type != JsonType.None) - throw new InvalidOperationException ( - "Instance of JsonData is not a dictionary"); - - type = JsonType.Object; - inst_object = new Dictionary (); - object_list = new List> (); - - return (IDictionary) inst_object; - } - - private IList EnsureList () - { - if (type == JsonType.Array) - return (IList) inst_array; - - if (type != JsonType.None) - throw new InvalidOperationException ( - "Instance of JsonData is not a list"); - - type = JsonType.Array; - inst_array = new List (); - - return (IList) inst_array; - } - - private JsonData ToJsonData (object obj) - { - if (obj == null) - return null; - - if (obj is JsonData) - return (JsonData) obj; - - return new JsonData (obj); - } - - private static void WriteJson (IJsonWrapper obj, JsonWriter writer) - { - if (obj == null) { - writer.Write (null); - return; - } - - if (obj.IsString) { - writer.Write (obj.GetString ()); - return; - } - - if (obj.IsBoolean) { - writer.Write (obj.GetBoolean ()); - return; - } - - if (obj.IsDouble) { - writer.Write (obj.GetDouble ()); - return; - } - - if (obj.IsInt) { - writer.Write (obj.GetInt ()); - return; - } - - if (obj.IsLong) { - writer.Write (obj.GetLong ()); - return; - } - - if (obj.IsArray) { - writer.WriteArrayStart (); - foreach (object elem in (IList) obj) - WriteJson ((JsonData) elem, writer); - writer.WriteArrayEnd (); - - return; - } - - if (obj.IsObject) { - writer.WriteObjectStart (); - - foreach (DictionaryEntry entry in ((IDictionary) obj)) { - writer.WritePropertyName ((string) entry.Key); - WriteJson ((JsonData) entry.Value, writer); - } - writer.WriteObjectEnd (); - - return; - } - } - #endregion - - - public int Add (object value) - { - JsonData data = ToJsonData (value); - - json = null; - - return EnsureList ().Add (data); - } - - public bool Remove(object obj) - { - json = null; - if(IsObject) - { - JsonData value = null; - if (inst_object.TryGetValue((string)obj, out value)) - return inst_object.Remove((string)obj) && object_list.Remove(new KeyValuePair((string)obj, value)); - else - throw new KeyNotFoundException("The specified key was not found in the JsonData object."); - } - if(IsArray) - { - return inst_array.Remove(ToJsonData(obj)); - } - throw new InvalidOperationException ( - "Instance of JsonData is not an object or a list."); - } - - public void Clear () - { - if (IsObject) { - ((IDictionary) this).Clear (); - return; - } - - if (IsArray) { - ((IList) this).Clear (); - return; - } - } - - public bool Equals (JsonData x) - { - if (x == null) - return false; - - if (x.type != this.type) - { - // further check to see if this is a long to int comparison - if ((x.type != JsonType.Int && x.type != JsonType.Long) - || (this.type != JsonType.Int && this.type != JsonType.Long)) - { - return false; - } - } - - switch (this.type) { - case JsonType.None: - return true; - - case JsonType.Object: - return this.inst_object.Equals (x.inst_object); - - case JsonType.Array: - return this.inst_array.Equals (x.inst_array); - - case JsonType.String: - return this.inst_string.Equals (x.inst_string); - - case JsonType.Int: - { - if (x.IsLong) - { - if (x.inst_long < Int32.MinValue || x.inst_long > Int32.MaxValue) - return false; - return this.inst_int.Equals((int)x.inst_long); - } - return this.inst_int.Equals(x.inst_int); - } - - case JsonType.Long: - { - if (x.IsInt) - { - if (this.inst_long < Int32.MinValue || this.inst_long > Int32.MaxValue) - return false; - return x.inst_int.Equals((int)this.inst_long); - } - return this.inst_long.Equals(x.inst_long); - } - - case JsonType.Double: - return this.inst_double.Equals (x.inst_double); - - case JsonType.Boolean: - return this.inst_boolean.Equals (x.inst_boolean); - } - - return false; - } - - public JsonType GetJsonType () - { - return type; - } - - public void SetJsonType (JsonType type) - { - if (this.type == type) - return; - - switch (type) { - case JsonType.None: - break; - - case JsonType.Object: - inst_object = new Dictionary (); - object_list = new List> (); - break; - - case JsonType.Array: - inst_array = new List (); - break; - - case JsonType.String: - inst_string = default (String); - break; - - case JsonType.Int: - inst_int = default (Int32); - break; - - case JsonType.Long: - inst_long = default (Int64); - break; - - case JsonType.Double: - inst_double = default (Double); - break; - - case JsonType.Boolean: - inst_boolean = default (Boolean); - break; - } - - this.type = type; - } - - public string ToJson () - { - if (json != null) - return json; - - StringWriter sw = new StringWriter (); - JsonWriter writer = new JsonWriter (sw); - writer.Validate = false; - - WriteJson (this, writer); - json = sw.ToString (); - - return json; - } - - public void ToJson (JsonWriter writer) - { - bool old_validate = writer.Validate; - - writer.Validate = false; - - WriteJson (this, writer); - - writer.Validate = old_validate; - } - - public override string ToString () - { - switch (type) { - case JsonType.Array: - return "JsonData array"; - - case JsonType.Boolean: - return inst_boolean.ToString (); - - case JsonType.Double: - return inst_double.ToString (); - - case JsonType.Int: - return inst_int.ToString (); - - case JsonType.Long: - return inst_long.ToString (); - - case JsonType.Object: - return "JsonData object"; - - case JsonType.String: - return inst_string; - } - - return "Uninitialized JsonData"; - } - } - - - internal class OrderedDictionaryEnumerator : IDictionaryEnumerator - { - IEnumerator> list_enumerator; - - - public object Current { - get { return Entry; } - } - - public DictionaryEntry Entry { - get { - KeyValuePair curr = list_enumerator.Current; - return new DictionaryEntry (curr.Key, curr.Value); - } - } - - public object Key { - get { return list_enumerator.Current.Key; } - } - - public object Value { - get { return list_enumerator.Current.Value; } - } - - - public OrderedDictionaryEnumerator ( - IEnumerator> enumerator) - { - list_enumerator = enumerator; - } - - - public bool MoveNext () - { - return list_enumerator.MoveNext (); - } - - public void Reset () - { - list_enumerator.Reset (); - } - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/JsonData.cs.meta b/Assets/WX-WASM-SDK/LitJson/JsonData.cs.meta deleted file mode 100644 index 21b3a582..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 097177d25014df948bc2617fa0218d50 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/JsonException.cs b/Assets/WX-WASM-SDK/LitJson/JsonException.cs deleted file mode 100644 index 4efd8905..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonException.cs +++ /dev/null @@ -1,65 +0,0 @@ -#region Header -/** - * JsonException.cs - * Base class throwed by LitJSON when a parsing error occurs. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System; - - -namespace LitJson -{ - public class JsonException : -#if NETSTANDARD1_5 - Exception -#else - ApplicationException -#endif - { - public JsonException () : base () - { - } - - internal JsonException (ParserToken token) : - base (String.Format ( - "Invalid token '{0}' in input string", token)) - { - } - - internal JsonException (ParserToken token, - Exception inner_exception) : - base (String.Format ( - "Invalid token '{0}' in input string", token), - inner_exception) - { - } - - internal JsonException (int c) : - base (String.Format ( - "Invalid character '{0}' in input string", (char) c)) - { - } - - internal JsonException (int c, Exception inner_exception) : - base (String.Format ( - "Invalid character '{0}' in input string", (char) c), - inner_exception) - { - } - - - public JsonException (string message) : base (message) - { - } - - public JsonException (string message, Exception inner_exception) : - base (message, inner_exception) - { - } - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/JsonException.cs.meta b/Assets/WX-WASM-SDK/LitJson/JsonException.cs.meta deleted file mode 100644 index f02aad8f..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonException.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 989a79800187e2c45870b7ba2851cb9f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/JsonMapper.cs b/Assets/WX-WASM-SDK/LitJson/JsonMapper.cs deleted file mode 100644 index 47c3c7ed..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonMapper.cs +++ /dev/null @@ -1,987 +0,0 @@ -#region Header -/** - * JsonMapper.cs - * JSON to .Net object and object to JSON conversions. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Reflection; -using LitJson.Extensions; - - -namespace LitJson -{ - internal struct PropertyMetadata - { - public MemberInfo Info; - public bool IsField; - public Type Type; - } - - - internal struct ArrayMetadata - { - private Type element_type; - private bool is_array; - private bool is_list; - - - public Type ElementType { - get { - if (element_type == null) - return typeof (JsonData); - - return element_type; - } - - set { element_type = value; } - } - - public bool IsArray { - get { return is_array; } - set { is_array = value; } - } - - public bool IsList { - get { return is_list; } - set { is_list = value; } - } - } - - - internal struct ObjectMetadata - { - private Type element_type; - private bool is_dictionary; - - private IDictionary properties; - - - public Type ElementType { - get { - if (element_type == null) - return typeof (JsonData); - - return element_type; - } - - set { element_type = value; } - } - - public bool IsDictionary { - get { return is_dictionary; } - set { is_dictionary = value; } - } - - public IDictionary Properties { - get { return properties; } - set { properties = value; } - } - } - - - internal delegate void ExporterFunc (object obj, JsonWriter writer); - public delegate void ExporterFunc (T obj, JsonWriter writer); - - internal delegate object ImporterFunc (object input); - public delegate TValue ImporterFunc (TJson input); - - public delegate IJsonWrapper WrapperFactory (); - - - public class JsonMapper - { - #region Fields - private static readonly int max_nesting_depth; - - private static readonly IFormatProvider datetime_format; - - private static readonly IDictionary base_exporters_table; - private static readonly IDictionary custom_exporters_table; - - private static readonly IDictionary> base_importers_table; - private static readonly IDictionary> custom_importers_table; - - private static readonly IDictionary array_metadata; - private static readonly object array_metadata_lock = new Object (); - - private static readonly IDictionary> conv_ops; - private static readonly object conv_ops_lock = new Object (); - - private static readonly IDictionary object_metadata; - private static readonly object object_metadata_lock = new Object (); - - private static readonly IDictionary> type_properties; - private static readonly object type_properties_lock = new Object (); - - private static readonly JsonWriter static_writer; - private static readonly object static_writer_lock = new Object (); - #endregion - - - #region Constructors - static JsonMapper () - { - max_nesting_depth = 100; - - array_metadata = new Dictionary (); - conv_ops = new Dictionary> (); - object_metadata = new Dictionary (); - type_properties = new Dictionary> (); - - static_writer = new JsonWriter (); - - datetime_format = DateTimeFormatInfo.InvariantInfo; - - base_exporters_table = new Dictionary (); - custom_exporters_table = new Dictionary (); - - base_importers_table = new Dictionary> (); - custom_importers_table = new Dictionary> (); - - RegisterBaseExporters (); - RegisterBaseImporters (); - UnityTypeBindings.Register(); - } - #endregion - - - #region Private Methods - private static void AddArrayMetadata (Type type) - { - if (array_metadata.ContainsKey (type)) - return; - - ArrayMetadata data = new ArrayMetadata (); - - data.IsArray = type.IsArray; - - if (type.GetInterface ("System.Collections.IList") != null) - data.IsList = true; - - foreach (PropertyInfo p_info in type.GetProperties ()) { - if (p_info.Name != "Item") - continue; - - ParameterInfo[] parameters = p_info.GetIndexParameters (); - - if (parameters.Length != 1) - continue; - - if (parameters[0].ParameterType == typeof (int)) - data.ElementType = p_info.PropertyType; - } - - lock (array_metadata_lock) { - try { - array_metadata.Add (type, data); - } catch (ArgumentException) { - return; - } - } - } - - private static void AddObjectMetadata (Type type) - { - if (object_metadata.ContainsKey (type)) - return; - - ObjectMetadata data = new ObjectMetadata (); - - if (type.GetInterface ("System.Collections.IDictionary") != null) - data.IsDictionary = true; - - data.Properties = new Dictionary (); - - foreach (PropertyInfo p_info in type.GetProperties ()) { - if (p_info.Name == "Item") { - ParameterInfo[] parameters = p_info.GetIndexParameters (); - - if (parameters.Length != 1) - continue; - - if (parameters[0].ParameterType == typeof (string)) - data.ElementType = p_info.PropertyType; - - continue; - } - - PropertyMetadata p_data = new PropertyMetadata (); - p_data.Info = p_info; - p_data.Type = p_info.PropertyType; - - data.Properties.Add (p_info.Name, p_data); - } - - foreach (FieldInfo f_info in type.GetFields ()) { - PropertyMetadata p_data = new PropertyMetadata (); - p_data.Info = f_info; - p_data.IsField = true; - p_data.Type = f_info.FieldType; - - data.Properties.Add (f_info.Name, p_data); - } - - lock (object_metadata_lock) { - try { - object_metadata.Add (type, data); - } catch (ArgumentException) { - return; - } - } - } - - private static void AddTypeProperties (Type type) - { - if (type_properties.ContainsKey (type)) - return; - - IList props = new List (); - - foreach (PropertyInfo p_info in type.GetProperties ()) { - if (p_info.Name == "Item") - continue; - - PropertyMetadata p_data = new PropertyMetadata (); - p_data.Info = p_info; - p_data.IsField = false; - props.Add (p_data); - } - - foreach (FieldInfo f_info in type.GetFields ()) { - PropertyMetadata p_data = new PropertyMetadata (); - p_data.Info = f_info; - p_data.IsField = true; - - props.Add (p_data); - } - - lock (type_properties_lock) { - try { - type_properties.Add (type, props); - } catch (ArgumentException) { - return; - } - } - } - - private static MethodInfo GetConvOp (Type t1, Type t2) - { - lock (conv_ops_lock) { - if (! conv_ops.ContainsKey (t1)) - conv_ops.Add (t1, new Dictionary ()); - } - - if (conv_ops[t1].ContainsKey (t2)) - return conv_ops[t1][t2]; - - MethodInfo op = t1.GetMethod ( - "op_Implicit", new Type[] { t2 }); - - lock (conv_ops_lock) { - try { - conv_ops[t1].Add (t2, op); - } catch (ArgumentException) { - return conv_ops[t1][t2]; - } - } - - return op; - } - - private static object ReadValue (Type inst_type, JsonReader reader) - { - reader.Read (); - - if (reader.Token == JsonToken.ArrayEnd) - return null; - - Type underlying_type = Nullable.GetUnderlyingType(inst_type); - Type value_type = underlying_type ?? inst_type; - - if (reader.Token == JsonToken.Null) { - #if NETSTANDARD1_5 - if (inst_type.IsClass() || underlying_type != null) { - return null; - } - #else - if (inst_type.IsClass || underlying_type != null) { - return null; - } - #endif - - throw new JsonException (String.Format ( - "Can't assign null to an instance of type {0}", - inst_type)); - } - - if (reader.Token == JsonToken.Double || - reader.Token == JsonToken.Int || - reader.Token == JsonToken.Long || - reader.Token == JsonToken.String || - reader.Token == JsonToken.Boolean) { - - Type json_type = reader.Value.GetType (); - - if (value_type.IsAssignableFrom (json_type)) - return reader.Value; - - // If there's a custom importer that fits, use it - if (custom_importers_table.ContainsKey (json_type) && - custom_importers_table[json_type].ContainsKey ( - value_type)) { - - ImporterFunc importer = - custom_importers_table[json_type][value_type]; - - return importer (reader.Value); - } - - // Maybe there's a base importer that works - if (base_importers_table.ContainsKey (json_type) && - base_importers_table[json_type].ContainsKey ( - value_type)) { - - ImporterFunc importer = - base_importers_table[json_type][value_type]; - - return importer (reader.Value); - } - - // Maybe it's an enum - #if NETSTANDARD1_5 - if (value_type.IsEnum()) - return Enum.ToObject (value_type, reader.Value); - #else - if (value_type.IsEnum) - return Enum.ToObject (value_type, reader.Value); - #endif - // Try using an implicit conversion operator - MethodInfo conv_op = GetConvOp (value_type, json_type); - - if (conv_op != null) - return conv_op.Invoke (null, - new object[] { reader.Value }); - - // No luck - throw new JsonException (String.Format ( - "Can't assign value '{0}' (type {1}) to type {2}", - reader.Value, json_type, inst_type)); - } - - object instance = null; - - if (reader.Token == JsonToken.ArrayStart) { - - AddArrayMetadata (inst_type); - ArrayMetadata t_data = array_metadata[inst_type]; - - if (! t_data.IsArray && ! t_data.IsList) - throw new JsonException (String.Format ( - "Type {0} can't act as an array", - inst_type)); - - IList list; - Type elem_type; - - if (! t_data.IsArray) { - list = (IList) Activator.CreateInstance (inst_type); - elem_type = t_data.ElementType; - } else { - list = new ArrayList (); - elem_type = inst_type.GetElementType (); - } - - list.Clear(); - - while (true) { - object item = ReadValue (elem_type, reader); - if (item == null && reader.Token == JsonToken.ArrayEnd) - break; - - list.Add (item); - } - - if (t_data.IsArray) { - int n = list.Count; - instance = Array.CreateInstance (elem_type, n); - - for (int i = 0; i < n; i++) - ((Array) instance).SetValue (list[i], i); - } else - instance = list; - - } else if (reader.Token == JsonToken.ObjectStart) { - AddObjectMetadata (value_type); - ObjectMetadata t_data = object_metadata[value_type]; - - instance = Activator.CreateInstance (value_type); - - while (true) { - reader.Read (); - - if (reader.Token == JsonToken.ObjectEnd) - break; - - string property = (string) reader.Value; - - if (t_data.Properties.ContainsKey (property)) { - PropertyMetadata prop_data = - t_data.Properties[property]; - - if (prop_data.IsField) { - ((FieldInfo) prop_data.Info).SetValue ( - instance, ReadValue (prop_data.Type, reader)); - } else { - PropertyInfo p_info = - (PropertyInfo) prop_data.Info; - - if (p_info.CanWrite) - p_info.SetValue ( - instance, - ReadValue (prop_data.Type, reader), - null); - else - ReadValue (prop_data.Type, reader); - } - - } else { - if (! t_data.IsDictionary) { - - if (! reader.SkipNonMembers) { - throw new JsonException (String.Format ( - "The type {0} doesn't have the " + - "property '{1}'", - inst_type, property)); - } else { - ReadSkip (reader); - continue; - } - } - - ((IDictionary) instance).Add ( - property, ReadValue ( - t_data.ElementType, reader)); - } - - } - - } - - return instance; - } - - private static IJsonWrapper ReadValue (WrapperFactory factory, - JsonReader reader) - { - reader.Read (); - - if (reader.Token == JsonToken.ArrayEnd || - reader.Token == JsonToken.Null) - return null; - - IJsonWrapper instance = factory (); - - if (reader.Token == JsonToken.String) { - instance.SetString ((string) reader.Value); - return instance; - } - - if (reader.Token == JsonToken.Double) { - instance.SetDouble ((double) reader.Value); - return instance; - } - - if (reader.Token == JsonToken.Int) { - instance.SetInt ((int) reader.Value); - return instance; - } - - if (reader.Token == JsonToken.Long) { - instance.SetLong ((long) reader.Value); - return instance; - } - - if (reader.Token == JsonToken.Boolean) { - instance.SetBoolean ((bool) reader.Value); - return instance; - } - - if (reader.Token == JsonToken.ArrayStart) { - instance.SetJsonType (JsonType.Array); - - while (true) { - IJsonWrapper item = ReadValue (factory, reader); - if (item == null && reader.Token == JsonToken.ArrayEnd) - break; - - ((IList) instance).Add (item); - } - } - else if (reader.Token == JsonToken.ObjectStart) { - instance.SetJsonType (JsonType.Object); - - while (true) { - reader.Read (); - - if (reader.Token == JsonToken.ObjectEnd) - break; - - string property = (string) reader.Value; - - ((IDictionary) instance)[property] = ReadValue ( - factory, reader); - } - - } - - return instance; - } - - private static void ReadSkip (JsonReader reader) - { - ToWrapper ( - delegate { return new JsonMockWrapper (); }, reader); - } - - private static void RegisterBaseExporters () - { - base_exporters_table[typeof (byte)] = - delegate (object obj, JsonWriter writer) { - writer.Write (Convert.ToInt32 ((byte) obj)); - }; - - base_exporters_table[typeof (char)] = - delegate (object obj, JsonWriter writer) { - writer.Write (Convert.ToString ((char) obj)); - }; - - base_exporters_table[typeof (DateTime)] = - delegate (object obj, JsonWriter writer) { - writer.Write (Convert.ToString ((DateTime) obj, - datetime_format)); - }; - - base_exporters_table[typeof (decimal)] = - delegate (object obj, JsonWriter writer) { - writer.Write ((decimal) obj); - }; - - base_exporters_table[typeof (sbyte)] = - delegate (object obj, JsonWriter writer) { - writer.Write (Convert.ToInt32 ((sbyte) obj)); - }; - - base_exporters_table[typeof (short)] = - delegate (object obj, JsonWriter writer) { - writer.Write (Convert.ToInt32 ((short) obj)); - }; - - base_exporters_table[typeof (ushort)] = - delegate (object obj, JsonWriter writer) { - writer.Write (Convert.ToInt32 ((ushort) obj)); - }; - - base_exporters_table[typeof (uint)] = - delegate (object obj, JsonWriter writer) { - writer.Write (Convert.ToUInt64 ((uint) obj)); - }; - - base_exporters_table[typeof (ulong)] = - delegate (object obj, JsonWriter writer) { - writer.Write ((ulong) obj); - }; - - base_exporters_table[typeof(DateTimeOffset)] = - delegate (object obj, JsonWriter writer) { - writer.Write(((DateTimeOffset)obj).ToString("yyyy-MM-ddTHH:mm:ss.fffffffzzz", datetime_format)); - }; - } - - private static void RegisterBaseImporters () - { - ImporterFunc importer; - - importer = delegate (object input) { - return Convert.ToByte ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (byte), importer); - - importer = delegate (object input) { - return Convert.ToUInt64 ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (ulong), importer); - - importer = delegate (object input) { - return Convert.ToInt64((int)input); - }; - RegisterImporter(base_importers_table, typeof(int), - typeof(long), importer); - - importer = delegate (object input) { - return Convert.ToSByte ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (sbyte), importer); - - importer = delegate (object input) { - return Convert.ToInt16 ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (short), importer); - - importer = delegate (object input) { - return Convert.ToUInt16 ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (ushort), importer); - - importer = delegate (object input) { - return Convert.ToUInt32 ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (uint), importer); - - importer = delegate (object input) { - return Convert.ToSingle ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (float), importer); - - importer = delegate (object input) { - return Convert.ToDouble ((int) input); - }; - RegisterImporter (base_importers_table, typeof (int), - typeof (double), importer); - - importer = delegate (object input) { - return Convert.ToDecimal ((double) input); - }; - RegisterImporter (base_importers_table, typeof (double), - typeof (decimal), importer); - - importer = delegate (object input) { - return Convert.ToSingle((double)input); - }; - RegisterImporter(base_importers_table, typeof(double), - typeof(float), importer); - - importer = delegate (object input) { - return Convert.ToUInt32 ((long) input); - }; - RegisterImporter (base_importers_table, typeof (long), - typeof (uint), importer); - - importer = delegate (object input) { - return Convert.ToChar ((string) input); - }; - RegisterImporter (base_importers_table, typeof (string), - typeof (char), importer); - - importer = delegate (object input) { - return Convert.ToDateTime ((string) input, datetime_format); - }; - RegisterImporter (base_importers_table, typeof (string), - typeof (DateTime), importer); - - importer = delegate (object input) { - return DateTimeOffset.Parse((string)input, datetime_format); - }; - RegisterImporter(base_importers_table, typeof(string), - typeof(DateTimeOffset), importer); - } - - private static void RegisterImporter ( - IDictionary> table, - Type json_type, Type value_type, ImporterFunc importer) - { - if (! table.ContainsKey (json_type)) - table.Add (json_type, new Dictionary ()); - - table[json_type][value_type] = importer; - } - - private static void WriteValue (object obj, JsonWriter writer, - bool writer_is_private, - int depth) - { - if (depth > max_nesting_depth) - throw new JsonException ( - String.Format ("Max allowed object depth reached while " + - "trying to export from type {0}", - obj.GetType ())); - - if (obj == null) { - writer.Write (null); - return; - } - - if (obj is IJsonWrapper) { - if (writer_is_private) - writer.TextWriter.Write (((IJsonWrapper) obj).ToJson ()); - else - ((IJsonWrapper) obj).ToJson (writer); - - return; - } - - if (obj is String) { - writer.Write ((string) obj); - return; - } - - if (obj is Double) { - writer.Write ((double) obj); - return; - } - - if (obj is Single) - { - writer.Write((float)obj); - return; - } - - if (obj is Int32) { - writer.Write ((int) obj); - return; - } - - if (obj is Boolean) { - writer.Write ((bool) obj); - return; - } - - if (obj is Int64) { - writer.Write ((long) obj); - return; - } - - if (obj is Array) { - writer.WriteArrayStart (); - - foreach (object elem in (Array) obj) - WriteValue (elem, writer, writer_is_private, depth + 1); - - writer.WriteArrayEnd (); - - return; - } - - if (obj is IList) { - writer.WriteArrayStart (); - foreach (object elem in (IList) obj) - WriteValue (elem, writer, writer_is_private, depth + 1); - writer.WriteArrayEnd (); - - return; - } - #if UNITY_2018_3_OR_NEWER - if (obj is IDictionary dictionary) { - #else - if (obj is IDictionary) { - var dictionary = obj as IDictionary; - #endif - writer.WriteObjectStart (); - foreach (DictionaryEntry entry in dictionary) { - #if UNITY_2018_3_OR_NEWER - var propertyName = entry.Key is string key ? - key - : Convert.ToString(entry.Key, CultureInfo.InvariantCulture); - #else - var propertyName = entry.Key is string ? (entry.Key as string) : Convert.ToString(entry.Key, CultureInfo.InvariantCulture); - #endif - writer.WritePropertyName (propertyName); - WriteValue (entry.Value, writer, writer_is_private, - depth + 1); - } - writer.WriteObjectEnd (); - - return; - } - - Type obj_type = obj.GetType (); - - // See if there's a custom exporter for the object - if (custom_exporters_table.ContainsKey (obj_type)) { - ExporterFunc exporter = custom_exporters_table[obj_type]; - exporter (obj, writer); - - return; - } - - // If not, maybe there's a base exporter - if (base_exporters_table.ContainsKey (obj_type)) { - ExporterFunc exporter = base_exporters_table[obj_type]; - exporter (obj, writer); - - return; - } - - // Last option, let's see if it's an enum - if (obj is Enum) { - Type e_type = Enum.GetUnderlyingType (obj_type); - - if (e_type == typeof (long) - || e_type == typeof (uint) - || e_type == typeof (ulong)) - writer.Write ((ulong) obj); - else - writer.Write ((int) obj); - - return; - } - - // Okay, so it looks like the input should be exported as an - // object - AddTypeProperties (obj_type); - IList props = type_properties[obj_type]; - - writer.WriteObjectStart (); - foreach (PropertyMetadata p_data in props) { - if (p_data.IsField) { - writer.WritePropertyName (p_data.Info.Name); - WriteValue (((FieldInfo) p_data.Info).GetValue (obj), - writer, writer_is_private, depth + 1); - } - else { - PropertyInfo p_info = (PropertyInfo) p_data.Info; - - if (p_info.CanRead) { - writer.WritePropertyName (p_data.Info.Name); - WriteValue (p_info.GetValue (obj, null), - writer, writer_is_private, depth + 1); - } - } - } - writer.WriteObjectEnd (); - } - #endregion - - - public static string ToJson (object obj) - { - lock (static_writer_lock) { - static_writer.Reset (); - - WriteValue (obj, static_writer, true, 0); - - return static_writer.ToString (); - } - } - - public static void ToJson (object obj, JsonWriter writer) - { - WriteValue (obj, writer, false, 0); - } - - public static JsonData ToObject (JsonReader reader) - { - return (JsonData) ToWrapper ( - delegate { return new JsonData (); }, reader); - } - - public static JsonData ToObject (TextReader reader) - { - JsonReader json_reader = new JsonReader (reader); - - return (JsonData) ToWrapper ( - delegate { return new JsonData (); }, json_reader); - } - - public static JsonData ToObject (string json) - { - return (JsonData) ToWrapper ( - delegate { return new JsonData (); }, json); - } - - public static T ToObject (JsonReader reader) - { - return (T) ReadValue (typeof (T), reader); - } - - public static T ToObject (TextReader reader) - { - JsonReader json_reader = new JsonReader (reader); - - return (T) ReadValue (typeof (T), json_reader); - } - - public static T ToObject (string json) - { - JsonReader reader = new JsonReader (json); - - return (T) ReadValue (typeof (T), reader); - } - - public static object ToObject(string json, Type ConvertType ) - { - JsonReader reader = new JsonReader(json); - - return ReadValue(ConvertType, reader); - } - - public static IJsonWrapper ToWrapper (WrapperFactory factory, - JsonReader reader) - { - return ReadValue (factory, reader); - } - - public static IJsonWrapper ToWrapper (WrapperFactory factory, - string json) - { - JsonReader reader = new JsonReader (json); - - return ReadValue (factory, reader); - } - - public static void RegisterExporter (ExporterFunc exporter) - { - ExporterFunc exporter_wrapper = - delegate (object obj, JsonWriter writer) { - exporter ((T) obj, writer); - }; - - custom_exporters_table[typeof (T)] = exporter_wrapper; - } - - public static void RegisterImporter ( - ImporterFunc importer) - { - ImporterFunc importer_wrapper = - delegate (object input) { - return importer ((TJson) input); - }; - - RegisterImporter (custom_importers_table, typeof (TJson), - typeof (TValue), importer_wrapper); - } - - public static void UnregisterExporters () - { - custom_exporters_table.Clear (); - } - - public static void UnregisterImporters () - { - custom_importers_table.Clear (); - } - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/JsonMapper.cs.meta b/Assets/WX-WASM-SDK/LitJson/JsonMapper.cs.meta deleted file mode 100644 index 6343223b..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonMapper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6600783f47227f041b882927f4f98a8e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/JsonMockWrapper.cs b/Assets/WX-WASM-SDK/LitJson/JsonMockWrapper.cs deleted file mode 100644 index dfe7adb7..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonMockWrapper.cs +++ /dev/null @@ -1,105 +0,0 @@ -#region Header -/** - * JsonMockWrapper.cs - * Mock object implementing IJsonWrapper, to facilitate actions like - * skipping data more efficiently. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System; -using System.Collections; -using System.Collections.Specialized; - - -namespace LitJson -{ - public class JsonMockWrapper : IJsonWrapper - { - public bool IsArray { get { return false; } } - public bool IsBoolean { get { return false; } } - public bool IsDouble { get { return false; } } - public bool IsInt { get { return false; } } - public bool IsLong { get { return false; } } - public bool IsObject { get { return false; } } - public bool IsString { get { return false; } } - - public bool GetBoolean () { return false; } - public double GetDouble () { return 0.0; } - public int GetInt () { return 0; } - public JsonType GetJsonType () { return JsonType.None; } - public long GetLong () { return 0L; } - public string GetString () { return ""; } - - public void SetBoolean (bool val) {} - public void SetDouble (double val) {} - public void SetInt (int val) {} - public void SetJsonType (JsonType type) {} - public void SetLong (long val) {} - public void SetString (string val) {} - - public string ToJson () { return ""; } - public void ToJson (JsonWriter writer) {} - - - bool IList.IsFixedSize { get { return true; } } - bool IList.IsReadOnly { get { return true; } } - - object IList.this[int index] { - get { return null; } - set {} - } - - int IList.Add (object value) { return 0; } - void IList.Clear () {} - bool IList.Contains (object value) { return false; } - int IList.IndexOf (object value) { return -1; } - void IList.Insert (int i, object v) {} - void IList.Remove (object value) {} - void IList.RemoveAt (int index) {} - - - int ICollection.Count { get { return 0; } } - bool ICollection.IsSynchronized { get { return false; } } - object ICollection.SyncRoot { get { return null; } } - - void ICollection.CopyTo (Array array, int index) {} - - - IEnumerator IEnumerable.GetEnumerator () { return null; } - - - bool IDictionary.IsFixedSize { get { return true; } } - bool IDictionary.IsReadOnly { get { return true; } } - - ICollection IDictionary.Keys { get { return null; } } - ICollection IDictionary.Values { get { return null; } } - - object IDictionary.this[object key] { - get { return null; } - set {} - } - - void IDictionary.Add (object k, object v) {} - void IDictionary.Clear () {} - bool IDictionary.Contains (object key) { return false; } - void IDictionary.Remove (object key) {} - - IDictionaryEnumerator IDictionary.GetEnumerator () { return null; } - - - object IOrderedDictionary.this[int idx] { - get { return null; } - set {} - } - - IDictionaryEnumerator IOrderedDictionary.GetEnumerator () { - return null; - } - void IOrderedDictionary.Insert (int i, object k, object v) {} - void IOrderedDictionary.RemoveAt (int i) {} - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/JsonMockWrapper.cs.meta b/Assets/WX-WASM-SDK/LitJson/JsonMockWrapper.cs.meta deleted file mode 100644 index e75c1bfc..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonMockWrapper.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7b9d431ad6e3c3c438a2557310606181 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/JsonReader.cs b/Assets/WX-WASM-SDK/LitJson/JsonReader.cs deleted file mode 100644 index e47eabc5..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonReader.cs +++ /dev/null @@ -1,478 +0,0 @@ -#region Header -/** - * JsonReader.cs - * Stream-like access to JSON text. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Text; - - -namespace LitJson -{ - public enum JsonToken - { - None, - - ObjectStart, - PropertyName, - ObjectEnd, - - ArrayStart, - ArrayEnd, - - Int, - Long, - Double, - - String, - - Boolean, - Null - } - - - public class JsonReader - { - #region Fields - private static readonly IDictionary> parse_table; - - private Stack automaton_stack; - private int current_input; - private int current_symbol; - private bool end_of_json; - private bool end_of_input; - private Lexer lexer; - private bool parser_in_string; - private bool parser_return; - private bool read_started; - private TextReader reader; - private bool reader_is_owned; - private bool skip_non_members; - private object token_value; - private JsonToken token; - #endregion - - - #region Public Properties - public bool AllowComments { - get { return lexer.AllowComments; } - set { lexer.AllowComments = value; } - } - - public bool AllowSingleQuotedStrings { - get { return lexer.AllowSingleQuotedStrings; } - set { lexer.AllowSingleQuotedStrings = value; } - } - - public bool SkipNonMembers { - get { return skip_non_members; } - set { skip_non_members = value; } - } - - public bool EndOfInput { - get { return end_of_input; } - } - - public bool EndOfJson { - get { return end_of_json; } - } - - public JsonToken Token { - get { return token; } - } - - public object Value { - get { return token_value; } - } - #endregion - - - #region Constructors - static JsonReader () - { - parse_table = PopulateParseTable (); - } - - public JsonReader (string json_text) : - this (new StringReader (json_text), true) - { - } - - public JsonReader (TextReader reader) : - this (reader, false) - { - } - - private JsonReader (TextReader reader, bool owned) - { - if (reader == null) - throw new ArgumentNullException ("reader"); - - parser_in_string = false; - parser_return = false; - - read_started = false; - automaton_stack = new Stack (); - automaton_stack.Push ((int) ParserToken.End); - automaton_stack.Push ((int) ParserToken.Text); - - lexer = new Lexer (reader); - - end_of_input = false; - end_of_json = false; - - skip_non_members = true; - - this.reader = reader; - reader_is_owned = owned; - } - #endregion - - - #region Static Methods - private static IDictionary> PopulateParseTable () - { - // See section A.2. of the manual for details - IDictionary> parse_table = new Dictionary> (); - - TableAddRow (parse_table, ParserToken.Array); - TableAddCol (parse_table, ParserToken.Array, '[', - '[', - (int) ParserToken.ArrayPrime); - - TableAddRow (parse_table, ParserToken.ArrayPrime); - TableAddCol (parse_table, ParserToken.ArrayPrime, '"', - (int) ParserToken.Value, - - (int) ParserToken.ValueRest, - ']'); - TableAddCol (parse_table, ParserToken.ArrayPrime, '[', - (int) ParserToken.Value, - (int) ParserToken.ValueRest, - ']'); - TableAddCol (parse_table, ParserToken.ArrayPrime, ']', - ']'); - TableAddCol (parse_table, ParserToken.ArrayPrime, '{', - (int) ParserToken.Value, - (int) ParserToken.ValueRest, - ']'); - TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.Number, - (int) ParserToken.Value, - (int) ParserToken.ValueRest, - ']'); - TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.True, - (int) ParserToken.Value, - (int) ParserToken.ValueRest, - ']'); - TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.False, - (int) ParserToken.Value, - (int) ParserToken.ValueRest, - ']'); - TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.Null, - (int) ParserToken.Value, - (int) ParserToken.ValueRest, - ']'); - - TableAddRow (parse_table, ParserToken.Object); - TableAddCol (parse_table, ParserToken.Object, '{', - '{', - (int) ParserToken.ObjectPrime); - - TableAddRow (parse_table, ParserToken.ObjectPrime); - TableAddCol (parse_table, ParserToken.ObjectPrime, '"', - (int) ParserToken.Pair, - (int) ParserToken.PairRest, - '}'); - TableAddCol (parse_table, ParserToken.ObjectPrime, '}', - '}'); - - TableAddRow (parse_table, ParserToken.Pair); - TableAddCol (parse_table, ParserToken.Pair, '"', - (int) ParserToken.String, - ':', - (int) ParserToken.Value); - - TableAddRow (parse_table, ParserToken.PairRest); - TableAddCol (parse_table, ParserToken.PairRest, ',', - ',', - (int) ParserToken.Pair, - (int) ParserToken.PairRest); - TableAddCol (parse_table, ParserToken.PairRest, '}', - (int) ParserToken.Epsilon); - - TableAddRow (parse_table, ParserToken.String); - TableAddCol (parse_table, ParserToken.String, '"', - '"', - (int) ParserToken.CharSeq, - '"'); - - TableAddRow (parse_table, ParserToken.Text); - TableAddCol (parse_table, ParserToken.Text, '[', - (int) ParserToken.Array); - TableAddCol (parse_table, ParserToken.Text, '{', - (int) ParserToken.Object); - - TableAddRow (parse_table, ParserToken.Value); - TableAddCol (parse_table, ParserToken.Value, '"', - (int) ParserToken.String); - TableAddCol (parse_table, ParserToken.Value, '[', - (int) ParserToken.Array); - TableAddCol (parse_table, ParserToken.Value, '{', - (int) ParserToken.Object); - TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.Number, - (int) ParserToken.Number); - TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.True, - (int) ParserToken.True); - TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.False, - (int) ParserToken.False); - TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.Null, - (int) ParserToken.Null); - - TableAddRow (parse_table, ParserToken.ValueRest); - TableAddCol (parse_table, ParserToken.ValueRest, ',', - ',', - (int) ParserToken.Value, - (int) ParserToken.ValueRest); - TableAddCol (parse_table, ParserToken.ValueRest, ']', - (int) ParserToken.Epsilon); - - return parse_table; - } - - private static void TableAddCol (IDictionary> parse_table, ParserToken row, int col, - params int[] symbols) - { - parse_table[(int) row].Add (col, symbols); - } - - private static void TableAddRow (IDictionary> parse_table, ParserToken rule) - { - parse_table.Add ((int) rule, new Dictionary ()); - } - #endregion - - - #region Private Methods - private void ProcessNumber (string number) - { - if (number.IndexOf ('.') != -1 || - number.IndexOf ('e') != -1 || - number.IndexOf ('E') != -1) { - - double n_double; - if (double.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_double)) { - token = JsonToken.Double; - token_value = n_double; - - return; - } - } - - int n_int32; - if (int.TryParse (number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_int32)) { - token = JsonToken.Int; - token_value = n_int32; - - return; - } - - long n_int64; - if (long.TryParse (number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_int64)) { - token = JsonToken.Long; - token_value = n_int64; - - return; - } - - ulong n_uint64; - if (ulong.TryParse(number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_uint64)) - { - token = JsonToken.Long; - token_value = n_uint64; - - return; - } - - // Shouldn't happen, but just in case, return something - token = JsonToken.Int; - token_value = 0; - } - - private void ProcessSymbol () - { - if (current_symbol == '[') { - token = JsonToken.ArrayStart; - parser_return = true; - - } else if (current_symbol == ']') { - token = JsonToken.ArrayEnd; - parser_return = true; - - } else if (current_symbol == '{') { - token = JsonToken.ObjectStart; - parser_return = true; - - } else if (current_symbol == '}') { - token = JsonToken.ObjectEnd; - parser_return = true; - - } else if (current_symbol == '"') { - if (parser_in_string) { - parser_in_string = false; - - parser_return = true; - - } else { - if (token == JsonToken.None) - token = JsonToken.String; - - parser_in_string = true; - } - - } else if (current_symbol == (int) ParserToken.CharSeq) { - token_value = lexer.StringValue; - - } else if (current_symbol == (int) ParserToken.False) { - token = JsonToken.Boolean; - token_value = false; - parser_return = true; - - } else if (current_symbol == (int) ParserToken.Null) { - token = JsonToken.Null; - parser_return = true; - - } else if (current_symbol == (int) ParserToken.Number) { - ProcessNumber (lexer.StringValue); - - parser_return = true; - - } else if (current_symbol == (int) ParserToken.Pair) { - token = JsonToken.PropertyName; - - } else if (current_symbol == (int) ParserToken.True) { - token = JsonToken.Boolean; - token_value = true; - parser_return = true; - - } - } - - private bool ReadToken () - { - if (end_of_input) - return false; - - lexer.NextToken (); - - if (lexer.EndOfInput) { - Close (); - - return false; - } - - current_input = lexer.Token; - - return true; - } - #endregion - - - public void Close () - { - if (end_of_input) - return; - - end_of_input = true; - end_of_json = true; - - if (reader_is_owned) - { - using(reader){} - } - - reader = null; - } - - public bool Read () - { - if (end_of_input) - return false; - - if (end_of_json) { - end_of_json = false; - automaton_stack.Clear (); - automaton_stack.Push ((int) ParserToken.End); - automaton_stack.Push ((int) ParserToken.Text); - } - - parser_in_string = false; - parser_return = false; - - token = JsonToken.None; - token_value = null; - - if (! read_started) { - read_started = true; - - if (! ReadToken ()) - return false; - } - - - int[] entry_symbols; - - while (true) { - if (parser_return) { - if (automaton_stack.Peek () == (int) ParserToken.End) - end_of_json = true; - - return true; - } - - current_symbol = automaton_stack.Pop (); - - ProcessSymbol (); - - if (current_symbol == current_input) { - if (! ReadToken ()) { - if (automaton_stack.Peek () != (int) ParserToken.End) - throw new JsonException ( - "Input doesn't evaluate to proper JSON text"); - - if (parser_return) - return true; - - return false; - } - - continue; - } - - try { - - entry_symbols = - parse_table[current_symbol][current_input]; - - } catch (KeyNotFoundException e) { - throw new JsonException ((ParserToken) current_input, e); - } - - if (entry_symbols[0] == (int) ParserToken.Epsilon) - continue; - - for (int i = entry_symbols.Length - 1; i >= 0; i--) - automaton_stack.Push (entry_symbols[i]); - } - } - - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/JsonReader.cs.meta b/Assets/WX-WASM-SDK/LitJson/JsonReader.cs.meta deleted file mode 100644 index 734e499f..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonReader.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e71169053d8eca14db640939c53ae6d9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/JsonWriter.cs b/Assets/WX-WASM-SDK/LitJson/JsonWriter.cs deleted file mode 100644 index 2b03feb5..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonWriter.cs +++ /dev/null @@ -1,484 +0,0 @@ -#region Header -/** - * JsonWriter.cs - * Stream-like facility to output JSON text. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Text; - - -namespace LitJson -{ - internal enum Condition - { - InArray, - InObject, - NotAProperty, - Property, - Value - } - - internal class WriterContext - { - public int Count; - public bool InArray; - public bool InObject; - public bool ExpectingValue; - public int Padding; - } - - public class JsonWriter - { - #region Fields - private static readonly NumberFormatInfo number_format; - - private WriterContext context; - private Stack ctx_stack; - private bool has_reached_end; - private char[] hex_seq; - private int indentation; - private int indent_value; - private StringBuilder inst_string_builder; - private bool pretty_print; - private bool validate; - private bool lower_case_properties; - private TextWriter writer; - #endregion - - - #region Properties - public int IndentValue { - get { return indent_value; } - set { - indentation = (indentation / indent_value) * value; - indent_value = value; - } - } - - public bool PrettyPrint { - get { return pretty_print; } - set { pretty_print = value; } - } - - public TextWriter TextWriter { - get { return writer; } - } - - public bool Validate { - get { return validate; } - set { validate = value; } - } - - public bool LowerCaseProperties { - get { return lower_case_properties; } - set { lower_case_properties = value; } - } - #endregion - - - #region Constructors - static JsonWriter () - { - number_format = NumberFormatInfo.InvariantInfo; - } - - public JsonWriter () - { - inst_string_builder = new StringBuilder (); - writer = new StringWriter (inst_string_builder); - - Init (); - } - - public JsonWriter (StringBuilder sb) : - this (new StringWriter (sb)) - { - } - - public JsonWriter (TextWriter writer) - { - if (writer == null) - throw new ArgumentNullException ("writer"); - - this.writer = writer; - - Init (); - } - #endregion - - - #region Private Methods - private void DoValidation (Condition cond) - { - if (! context.ExpectingValue) - context.Count++; - - if (! validate) - return; - - if (has_reached_end) - throw new JsonException ( - "A complete JSON symbol has already been written"); - - switch (cond) { - case Condition.InArray: - if (! context.InArray) - throw new JsonException ( - "Can't close an array here"); - break; - - case Condition.InObject: - if (! context.InObject || context.ExpectingValue) - throw new JsonException ( - "Can't close an object here"); - break; - - case Condition.NotAProperty: - if (context.InObject && ! context.ExpectingValue) - throw new JsonException ( - "Expected a property"); - break; - - case Condition.Property: - if (! context.InObject || context.ExpectingValue) - throw new JsonException ( - "Can't add a property here"); - break; - - case Condition.Value: - if (! context.InArray && - (! context.InObject || ! context.ExpectingValue)) - throw new JsonException ( - "Can't add a value here"); - - break; - } - } - - private void Init () - { - has_reached_end = false; - hex_seq = new char[4]; - indentation = 0; - indent_value = 4; - pretty_print = false; - validate = true; - lower_case_properties = false; - - ctx_stack = new Stack (); - context = new WriterContext (); - ctx_stack.Push (context); - } - - private static void IntToHex (int n, char[] hex) - { - int num; - - for (int i = 0; i < 4; i++) { - num = n % 16; - - if (num < 10) - hex[3 - i] = (char) ('0' + num); - else - hex[3 - i] = (char) ('A' + (num - 10)); - - n >>= 4; - } - } - - private void Indent () - { - if (pretty_print) - indentation += indent_value; - } - - - private void Put (string str) - { - if (pretty_print && ! context.ExpectingValue) - for (int i = 0; i < indentation; i++) - writer.Write (' '); - - writer.Write (str); - } - - private void PutNewline () - { - PutNewline (true); - } - - private void PutNewline (bool add_comma) - { - if (add_comma && ! context.ExpectingValue && - context.Count > 1) - writer.Write (','); - - if (pretty_print && ! context.ExpectingValue) - writer.Write (Environment.NewLine); - } - - private void PutString (string str) - { - Put (String.Empty); - - writer.Write ('"'); - - int n = str.Length; - for (int i = 0; i < n; i++) { - switch (str[i]) { - case '\n': - writer.Write ("\\n"); - continue; - - case '\r': - writer.Write ("\\r"); - continue; - - case '\t': - writer.Write ("\\t"); - continue; - - case '"': - case '\\': - writer.Write ('\\'); - writer.Write (str[i]); - continue; - - case '\f': - writer.Write ("\\f"); - continue; - - case '\b': - writer.Write ("\\b"); - continue; - } - - if ((int) str[i] >= 32 && (int) str[i] <= 126) { - writer.Write (str[i]); - continue; - } - - // Default, turn into a \uXXXX sequence - IntToHex ((int) str[i], hex_seq); - writer.Write ("\\u"); - writer.Write (hex_seq); - } - - writer.Write ('"'); - } - - private void Unindent () - { - if (pretty_print) - indentation -= indent_value; - } - #endregion - - - public override string ToString () - { - if (inst_string_builder == null) - return String.Empty; - - return inst_string_builder.ToString (); - } - - public void Reset () - { - has_reached_end = false; - - ctx_stack.Clear (); - context = new WriterContext (); - ctx_stack.Push (context); - - if (inst_string_builder != null) - inst_string_builder.Remove (0, inst_string_builder.Length); - } - - public void Write (bool boolean) - { - DoValidation (Condition.Value); - PutNewline (); - - Put (boolean ? "true" : "false"); - - context.ExpectingValue = false; - } - - public void Write (decimal number) - { - DoValidation (Condition.Value); - PutNewline (); - - Put (Convert.ToString (number, number_format)); - - context.ExpectingValue = false; - } - - public void Write (double number) - { - DoValidation (Condition.Value); - PutNewline (); - - string str = Convert.ToString (number, number_format); - Put (str); - - if (str.IndexOf ('.') == -1 && - str.IndexOf ('E') == -1) - writer.Write (".0"); - - context.ExpectingValue = false; - } - - public void Write(float number) - { - DoValidation(Condition.Value); - PutNewline(); - - string str = Convert.ToString(number, number_format); - Put(str); - - context.ExpectingValue = false; - } - - public void Write (int number) - { - DoValidation (Condition.Value); - PutNewline (); - - Put (Convert.ToString (number, number_format)); - - context.ExpectingValue = false; - } - - public void Write (long number) - { - DoValidation (Condition.Value); - PutNewline (); - - Put (Convert.ToString (number, number_format)); - - context.ExpectingValue = false; - } - - public void Write (string str) - { - DoValidation (Condition.Value); - PutNewline (); - - if (str == null) - Put ("null"); - else - PutString (str); - - context.ExpectingValue = false; - } - - - public void Write (ulong number) - { - DoValidation (Condition.Value); - PutNewline (); - - Put (Convert.ToString (number, number_format)); - - context.ExpectingValue = false; - } - - public void WriteArrayEnd () - { - DoValidation (Condition.InArray); - PutNewline (false); - - ctx_stack.Pop (); - if (ctx_stack.Count == 1) - has_reached_end = true; - else { - context = ctx_stack.Peek (); - context.ExpectingValue = false; - } - - Unindent (); - Put ("]"); - } - - public void WriteArrayStart () - { - DoValidation (Condition.NotAProperty); - PutNewline (); - - Put ("["); - - context = new WriterContext (); - context.InArray = true; - ctx_stack.Push (context); - - Indent (); - } - - public void WriteObjectEnd () - { - DoValidation (Condition.InObject); - PutNewline (false); - - ctx_stack.Pop (); - if (ctx_stack.Count == 1) - has_reached_end = true; - else { - context = ctx_stack.Peek (); - context.ExpectingValue = false; - } - - Unindent (); - Put ("}"); - } - - public void WriteObjectStart () - { - DoValidation (Condition.NotAProperty); - PutNewline (); - - Put ("{"); - - context = new WriterContext (); - context.InObject = true; - ctx_stack.Push (context); - - Indent (); - } - - public void WritePropertyName (string property_name) - { - DoValidation (Condition.Property); - PutNewline (); - string propertyName = (property_name == null || !lower_case_properties) - ? property_name - : property_name.ToLowerInvariant(); - - PutString (propertyName); - - if (pretty_print) { - if (propertyName.Length > context.Padding) - context.Padding = propertyName.Length; - - for (int i = context.Padding - propertyName.Length; - i >= 0; i--) - writer.Write (' '); - - writer.Write (": "); - } else - writer.Write (':'); - - context.ExpectingValue = true; - } - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/JsonWriter.cs.meta b/Assets/WX-WASM-SDK/LitJson/JsonWriter.cs.meta deleted file mode 100644 index 51f0e4eb..00000000 --- a/Assets/WX-WASM-SDK/LitJson/JsonWriter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8d8d8325d9f305d4e9f17eaf3dbd765d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/Lexer.cs b/Assets/WX-WASM-SDK/LitJson/Lexer.cs deleted file mode 100644 index cb62d550..00000000 --- a/Assets/WX-WASM-SDK/LitJson/Lexer.cs +++ /dev/null @@ -1,912 +0,0 @@ -#region Header -/** - * Lexer.cs - * JSON lexer implementation based on a finite state machine. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - - -namespace LitJson -{ - internal class FsmContext - { - public bool Return; - public int NextState; - public Lexer L; - public int StateStack; - } - - - internal class Lexer - { - #region Fields - private delegate bool StateHandler (FsmContext ctx); - - private static readonly int[] fsm_return_table; - private static readonly StateHandler[] fsm_handler_table; - - private bool allow_comments; - private bool allow_single_quoted_strings; - private bool end_of_input; - private FsmContext fsm_context; - private int input_buffer; - private int input_char; - private TextReader reader; - private int state; - private StringBuilder string_buffer; - private string string_value; - private int token; - private int unichar; - #endregion - - - #region Properties - public bool AllowComments { - get { return allow_comments; } - set { allow_comments = value; } - } - - public bool AllowSingleQuotedStrings { - get { return allow_single_quoted_strings; } - set { allow_single_quoted_strings = value; } - } - - public bool EndOfInput { - get { return end_of_input; } - } - - public int Token { - get { return token; } - } - - public string StringValue { - get { return string_value; } - } - #endregion - - - #region Constructors - static Lexer () - { - PopulateFsmTables (out fsm_handler_table, out fsm_return_table); - } - - public Lexer (TextReader reader) - { - allow_comments = true; - allow_single_quoted_strings = true; - - input_buffer = 0; - string_buffer = new StringBuilder (128); - state = 1; - end_of_input = false; - this.reader = reader; - - fsm_context = new FsmContext (); - fsm_context.L = this; - } - #endregion - - - #region Static Methods - private static int HexValue (int digit) - { - switch (digit) { - case 'a': - case 'A': - return 10; - - case 'b': - case 'B': - return 11; - - case 'c': - case 'C': - return 12; - - case 'd': - case 'D': - return 13; - - case 'e': - case 'E': - return 14; - - case 'f': - case 'F': - return 15; - - default: - return digit - '0'; - } - } - - private static void PopulateFsmTables (out StateHandler[] fsm_handler_table, out int[] fsm_return_table) - { - // See section A.1. of the manual for details of the finite - // state machine. - fsm_handler_table = new StateHandler[28] { - State1, - State2, - State3, - State4, - State5, - State6, - State7, - State8, - State9, - State10, - State11, - State12, - State13, - State14, - State15, - State16, - State17, - State18, - State19, - State20, - State21, - State22, - State23, - State24, - State25, - State26, - State27, - State28 - }; - - fsm_return_table = new int[28] { - (int) ParserToken.Char, - 0, - (int) ParserToken.Number, - (int) ParserToken.Number, - 0, - (int) ParserToken.Number, - 0, - (int) ParserToken.Number, - 0, - 0, - (int) ParserToken.True, - 0, - 0, - 0, - (int) ParserToken.False, - 0, - 0, - (int) ParserToken.Null, - (int) ParserToken.CharSeq, - (int) ParserToken.Char, - 0, - 0, - (int) ParserToken.CharSeq, - (int) ParserToken.Char, - 0, - 0, - 0, - 0 - }; - } - - private static char ProcessEscChar (int esc_char) - { - switch (esc_char) { - case '"': - case '\'': - case '\\': - case '/': - return Convert.ToChar (esc_char); - - case 'n': - return '\n'; - - case 't': - return '\t'; - - case 'r': - return '\r'; - - case 'b': - return '\b'; - - case 'f': - return '\f'; - - default: - // Unreachable - return '?'; - } - } - - private static bool State1 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') - continue; - - if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') { - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 3; - return true; - } - - switch (ctx.L.input_char) { - case '"': - ctx.NextState = 19; - ctx.Return = true; - return true; - - case ',': - case ':': - case '[': - case ']': - case '{': - case '}': - ctx.NextState = 1; - ctx.Return = true; - return true; - - case '-': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 2; - return true; - - case '0': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 4; - return true; - - case 'f': - ctx.NextState = 12; - return true; - - case 'n': - ctx.NextState = 16; - return true; - - case 't': - ctx.NextState = 9; - return true; - - case '\'': - if (! ctx.L.allow_single_quoted_strings) - return false; - - ctx.L.input_char = '"'; - ctx.NextState = 23; - ctx.Return = true; - return true; - - case '/': - if (! ctx.L.allow_comments) - return false; - - ctx.NextState = 25; - return true; - - default: - return false; - } - } - - return true; - } - - private static bool State2 (FsmContext ctx) - { - ctx.L.GetChar (); - - if (ctx.L.input_char >= '1' && ctx.L.input_char<= '9') { - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 3; - return true; - } - - switch (ctx.L.input_char) { - case '0': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 4; - return true; - - default: - return false; - } - } - - private static bool State3 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - continue; - } - - if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { - ctx.Return = true; - ctx.NextState = 1; - return true; - } - - switch (ctx.L.input_char) { - case ',': - case ']': - case '}': - ctx.L.UngetChar (); - ctx.Return = true; - ctx.NextState = 1; - return true; - - case '.': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 5; - return true; - - case 'e': - case 'E': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 7; - return true; - - default: - return false; - } - } - return true; - } - - private static bool State4 (FsmContext ctx) - { - ctx.L.GetChar (); - - if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { - ctx.Return = true; - ctx.NextState = 1; - return true; - } - - switch (ctx.L.input_char) { - case ',': - case ']': - case '}': - ctx.L.UngetChar (); - ctx.Return = true; - ctx.NextState = 1; - return true; - - case '.': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 5; - return true; - - case 'e': - case 'E': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 7; - return true; - - default: - return false; - } - } - - private static bool State5 (FsmContext ctx) - { - ctx.L.GetChar (); - - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 6; - return true; - } - - return false; - } - - private static bool State6 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - continue; - } - - if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { - ctx.Return = true; - ctx.NextState = 1; - return true; - } - - switch (ctx.L.input_char) { - case ',': - case ']': - case '}': - ctx.L.UngetChar (); - ctx.Return = true; - ctx.NextState = 1; - return true; - - case 'e': - case 'E': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 7; - return true; - - default: - return false; - } - } - - return true; - } - - private static bool State7 (FsmContext ctx) - { - ctx.L.GetChar (); - - if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') { - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 8; - return true; - } - - switch (ctx.L.input_char) { - case '+': - case '-': - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - ctx.NextState = 8; - return true; - - default: - return false; - } - } - - private static bool State8 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') { - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - continue; - } - - if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char<= '\r') { - ctx.Return = true; - ctx.NextState = 1; - return true; - } - - switch (ctx.L.input_char) { - case ',': - case ']': - case '}': - ctx.L.UngetChar (); - ctx.Return = true; - ctx.NextState = 1; - return true; - - default: - return false; - } - } - - return true; - } - - private static bool State9 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'r': - ctx.NextState = 10; - return true; - - default: - return false; - } - } - - private static bool State10 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'u': - ctx.NextState = 11; - return true; - - default: - return false; - } - } - - private static bool State11 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'e': - ctx.Return = true; - ctx.NextState = 1; - return true; - - default: - return false; - } - } - - private static bool State12 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'a': - ctx.NextState = 13; - return true; - - default: - return false; - } - } - - private static bool State13 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'l': - ctx.NextState = 14; - return true; - - default: - return false; - } - } - - private static bool State14 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 's': - ctx.NextState = 15; - return true; - - default: - return false; - } - } - - private static bool State15 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'e': - ctx.Return = true; - ctx.NextState = 1; - return true; - - default: - return false; - } - } - - private static bool State16 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'u': - ctx.NextState = 17; - return true; - - default: - return false; - } - } - - private static bool State17 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'l': - ctx.NextState = 18; - return true; - - default: - return false; - } - } - - private static bool State18 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'l': - ctx.Return = true; - ctx.NextState = 1; - return true; - - default: - return false; - } - } - - private static bool State19 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - switch (ctx.L.input_char) { - case '"': - ctx.L.UngetChar (); - ctx.Return = true; - ctx.NextState = 20; - return true; - - case '\\': - ctx.StateStack = 19; - ctx.NextState = 21; - return true; - - default: - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - continue; - } - } - - return true; - } - - private static bool State20 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case '"': - ctx.Return = true; - ctx.NextState = 1; - return true; - - default: - return false; - } - } - - private static bool State21 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case 'u': - ctx.NextState = 22; - return true; - - case '"': - case '\'': - case '/': - case '\\': - case 'b': - case 'f': - case 'n': - case 'r': - case 't': - ctx.L.string_buffer.Append ( - ProcessEscChar (ctx.L.input_char)); - ctx.NextState = ctx.StateStack; - return true; - - default: - return false; - } - } - - private static bool State22 (FsmContext ctx) - { - int counter = 0; - int mult = 4096; - - ctx.L.unichar = 0; - - while (ctx.L.GetChar ()) { - - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9' || - ctx.L.input_char >= 'A' && ctx.L.input_char <= 'F' || - ctx.L.input_char >= 'a' && ctx.L.input_char <= 'f') { - - ctx.L.unichar += HexValue (ctx.L.input_char) * mult; - - counter++; - mult /= 16; - - if (counter == 4) { - ctx.L.string_buffer.Append ( - Convert.ToChar (ctx.L.unichar)); - ctx.NextState = ctx.StateStack; - return true; - } - - continue; - } - - return false; - } - - return true; - } - - private static bool State23 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - switch (ctx.L.input_char) { - case '\'': - ctx.L.UngetChar (); - ctx.Return = true; - ctx.NextState = 24; - return true; - - case '\\': - ctx.StateStack = 23; - ctx.NextState = 21; - return true; - - default: - ctx.L.string_buffer.Append ((char) ctx.L.input_char); - continue; - } - } - - return true; - } - - private static bool State24 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case '\'': - ctx.L.input_char = '"'; - ctx.Return = true; - ctx.NextState = 1; - return true; - - default: - return false; - } - } - - private static bool State25 (FsmContext ctx) - { - ctx.L.GetChar (); - - switch (ctx.L.input_char) { - case '*': - ctx.NextState = 27; - return true; - - case '/': - ctx.NextState = 26; - return true; - - default: - return false; - } - } - - private static bool State26 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - if (ctx.L.input_char == '\n') { - ctx.NextState = 1; - return true; - } - } - - return true; - } - - private static bool State27 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - if (ctx.L.input_char == '*') { - ctx.NextState = 28; - return true; - } - } - - return true; - } - - private static bool State28 (FsmContext ctx) - { - while (ctx.L.GetChar ()) { - if (ctx.L.input_char == '*') - continue; - - if (ctx.L.input_char == '/') { - ctx.NextState = 1; - return true; - } - - ctx.NextState = 27; - return true; - } - - return true; - } - #endregion - - - private bool GetChar () - { - if ((input_char = NextChar ()) != -1) - return true; - - end_of_input = true; - return false; - } - - private int NextChar () - { - if (input_buffer != 0) { - int tmp = input_buffer; - input_buffer = 0; - - return tmp; - } - - return reader.Read (); - } - - public bool NextToken () - { - StateHandler handler; - fsm_context.Return = false; - - while (true) { - handler = fsm_handler_table[state - 1]; - - if (! handler (fsm_context)) - throw new JsonException (input_char); - - if (end_of_input) - return false; - - if (fsm_context.Return) { - string_value = string_buffer.ToString (); - string_buffer.Remove (0, string_buffer.Length); - token = fsm_return_table[state - 1]; - - if (token == (int) ParserToken.Char) - token = input_char; - - state = fsm_context.NextState; - - return true; - } - - state = fsm_context.NextState; - } - } - - private void UngetChar () - { - input_buffer = input_char; - } - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/Lexer.cs.meta b/Assets/WX-WASM-SDK/LitJson/Lexer.cs.meta deleted file mode 100644 index 0a0ef6da..00000000 --- a/Assets/WX-WASM-SDK/LitJson/Lexer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3c64c690f31441d4e8cc615f954f1d8a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/Netstandard15Polyfill.cs b/Assets/WX-WASM-SDK/LitJson/Netstandard15Polyfill.cs deleted file mode 100644 index 55b02a21..00000000 --- a/Assets/WX-WASM-SDK/LitJson/Netstandard15Polyfill.cs +++ /dev/null @@ -1,24 +0,0 @@ -#if NETSTANDARD1_5 -using System; -using System.Reflection; -namespace LitJson -{ - internal static class Netstandard15Polyfill - { - internal static Type GetInterface(this Type type, string name) - { - return type.GetTypeInfo().GetInterface(name); - } - - internal static bool IsClass(this Type type) - { - return type.GetTypeInfo().IsClass; - } - - internal static bool IsEnum(this Type type) - { - return type.GetTypeInfo().IsEnum; - } - } -} -#endif \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/LitJson/Netstandard15Polyfill.cs.meta b/Assets/WX-WASM-SDK/LitJson/Netstandard15Polyfill.cs.meta deleted file mode 100644 index e1104ca7..00000000 --- a/Assets/WX-WASM-SDK/LitJson/Netstandard15Polyfill.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6a1a82f4920c9454b9b154ca7479b3de -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/ParserToken.cs b/Assets/WX-WASM-SDK/LitJson/ParserToken.cs deleted file mode 100644 index e23d477b..00000000 --- a/Assets/WX-WASM-SDK/LitJson/ParserToken.cs +++ /dev/null @@ -1,44 +0,0 @@ -#region Header -/** - * ParserToken.cs - * Internal representation of the tokens used by the lexer and the parser. - * - * The authors disclaim copyright to this source code. For more details, see - * the COPYING file included with this distribution. - **/ -#endregion - - -namespace LitJson -{ - internal enum ParserToken - { - // Lexer tokens (see section A.1.1. of the manual) - None = System.Char.MaxValue + 1, - Number, - True, - False, - Null, - CharSeq, - // Single char - Char, - - // Parser Rules (see section A.2.1 of the manual) - Text, - Object, - ObjectPrime, - Pair, - PairRest, - Array, - ArrayPrime, - Value, - ValueRest, - String, - - // End of input - End, - - // The empty rule - Epsilon - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/ParserToken.cs.meta b/Assets/WX-WASM-SDK/LitJson/ParserToken.cs.meta deleted file mode 100644 index b5f1264b..00000000 --- a/Assets/WX-WASM-SDK/LitJson/ParserToken.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4d534d338a67858409d033e8f3c92627 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/LitJson/UnityTypeBindings.cs b/Assets/WX-WASM-SDK/LitJson/UnityTypeBindings.cs deleted file mode 100644 index 80ab22d6..00000000 --- a/Assets/WX-WASM-SDK/LitJson/UnityTypeBindings.cs +++ /dev/null @@ -1,156 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; - -using LitJson.Extensions; - -namespace LitJson -{ - -#if UNITY_EDITOR - [UnityEditor.InitializeOnLoad] -#endif - /// - /// Unity内建类型拓展 - /// - public static class UnityTypeBindings - { - - static bool registerd; - - static UnityTypeBindings() - { - Register(); - } - - public static void Register() - { - - if (registerd) return; - registerd = true; - - - // 注册Type类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.Write(v.FullName); - }); - - JsonMapper.RegisterImporter((s) => - { - return Type.GetType(s); - }); - - // 注册Vector2类型的Exporter - Action writeVector2 = (v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("x", v.x); - w.WriteProperty("y", v.y); - w.WriteObjectEnd(); - }; - - JsonMapper.RegisterExporter((v, w) => - { - writeVector2(v, w); - }); - - // 注册Vector3类型的Exporter - Action writeVector3 = (v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("x", v.x); - w.WriteProperty("y", v.y); - w.WriteProperty("z", v.z); - w.WriteObjectEnd(); - }; - - JsonMapper.RegisterExporter((v, w) => - { - writeVector3(v, w); - }); - - // 注册Vector4类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("x", v.x); - w.WriteProperty("y", v.y); - w.WriteProperty("z", v.z); - w.WriteProperty("w", v.w); - w.WriteObjectEnd(); - }); - - // 注册Quaternion类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("x", v.x); - w.WriteProperty("y", v.y); - w.WriteProperty("z", v.z); - w.WriteProperty("w", v.w); - w.WriteObjectEnd(); - }); - - // 注册Color类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("r", v.r); - w.WriteProperty("g", v.g); - w.WriteProperty("b", v.b); - w.WriteProperty("a", v.a); - w.WriteObjectEnd(); - }); - - // 注册Color32类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("r", v.r); - w.WriteProperty("g", v.g); - w.WriteProperty("b", v.b); - w.WriteProperty("a", v.a); - w.WriteObjectEnd(); - }); - - // 注册Bounds类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.WriteObjectStart(); - - w.WritePropertyName("center"); - writeVector3(v.center, w); - - w.WritePropertyName("size"); - writeVector3(v.size, w); - - w.WriteObjectEnd(); - }); - - // 注册Rect类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("x", v.x); - w.WriteProperty("y", v.y); - w.WriteProperty("width", v.width); - w.WriteProperty("height", v.height); - w.WriteObjectEnd(); - }); - - // 注册RectOffset类型的Exporter - JsonMapper.RegisterExporter((v, w) => - { - w.WriteObjectStart(); - w.WriteProperty("top", v.top); - w.WriteProperty("left", v.left); - w.WriteProperty("bottom", v.bottom); - w.WriteProperty("right", v.right); - w.WriteObjectEnd(); - }); - - } - - } -} diff --git a/Assets/WX-WASM-SDK/LitJson/UnityTypeBindings.cs.meta b/Assets/WX-WASM-SDK/LitJson/UnityTypeBindings.cs.meta deleted file mode 100644 index 5f910fc7..00000000 --- a/Assets/WX-WASM-SDK/LitJson/UnityTypeBindings.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b00d2c492be2a4538b313ec7268ad552 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/PlayerPrefs.cs b/Assets/WX-WASM-SDK/PlayerPrefs.cs deleted file mode 100644 index d9d9143b..00000000 --- a/Assets/WX-WASM-SDK/PlayerPrefs.cs +++ /dev/null @@ -1,41 +0,0 @@ -using WeChatWASM; - - -#if UNITY_WEBGL -/// -/// 覆盖unity的PlayerPrefs -/// -public static class PlayerPrefs -{ - public static void SetInt(string key, int value) { - WX.StorageSetIntSync(key, value); - } - public static int GetInt(string key , int defaultValue = 0) { - return WX.StorageGetIntSync(key, defaultValue); - } - public static void SetString(string key,string value) { - WX.StorageSetStringSync(key,value); - } - public static string GetString(string key,string defaultValue = "") { - return WX.StorageGetStringSync(key,defaultValue); - } - public static void SetFloat(string key,float value) { - WX.StorageSetFloatSync(key,value); - } - public static float GetFloat(string key,float defaultValue = 0) { - return WX.StorageGetFloatSync(key, defaultValue); - } - public static void DeleteAll() { - WX.StorageDeleteAllSync(); - } - public static void DeleteKey(string key) { - WX.StorageDeleteKeySync(key); - } - public static bool HasKey(string key) - { - return WX.StorageHasKeySync(key); - } - public static void Save(){} -} - -#endif diff --git a/Assets/WX-WASM-SDK/PlayerPrefs.cs.meta b/Assets/WX-WASM-SDK/PlayerPrefs.cs.meta deleted file mode 100644 index 5e808e14..00000000 --- a/Assets/WX-WASM-SDK/PlayerPrefs.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d506997ff639146f791ebc9dc4386f25 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Plugins.meta b/Assets/WX-WASM-SDK/Plugins.meta deleted file mode 100644 index 320e23e5..00000000 --- a/Assets/WX-WASM-SDK/Plugins.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fce468ee9ae204b43b77e8c40920aa8b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS-Old.jslib b/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS-Old.jslib deleted file mode 100755 index 21f799f6..00000000 --- a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS-Old.jslib +++ /dev/null @@ -1,757 +0,0 @@ -mergeInto(LibraryManager.library, { - WXPointer_stringify_adaptor:function(str){ - if (typeof UTF8ToString !== "undefined") { - return UTF8ToString(str) - } - return Pointer_stringify(str) - }, - glGenTextures: function (n, textures) { - for (var i = 0; i < n; i++) { - var texture = GLctx.createTexture(); - if (!texture) { - GL.recordError(1282); - while (i < n) HEAP32[textures + i++ * 4 >> 2] = 0; - return - } - var id = GL.getNewId(GL.textures); - texture.name = id; - GL.textures[id] = texture; - window._lastTextureId = id; - HEAP32[textures + i * 4 >> 2] = id - } - }, - glBindTexture:function(target, texture) { - window._lastBoundTexture = texture; - GLctx.bindTexture(target, texture ? GL.textures[texture] : null) - }, - glCompressedTexImage2D: function (target, level, internalFormat, width, height, border, imageSize, data) { - var lastTid = window._lastTextureId; - function compressedImage2D(rawData) { - var format = 0; - var dataOffset = 16; - var compressFormat = GameGlobal.TextureCompressedFormat; - switch (compressFormat) { - case "astc": - format = GLctx.getExtension("WEBGL_compressed_texture_astc").COMPRESSED_RGBA_ASTC_8x8_KHR; - break; - case "etc2": - format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC; - break; - case "dds": - format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT; - dataOffset = 128; - break; - case "pvr": - format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - var PVR_HEADER_METADATA = 12; - var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints. - var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH); - dataOffset = header[PVR_HEADER_METADATA] + 52; - break; - case "etc1": - format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL; - break - } - GLctx["compressedTexImage2D"](target, level, format, width, height, border, new Uint8Array(rawData, dataOffset)) - } - - function texImage2D(image) { - GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image) - } - - function renderTexture(id) { - if(!GL.textures[lastTid]){ - return; - } - var PotList = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; - var _data = GameGlobal.DownloadedTextures[id].data; - var tid = lastTid; - if(!GL.textures[tid]){ - return; - } - GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]); - if (!GameGlobal.TextureCompressedFormat || (GameGlobal.TextureCompressedFormat == "pvr" && (width !== height || PotList.indexOf(height)==-1)) || (GameGlobal.TextureCompressedFormat == 'dds' && (height%4!==0 || width%4!==0))) { - texImage2D(_data) - }else{ - compressedImage2D(_data); - } - GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null); - - } - - function renderTransparent() { - GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, 1, 1, 0, GLctx.RGBA, GLctx.UNSIGNED_SHORT_4_4_4_4, new Uint16Array([0, 0])) - } - - function getMatchId() { - if(internalFormat == 36196 && GameGlobal.USED_TEXTURE_COMPRESSION){ - var length = HEAPU8.subarray(data, data + 1)[0]; - var d = HEAPU8.subarray(data+1, data + 1 + length); - var res = []; - d.forEach(function(v){ - res.push(String.fromCharCode(v)); - }); - return res.join(''); - } - return -1; - } - - var matchId = getMatchId(); - if (matchId != -1) { - if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) { - renderTexture(matchId) - } else { - renderTransparent(); - window.WXWASMSDK.WXDownloadTexture(matchId,width,height,(function () { - renderTexture(matchId) - })) - } - return - } - if (GL.currentContext.supportsWebGL2EntryPoints) { - GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, HEAPU8, data, imageSize); - return - } - GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray(data, data + imageSize) : null) - }, - glCompressedTexSubImage2D:function(target, level, xoffset, yoffset, width, height, format, imageSize, data) { - var lastTid = window._lastTextureId; - function compressedImage2D(rawData) { - var format = 0; - var dataOffset = 16; - var compressFormat = GameGlobal.TextureCompressedFormat; - switch (compressFormat) { - case "astc": - format = GLctx.getExtension("WEBGL_compressed_texture_astc").COMPRESSED_RGBA_ASTC_8x8_KHR; - break; - case "etc2": - format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC; - break; - case "dds": - format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT; - dataOffset = 128; - break; - case "pvr": - format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - var PVR_HEADER_METADATA = 12; - var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints. - var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH); - dataOffset = header[PVR_HEADER_METADATA] + 52; - break; - case "etc1": - format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL; - break - } - GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, new Uint8Array(rawData, dataOffset)) - } - - function texImage2D(image) { - GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image) - } - - function renderTexture(id) { - if(!GL.textures[lastTid]){ - return; - } - var _data = GameGlobal.DownloadedTextures[id].data; - var tid = lastTid; - if(!GL.textures[tid]){ - return; - } - GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]); - if (!GameGlobal.TextureCompressedFormat || (GameGlobal.TextureCompressedFormat == "pvr" && width !== height) || (GameGlobal.TextureCompressedFormat == 'dds' && (height%4!==0 || width!==0))) { - texImage2D(_data) - }else{ - compressedImage2D(_data); - } - GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null); - - } - - function getMatchId() { - if(format == 36196 && GameGlobal.USED_TEXTURE_COMPRESSION){ - var length = HEAPU8.subarray(data, data + 1)[0]; - var d = HEAPU8.subarray(data+1, data + 1 + length); - var res = []; - d.forEach(function(v){ - res.push(String.fromCharCode(v)); - }); - return res.join(''); - } - return -1; - } - - var matchId = getMatchId(); - var p = window._lastTexStorage2DParams; - if (matchId != -1) { - var f = GLctx.RGBA8; - switch (GameGlobal.TextureCompressedFormat) { - case "astc": - f = GLctx.getExtension("WEBGL_compressed_texture_astc").COMPRESSED_RGBA_ASTC_8x8_KHR; - break; - case "etc2": - f = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC; - case "dds": - f = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT; - break; - case "pvr": - f = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - break; - } - GLctx["texStorage2D"](p[0], p[1], f, width, height); - if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) { - renderTexture(matchId) - } else { - window.WXWASMSDK.WXDownloadTexture(matchId, width,height,(function () { - renderTexture(matchId) - })) - } - return - } - if (GL.currentContext.supportsWebGL2EntryPoints) { - GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, HEAPU8, data, imageSize); - return - } - GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray(data, data + imageSize) : null) - }, - - WXInitializeSDK: function (version) { - window.WXWASMSDK.WXInitializeSDK(_WXPointer_stringify_adaptor(version)); - }, - WXStorageSetIntSync: function (key, value) { - window.WXWASMSDK.WXStorageSetIntSync(_WXPointer_stringify_adaptor(key), value); - }, - WXStorageGetIntSync: function (key, defaultValue) { - return window.WXWASMSDK.WXStorageGetIntSync(_WXPointer_stringify_adaptor(key), defaultValue); - }, - WXStorageSetFloatSync: function (key, value) { - window.WXWASMSDK.WXStorageSetFloatSync(_WXPointer_stringify_adaptor(key), value); - }, - WXStorageGetFloatSync: function (key, defaultValue) { - return window.WXWASMSDK.WXStorageGetFloatSync(_WXPointer_stringify_adaptor(key), defaultValue); - }, - WXStorageSetStringSync: function (key, value) { - window.WXWASMSDK.WXStorageSetStringSync(_WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(value)); - }, - WXStorageGetStringSync: function (key, defaultValue) { - var returnStr = window.WXWASMSDK.WXStorageGetStringSync(_WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(defaultValue)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXStorageDeleteAllSync: function () { - window.WXWASMSDK.WXStorageDeleteAllSync(); - }, - WXStorageDeleteKeySync: function (key) { - window.WXWASMSDK.WXStorageDeleteKeySync(_WXPointer_stringify_adaptor(key)); - }, - WXStorageHasKeySync: function (key) { - return window.WXWASMSDK.WXStorageHasKeySync(_WXPointer_stringify_adaptor(key)); - }, - WXCheckSession: function (s, f, c) { - window.WXWASMSDK.WXCheckSession(_WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)); - }, - WXAuthorize: function (scope, s, f, c) { - window.WXWASMSDK.WXAuthorize(_WXPointer_stringify_adaptor(scope), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)); - }, - WXCreateUserInfoButton: function (x, y, width, height, lang, withCredentials) { - var returnStr = window.WXWASMSDK.WXCreateUserInfoButton(x, y, width, height, _WXPointer_stringify_adaptor(lang), withCredentials); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXUserInfoButtonShow: function (id) { - window.WXWASMSDK.WXUserInfoButtonShow(_WXPointer_stringify_adaptor(id)); - }, - WXUserInfoButtonDestroy: function (id) { - window.WXWASMSDK.WXUserInfoButtonDestroy(_WXPointer_stringify_adaptor(id)); - }, - WXUserInfoButtonHide: function (id) { - window.WXWASMSDK.WXUserInfoButtonHide(_WXPointer_stringify_adaptor(id)); - }, - WXUserInfoButtonOffTap: function (id) { - window.WXWASMSDK.WXUserInfoButtonOffTap(_WXPointer_stringify_adaptor(id)); - }, - WXUserInfoButtonOnTap: function (id) { - window.WXWASMSDK.WXUserInfoButtonOnTap(_WXPointer_stringify_adaptor(id)); - }, - WXOnShareAppMessage: function (conf, isPromise) { - return window.WXWASMSDK.WXOnShareAppMessage(_WXPointer_stringify_adaptor(conf), isPromise); - }, - WXOnShareAppMessageResolve: function (conf) { - return window.WXWASMSDK.WXOnShareAppMessageResolve(_WXPointer_stringify_adaptor(conf)); - }, - WXOffShareAppMessage: function () { - return window.WXWASMSDK.WXOffShareAppMessage(); - }, - WXCreateBannerAd: function (conf) { - var returnStr = window.WXWASMSDK.WXCreateBannerAd(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCreateRewardedVideoAd: function (conf) { - var returnStr = window.WXWASMSDK.WXCreateRewardedVideoAd(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXRewardedVideoAdReportShareBehavior: function (id, conf) { - var returnStr = window.WXWASMSDK.WXReportShareBehavior(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCreateInterstitialAd: function (conf) { - var returnStr = window.WXWASMSDK.WXCreateInterstitialAd(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCreateGridAd: function (conf) { - var returnStr = window.WXWASMSDK.WXCreateGridAd(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCreateCustomAd: function (conf) { - var returnStr = window.WXWASMSDK.WXCreateCustomAd(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXADStyleChange: function (id, key, value) { - window.WXWASMSDK.WXADStyleChange(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), value); - }, - WXShowAd: function (id, s, f) { - window.WXWASMSDK.WXShowAd(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f)); - }, - WXShowAd2: function (id,branchId,branchDim, s, f) { - window.WXWASMSDK.WXShowAd2(_WXPointer_stringify_adaptor(id),_WXPointer_stringify_adaptor(branchId),_WXPointer_stringify_adaptor(branchDim), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f)); - }, - WXHideAd: function (id, s, f) { - window.WXWASMSDK.WXHideAd(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f)); - }, - WXADGetStyleValue: function (id, key) { - window.WXWASMSDK.WXADGetStyleValue(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); - }, - WXADDestroy: function (id) { - window.WXWASMSDK.WXADDestroy(_WXPointer_stringify_adaptor(id)); - }, - WXADLoad: function (id, succ, fail) { - window.WXWASMSDK.WXADLoad(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(succ), _WXPointer_stringify_adaptor(fail)); - }, - WXToTempFilePath: function (conf, s, f, c) { - window.WXWASMSDK.WXToTempFilePath(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)) - }, - WXToTempFilePathSync: function (conf) { - var returnStr = window.WXWASMSDK.WXToTempFilePathSync(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXGetUserDataPath: function () { - var returnStr = window.WXWASMSDK.WXGetUserDataPath(); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXWriteFileSync: function (filePath, data, encoding) { - var returnStr = window.WXWASMSDK.WXWriteFileSync(_WXPointer_stringify_adaptor(filePath), _WXPointer_stringify_adaptor(data), _WXPointer_stringify_adaptor(encoding)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCreateFixedBottomMiddleBannerAd: function (adUnitId, adIntervals, height) { - var returnStr = window.WXWASMSDK.WXCreateFixedBottomMiddleBannerAd(_WXPointer_stringify_adaptor(adUnitId), adIntervals, height); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXDataContextPostMessage: function (msg) { - window.WXWASMSDK.WXDataContextPostMessage(_WXPointer_stringify_adaptor(msg)); - }, - WXShowOpenData: function (id, x, y, width, height) { - window.WXWASMSDK.WXShowOpenData(id, x, y, width, height); - }, - WXHideOpenData: function () { - window.WXWASMSDK.WXHideOpenData(); - }, - WXReportGameStart: function () { - window.WXWASMSDK.WXReportGameStart(); - }, - WXSetGameStage: function(stageType) { - window.WXWASMSDK.WXSetGameStage(stageType); - }, - WXReportGameStageCostTime: function(totalMs, extJsonStr) { - window.WXWASMSDK.WXReportGameStageCostTime(totalMs, _WXPointer_stringify_adaptor(extJsonStr)); - }, - WXReportGameStageError: function(errorType, errStr, extJsonStr) { - window.WXWASMSDK.WXReportGameStageError(errorType, _WXPointer_stringify_adaptor(errStr), _WXPointer_stringify_adaptor(extJsonStr)); - }, - WXWriteLog: function (str) { - window.WXWASMSDK.WXWriteLog(_WXPointer_stringify_adaptor(str)) - }, - WXWriteWarn: function (str) { - window.WXWASMSDK.WXWriteWarn(_WXPointer_stringify_adaptor(str)) - }, - WXPreloadConcurrent: function (count) { - window.WXWASMSDK.WXPreloadConcurrent(count); - }, - WXAccessFileSync: function (path) { - var returnStr = window.WXWASMSDK.WXAccessFileSync(_WXPointer_stringify_adaptor(path)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXAccessFile: function (path, s, f, c) { - return window.WXWASMSDK.WXAccessFile(_WXPointer_stringify_adaptor(path), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)); - }, - WXCopyFileSync: function (srcPath, destPath) { - var returnStr = window.WXWASMSDK.WXCopyFileSync(_WXPointer_stringify_adaptor(srcPath), _WXPointer_stringify_adaptor(destPath)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCopyFile: function (srcPath, destPath, s, f, c) { - return window.WXWASMSDK.WXCopyFile(_WXPointer_stringify_adaptor(srcPath), _WXPointer_stringify_adaptor(destPath), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)); - }, - WXUnlinkSync: function (filePath) { - var returnStr = window.WXWASMSDK.WXUnlinkSync(_WXPointer_stringify_adaptor(filePath)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXUnlink: function (filePath, s, f, c) { - return window.WXWASMSDK.WXUnlink(_WXPointer_stringify_adaptor(filePath), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)); - }, - WXReportUserBehaviorBranchAnalytics: function (branchId, branchDim, eventType) { - window.WXWASMSDK.WXReportUserBehaviorBranchAnalytics(_WXPointer_stringify_adaptor(branchId), _WXPointer_stringify_adaptor(branchDim), eventType); - }, - WXCallFunction: function (name, data, conf, s, f, c) { - window.WXWASMSDK.WXCallFunction(_WXPointer_stringify_adaptor(name), _WXPointer_stringify_adaptor(data), _WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)); - }, - WXCallFunctionInit: function (conf) { - window.WXWASMSDK.WXCallFunctionInit(_WXPointer_stringify_adaptor(conf)); - }, - WXCloudID: function (cloudID) { - var returnStr = window.WXWASMSDK.WXCloudID(_WXPointer_stringify_adaptor(cloudID)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCreateInnerAudioContext: function (src, loop, startTime, autoplay, volume, playbackRate, needDownload) { - var returnStr = window.WXWASMSDK.WXCreateInnerAudioContext(_WXPointer_stringify_adaptor(src), loop, startTime, autoplay, volume, playbackRate, needDownload); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXInnerAudioContextSetBool: function (id, k, v) { - window.WXWASMSDK.WXInnerAudioContextSetBool(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k), v); - }, - WXInnerAudioContextSetString: function (id, k, v) { - window.WXWASMSDK.WXInnerAudioContextSetString(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k), _WXPointer_stringify_adaptor(v)); - }, - WXInnerAudioContextSetFloat: function (id, k, v) { - window.WXWASMSDK.WXInnerAudioContextSetFloat(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k), v); - }, - WXInnerAudioContextGetFloat: function (id, k) { - return window.WXWASMSDK.WXInnerAudioContextGetFloat(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k)); - }, - WXInnerAudioContextGetBool: function (id, k) { - return window.WXWASMSDK.WXInnerAudioContextGetBool(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k)); - }, - WXInnerAudioContextPlay: function (id) { - window.WXWASMSDK.WXInnerAudioContextPlay(_WXPointer_stringify_adaptor(id)); - }, - WXInnerAudioContextStop: function (id) { - window.WXWASMSDK.WXInnerAudioContextStop(_WXPointer_stringify_adaptor(id)); - }, - WXInnerAudioContextPause: function (id) { - window.WXWASMSDK.WXInnerAudioContextPause(_WXPointer_stringify_adaptor(id)); - }, - WXInnerAudioContextDestroy: function (id) { - window.WXWASMSDK.WXInnerAudioContextDestroy(_WXPointer_stringify_adaptor(id)); - }, - WXInnerAudioContextSeek: function (id, position) { - window.WXWASMSDK.WXInnerAudioContextSeek(_WXPointer_stringify_adaptor(id), position); - }, - WXInnerAudioContextAddListener: function (id, key) { - window.WXWASMSDK.WXInnerAudioContextAddListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); - }, - WXInnerAudioContextRemoveListener: function (id, key) { - window.WXWASMSDK.WXInnerAudioContextRemoveListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); - }, - WXPreDownloadAudios: function (paths, id) { - window.WXWASMSDK.WXPreDownloadAudios(_WXPointer_stringify_adaptor(paths), id); - }, - WXCreateGameClubButton: function (conf) { - var returnStr = window.WXWASMSDK.WXCreateGameClubButton(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXGameClubButtonDestroy: function(id) { - window.WXWASMSDK.WXGameClubButtonDestroy(_WXPointer_stringify_adaptor(id)); - }, - WXGameClubButtonHide: function(id) { - window.WXWASMSDK.WXGameClubButtonHide(_WXPointer_stringify_adaptor(id)); - }, - WXGameClubButtonShow: function(id) { - window.WXWASMSDK.WXGameClubButtonShow(_WXPointer_stringify_adaptor(id)); - }, - WXGameClubButtonAddListener: function(id, key) { - window.WXWASMSDK.WXGameClubButtonAddListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); - }, - WXGameClubButtonRemoveListener: function(id, key) { - window.WXWASMSDK.WXGameClubButtonRemoveListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); - }, - WXGameClubButtonSetProperty: function(id, key, value) { - window.WXWASMSDK.WXGameClubButtonSetProperty(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(value)); - }, - WXGameClubStyleChangeInt: function(id, key, value) { - window.WXWASMSDK.WXGameClubStyleChangeInt(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), value); - }, - WXGameClubStyleChangeStr: function(id, key, value) { - window.WXWASMSDK.WXGameClubStyleChangeStr(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(value)); - }, - WXCreateVideo: function(conf) { - var returnStr = window.WXWASMSDK.WXCreateVideo(_WXPointer_stringify_adaptor(conf)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXVideoPlay: function(id) { - window.WXWASMSDK.WXVideoPlay(_WXPointer_stringify_adaptor(id)); - }, - WXVideoAddListener: function(id,key) { - window.WXWASMSDK.WXVideoAddListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); - }, - WXVideoDestroy: function(id) { - window.WXWASMSDK.WXVideoDestroy(_WXPointer_stringify_adaptor(id)); - }, - WXVideoExitFullScreen: function(id) { - window.WXWASMSDK.WXVideoExitFullScreen(_WXPointer_stringify_adaptor(id)); - }, - WXVideoPause: function(id){ - window.WXWASMSDK.WXVideoPause(_WXPointer_stringify_adaptor(id)); - }, - WXVideoRequestFullScreen:function(id,direction){ - window.WXWASMSDK.WXVideoRequestFullScreen(_WXPointer_stringify_adaptor(id),direction); - }, - WXVideoSeek:function(id,time){ - window.WXWASMSDK.WXVideoSeek(_WXPointer_stringify_adaptor(id),time); - }, - WXVideoStop:function(id){ - window.WXWASMSDK.WXVideoStop(_WXPointer_stringify_adaptor(id)); - }, - WXVideoRemoveListener:function(id,key){ - window.WXWASMSDK.WXVideoRemoveListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); - }, - WXHideLoadingPage: function() { - window.WXWASMSDK && window.WXWASMSDK.WXHideLoadingPage() - }, - WXWriteFile:function(filePath, data, dataLength, encoding, s, f, c){ - window.WXWASMSDK.WXWriteFile( - _WXPointer_stringify_adaptor(filePath), - HEAPU8.slice(data,dataLength+data), - _WXPointer_stringify_adaptor(encoding), - _WXPointer_stringify_adaptor(s), - _WXPointer_stringify_adaptor(f), - _WXPointer_stringify_adaptor(c) - ) - }, - WXWriteStringFile:function (filePath,data,encoding, s, f, c){ - window.WXWASMSDK.WXWriteStringFile( - _WXPointer_stringify_adaptor(filePath), - _WXPointer_stringify_adaptor(data), - _WXPointer_stringify_adaptor(encoding), - _WXPointer_stringify_adaptor(s), - _WXPointer_stringify_adaptor(f), - _WXPointer_stringify_adaptor(c) - ) - }, - WXAppendFile:function(filePath, data, dataLength, encoding, s, f, c){ - window.WXWASMSDK.WXAppendFile( - _WXPointer_stringify_adaptor(filePath), - HEAPU8.slice(data,dataLength+data), - _WXPointer_stringify_adaptor(encoding), - _WXPointer_stringify_adaptor(s), - _WXPointer_stringify_adaptor(f), - _WXPointer_stringify_adaptor(c) - ) - }, - WXAppendStringFile:function (filePath,data,encoding, s, f, c){ - window.WXWASMSDK.WXAppendStringFile( - _WXPointer_stringify_adaptor(filePath), - _WXPointer_stringify_adaptor(data), - _WXPointer_stringify_adaptor(encoding), - _WXPointer_stringify_adaptor(s), - _WXPointer_stringify_adaptor(f), - _WXPointer_stringify_adaptor(c) - ) - }, - WXWriteBinFileSync:function(filePath, data, dataLength, encoding){ - return window.WXWASMSDK.WXWriteBinFileSync( - _WXPointer_stringify_adaptor(filePath), - HEAPU8.slice(data,dataLength+data), - _WXPointer_stringify_adaptor(encoding) - ) - }, - WXReadFile:function(filePath, encoding,callbackId){ - window.WXWASMSDK.WXReadFile( - _WXPointer_stringify_adaptor(filePath), - _WXPointer_stringify_adaptor(encoding), - _WXPointer_stringify_adaptor(callbackId) - ); - }, - WXReadBinFileSync:function(filePath){ - return window.WXWASMSDK.WXReadFileSync( - _WXPointer_stringify_adaptor(filePath) - ); - }, - WXReadFileSync:function(filePath, encoding){ - var returnStr = window.WXWASMSDK.WXReadFileSync( _WXPointer_stringify_adaptor(filePath), _WXPointer_stringify_adaptor(encoding) ); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXShareFileBuffer:function(offset,callbackId){ - window.WXWASMSDK.WXShareFileBuffer( - HEAPU8, - offset, - _WXPointer_stringify_adaptor(callbackId) - ) - }, - WXGetTotalMemorySize: function() { - if (typeof TOTAL_MEMORY !== "undefined") { - return TOTAL_MEMORY - } - return buffer.byteLength; - }, - WXGetTotalStackSize: function() { - return TOTAL_STACK; - }, - WXGetStaticMemorySize: function() { - return STATICTOP - STATIC_BASE; - }, - WXGetDynamicMemorySize: function() { - if (typeof DYNAMIC_BASE !== "undefined") { - return HEAP32[DYNAMICTOP_PTR >> 2] - DYNAMIC_BASE - } - if (typeof emscriptenMemoryProfiler !== "undefined" && typeof Module["___heap_base"] !== "undefined") { - var heap_base = Module["___heap_base"]; - var heap_end = _sbrk(); - return heap_end - heap_base - } - return 0 - }, - WXGetUsedMemorySize: function() { - if (typeof emscriptenMemoryProfiler !== "undefined") { - return emscriptenMemoryProfiler.totalMemoryAllocated; - } - }, - WXGetUnAllocatedMemorySize: function() { - if (typeof emscriptenMemoryProfiler !== "undefined") { - var heap_end = _sbrk() - return HEAP8.length - heap_end - } - return 0 - }, - WXLogManagerDebug:function(str){ - window.WXWASMSDK.WXLogManagerDebug( - _WXPointer_stringify_adaptor(str) - ); - }, - WXLogManagerInfo:function(str){ - window.WXWASMSDK.WXLogManagerInfo( - _WXPointer_stringify_adaptor(str) - ); - }, - WXLogManagerLog:function(str){ - window.WXWASMSDK.WXLogManagerLog( - _WXPointer_stringify_adaptor(str) - ); - }, - WXLogManagerWarn:function(str){ - window.WXWASMSDK.WXLogManagerWarn( - _WXPointer_stringify_adaptor(str) - ); - }, - WXIsCloudTest:function(){ - return window.WXWASMSDK.WXIsCloudTest(); - }, - WXCleanAllFileCache:function() { - var returnStr = window.WXWASMSDK.WXCleanAllFileCache(); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXCleanFileCache: function(fileSize) { - var returnStr = window.WXWASMSDK.WXCleanFileCache(fileSize); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXRemoveFile: function(path) { - var returnStr = window.WXWASMSDK.WXRemoveFile(_WXPointer_stringify_adaptor(path)); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXOnLaunchProgress: function() { - var returnStr = window.WXWASMSDK.WXOnLaunchProgress(); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, - WXUncaughtException: function() { - window.WXWASMSDK.WXUncaughtException(false); - }, - WXPreLoadShortAudio:function(s){ - window.WXWASMSDK.WXPreLoadShortAudio(_WXPointer_stringify_adaptor(s)); - }, - WXStopOthersAndPlay:function(audio,loop,volume){ - window.WXWASMSDK.WXStopOthersAndPlay(_WXPointer_stringify_adaptor(audio),loop,volume); - }, - WXShortAudioPlayerStop:function(audio){ - window.WXWASMSDK.WXShortAudioPlayerStop(_WXPointer_stringify_adaptor(audio)); - }, - WXShortAudioPlayerDestroy:function(audio){ - window.WXWASMSDK.WXShortAudioPlayerDestroy(_WXPointer_stringify_adaptor(audio)); - }, - WXMkdir:function(dirPath, recursive, s, f, c){ - window.WXWASMSDK.WXMkdir(_WXPointer_stringify_adaptor(dirPath), recursive, _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c)); - }, - WXMkdirSync: function (dirPath, recursive) { - var returnStr = window.WXWASMSDK.WXMkdirSync(_WXPointer_stringify_adaptor(dirPath),recursive); - var bufferSize = lengthBytesUTF8(returnStr) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(returnStr, buffer, bufferSize); - return buffer; - }, -}); diff --git a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS-Old.jslib.meta b/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS-Old.jslib.meta deleted file mode 100644 index eb0d3e12..00000000 --- a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS-Old.jslib.meta +++ /dev/null @@ -1,32 +0,0 @@ -fileFormatVersion: 2 -guid: 63afc2a12fd6d404092ed133a0c10433 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - WebGL: WebGL - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS.jslib b/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS.jslib deleted file mode 100644 index 17ab4642..00000000 --- a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS.jslib +++ /dev/null @@ -1,879 +0,0 @@ -mergeInto(LibraryManager.library, { -WX_AddCard:function( conf, callbackId){ - window.WXWASMSDK.WX_AddCard(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_AuthPrivateMessage:function( conf, callbackId){ - window.WXWASMSDK.WX_AuthPrivateMessage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_Authorize:function( conf, callbackId){ - window.WXWASMSDK.WX_Authorize(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CheckHandoffEnabled:function( conf, callbackId){ - window.WXWASMSDK.WX_CheckHandoffEnabled(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CheckIsUserAdvisedToRest:function( conf, callbackId){ - window.WXWASMSDK.WX_CheckIsUserAdvisedToRest(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CheckSession:function( conf, callbackId){ - window.WXWASMSDK.WX_CheckSession(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ChooseImage:function( conf, callbackId){ - window.WXWASMSDK.WX_ChooseImage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CloseBLEConnection:function( conf, callbackId){ - window.WXWASMSDK.WX_CloseBLEConnection(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CloseBluetoothAdapter:function( conf, callbackId){ - window.WXWASMSDK.WX_CloseBluetoothAdapter(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CloseSocket:function( conf, callbackId){ - window.WXWASMSDK.WX_CloseSocket(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CreateBLEConnection:function( conf, callbackId){ - window.WXWASMSDK.WX_CreateBLEConnection(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CreateBLEPeripheralServer:function( conf, callbackId){ - window.WXWASMSDK.WX_CreateBLEPeripheralServer(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ExitMiniProgram:function( conf, callbackId){ - window.WXWASMSDK.WX_ExitMiniProgram(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ExitVoIPChat:function( conf, callbackId){ - window.WXWASMSDK.WX_ExitVoIPChat(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_FaceDetect:function( conf, callbackId){ - window.WXWASMSDK.WX_FaceDetect(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetAvailableAudioSources:function( conf, callbackId){ - window.WXWASMSDK.WX_GetAvailableAudioSources(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBLEDeviceCharacteristics:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBLEDeviceCharacteristics(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBLEDeviceRSSI:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBLEDeviceRSSI(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBLEDeviceServices:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBLEDeviceServices(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBLEMTU:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBLEMTU(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBatteryInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBatteryInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBeacons:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBeacons(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBluetoothAdapterState:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBluetoothAdapterState(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetBluetoothDevices:function( conf, callbackId){ - window.WXWASMSDK.WX_GetBluetoothDevices(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetChannelsLiveInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetChannelsLiveInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetChannelsLiveNoticeInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetChannelsLiveNoticeInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetClipboardData:function( conf, callbackId){ - window.WXWASMSDK.WX_GetClipboardData(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetConnectedBluetoothDevices:function( conf, callbackId){ - window.WXWASMSDK.WX_GetConnectedBluetoothDevices(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetExtConfig:function( conf, callbackId){ - window.WXWASMSDK.WX_GetExtConfig(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetFileInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetFileInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetFriendCloudStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_GetFriendCloudStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetGroupCloudStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_GetGroupCloudStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetGroupEnterInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetGroupEnterInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetGroupInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetGroupInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetLocalIPAddress:function( conf, callbackId){ - window.WXWASMSDK.WX_GetLocalIPAddress(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetLocation:function( conf, callbackId){ - window.WXWASMSDK.WX_GetLocation(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetNetworkType:function( conf, callbackId){ - window.WXWASMSDK.WX_GetNetworkType(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetPotentialFriendList:function( conf, callbackId){ - window.WXWASMSDK.WX_GetPotentialFriendList(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetScreenBrightness:function( conf, callbackId){ - window.WXWASMSDK.WX_GetScreenBrightness(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetSetting:function( conf, callbackId){ - window.WXWASMSDK.WX_GetSetting(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetShareInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetShareInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetStorageInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetStorageInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetSystemInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetSystemInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetSystemInfoAsync:function( conf, callbackId){ - window.WXWASMSDK.WX_GetSystemInfoAsync(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetUserCloudStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_GetUserCloudStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetUserCloudStorageKeys:function( conf, callbackId){ - window.WXWASMSDK.WX_GetUserCloudStorageKeys(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetUserInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetUserInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetUserInteractiveStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_GetUserInteractiveStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetWeRunData:function( conf, callbackId){ - window.WXWASMSDK.WX_GetWeRunData(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_HideKeyboard:function( conf, callbackId){ - window.WXWASMSDK.WX_HideKeyboard(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_HideLoading:function( conf, callbackId){ - window.WXWASMSDK.WX_HideLoading(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_HideShareMenu:function( conf, callbackId){ - window.WXWASMSDK.WX_HideShareMenu(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_HideToast:function( conf, callbackId){ - window.WXWASMSDK.WX_HideToast(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_InitFaceDetect:function( conf, callbackId){ - window.WXWASMSDK.WX_InitFaceDetect(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_IsBluetoothDevicePaired:function( conf, callbackId){ - window.WXWASMSDK.WX_IsBluetoothDevicePaired(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_JoinVoIPChat:function( conf, callbackId){ - window.WXWASMSDK.WX_JoinVoIPChat(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_Login:function( conf, callbackId){ - window.WXWASMSDK.WX_Login(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_MakeBluetoothPair:function( conf, callbackId){ - window.WXWASMSDK.WX_MakeBluetoothPair(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ModifyFriendInteractiveStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_ModifyFriendInteractiveStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_NavigateToMiniProgram:function( conf, callbackId){ - window.WXWASMSDK.WX_NavigateToMiniProgram(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_NotifyBLECharacteristicValueChange:function( conf, callbackId){ - window.WXWASMSDK.WX_NotifyBLECharacteristicValueChange(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenBluetoothAdapter:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenBluetoothAdapter(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenCard:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenCard(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenChannelsActivity:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenChannelsActivity(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenChannelsEvent:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenChannelsEvent(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenChannelsLive:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenChannelsLive(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenChannelsUserProfile:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenChannelsUserProfile(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenCustomerServiceConversation:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenCustomerServiceConversation(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenSetting:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenSetting(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_PreviewImage:function( conf, callbackId){ - window.WXWASMSDK.WX_PreviewImage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_PreviewMedia:function( conf, callbackId){ - window.WXWASMSDK.WX_PreviewMedia(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ReadBLECharacteristicValue:function( conf, callbackId){ - window.WXWASMSDK.WX_ReadBLECharacteristicValue(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_RemoveStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_RemoveStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_RemoveUserCloudStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_RemoveUserCloudStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_RequestMidasFriendPayment:function( conf, callbackId){ - window.WXWASMSDK.WX_RequestMidasFriendPayment(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_RequestMidasPayment:function( conf, callbackId){ - window.WXWASMSDK.WX_RequestMidasPayment(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_RequestSubscribeMessage:function( conf, callbackId){ - window.WXWASMSDK.WX_RequestSubscribeMessage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_RequestSubscribeSystemMessage:function( conf, callbackId){ - window.WXWASMSDK.WX_RequestSubscribeSystemMessage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SaveFileToDisk:function( conf, callbackId){ - window.WXWASMSDK.WX_SaveFileToDisk(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SaveImageToPhotosAlbum:function( conf, callbackId){ - window.WXWASMSDK.WX_SaveImageToPhotosAlbum(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ScanCode:function( conf, callbackId){ - window.WXWASMSDK.WX_ScanCode(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SendSocketMessage:function( conf, callbackId){ - window.WXWASMSDK.WX_SendSocketMessage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetBLEMTU:function( conf, callbackId){ - window.WXWASMSDK.WX_SetBLEMTU(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetClipboardData:function( conf, callbackId){ - window.WXWASMSDK.WX_SetClipboardData(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetEnableDebug:function( conf, callbackId){ - window.WXWASMSDK.WX_SetEnableDebug(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetInnerAudioOption:function( conf, callbackId){ - window.WXWASMSDK.WX_SetInnerAudioOption(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetKeepScreenOn:function( conf, callbackId){ - window.WXWASMSDK.WX_SetKeepScreenOn(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetMenuStyle:function( conf, callbackId){ - window.WXWASMSDK.WX_SetMenuStyle(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetScreenBrightness:function( conf, callbackId){ - window.WXWASMSDK.WX_SetScreenBrightness(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetStatusBarStyle:function( conf, callbackId){ - window.WXWASMSDK.WX_SetStatusBarStyle(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_SetUserCloudStorage:function( conf, callbackId){ - window.WXWASMSDK.WX_SetUserCloudStorage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShareMessageToFriend:function( conf, callbackId){ - window.WXWASMSDK.WX_ShareMessageToFriend(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShowActionSheet:function( conf, callbackId){ - window.WXWASMSDK.WX_ShowActionSheet(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShowKeyboard:function( conf, callbackId){ - window.WXWASMSDK.WX_ShowKeyboard(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShowLoading:function( conf, callbackId){ - window.WXWASMSDK.WX_ShowLoading(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShowModal:function( conf, callbackId){ - window.WXWASMSDK.WX_ShowModal(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShowShareImageMenu:function( conf, callbackId){ - window.WXWASMSDK.WX_ShowShareImageMenu(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShowShareMenu:function( conf, callbackId){ - window.WXWASMSDK.WX_ShowShareMenu(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_ShowToast:function( conf, callbackId){ - window.WXWASMSDK.WX_ShowToast(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StartAccelerometer:function( conf, callbackId){ - window.WXWASMSDK.WX_StartAccelerometer(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StartBeaconDiscovery:function( conf, callbackId){ - window.WXWASMSDK.WX_StartBeaconDiscovery(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StartBluetoothDevicesDiscovery:function( conf, callbackId){ - window.WXWASMSDK.WX_StartBluetoothDevicesDiscovery(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StartCompass:function( conf, callbackId){ - window.WXWASMSDK.WX_StartCompass(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StartDeviceMotionListening:function( conf, callbackId){ - window.WXWASMSDK.WX_StartDeviceMotionListening(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StartGyroscope:function( conf, callbackId){ - window.WXWASMSDK.WX_StartGyroscope(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StopAccelerometer:function( conf, callbackId){ - window.WXWASMSDK.WX_StopAccelerometer(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StopBeaconDiscovery:function( conf, callbackId){ - window.WXWASMSDK.WX_StopBeaconDiscovery(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StopBluetoothDevicesDiscovery:function( conf, callbackId){ - window.WXWASMSDK.WX_StopBluetoothDevicesDiscovery(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StopCompass:function( conf, callbackId){ - window.WXWASMSDK.WX_StopCompass(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StopDeviceMotionListening:function( conf, callbackId){ - window.WXWASMSDK.WX_StopDeviceMotionListening(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StopFaceDetect:function( conf, callbackId){ - window.WXWASMSDK.WX_StopFaceDetect(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StopGyroscope:function( conf, callbackId){ - window.WXWASMSDK.WX_StopGyroscope(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_UpdateKeyboard:function( conf, callbackId){ - window.WXWASMSDK.WX_UpdateKeyboard(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_UpdateShareMenu:function( conf, callbackId){ - window.WXWASMSDK.WX_UpdateShareMenu(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_UpdateVoIPChatMuteConfig:function( conf, callbackId){ - window.WXWASMSDK.WX_UpdateVoIPChatMuteConfig(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_UpdateWeChatApp:function( conf, callbackId){ - window.WXWASMSDK.WX_UpdateWeChatApp(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_VibrateLong:function( conf, callbackId){ - window.WXWASMSDK.WX_VibrateLong(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_VibrateShort:function( conf, callbackId){ - window.WXWASMSDK.WX_VibrateShort(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_WriteBLECharacteristicValue:function( conf, callbackId){ - window.WXWASMSDK.WX_WriteBLECharacteristicValue(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_StartGameLive:function( conf, callbackId){ - window.WXWASMSDK.WX_StartGameLive(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_CheckGameLiveEnabled:function( conf, callbackId){ - window.WXWASMSDK.WX_CheckGameLiveEnabled(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetUserCurrentGameliveInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetUserCurrentGameliveInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetUserRecentGameLiveInfo:function( conf, callbackId){ - window.WXWASMSDK.WX_GetUserRecentGameLiveInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_GetUserGameLiveDetails:function( conf, callbackId){ - window.WXWASMSDK.WX_GetUserGameLiveDetails(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, -WX_OpenChannelsLiveCollection:function( conf, callbackId){ - window.WXWASMSDK.WX_OpenChannelsLiveCollection(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); -}, - -WX_RestartMiniProgram:function(){ - window.WXWASMSDK.WX_RestartMiniProgram(); -}, -WX_RemoveStorageSync:function(key){ - window.WXWASMSDK.WX_RemoveStorageSync(_WXPointer_stringify_adaptor(key)); -}, -WX_ReportEvent:function(eventId,data){ - window.WXWASMSDK.WX_ReportEvent(_WXPointer_stringify_adaptor(eventId),_WXPointer_stringify_adaptor(data)); -}, -WX_ReportMonitor:function(name,value){ - window.WXWASMSDK.WX_ReportMonitor(_WXPointer_stringify_adaptor(name),value); -}, -WX_ReportPerformance:function(id,value,dimensions){ - window.WXWASMSDK.WX_ReportPerformance(id,value,_WXPointer_stringify_adaptor(dimensions)); -}, -WX_ReportUserBehaviorBranchAnalytics:function(option){ - window.WXWASMSDK.WX_ReportUserBehaviorBranchAnalytics(_WXPointer_stringify_adaptor(option)); -}, -WX_ReserveChannelsLive:function(option){ - window.WXWASMSDK.WX_ReserveChannelsLive(_WXPointer_stringify_adaptor(option)); -}, -WX_RevokeBufferURL:function(url){ - window.WXWASMSDK.WX_RevokeBufferURL(_WXPointer_stringify_adaptor(url)); -}, -WX_SetPreferredFramesPerSecond:function(fps){ - window.WXWASMSDK.WX_SetPreferredFramesPerSecond(fps); -}, -WX_SetStorageSync:function(key,data,encrypt){ - window.WXWASMSDK.WX_SetStorageSync(_WXPointer_stringify_adaptor(key),_WXPointer_stringify_adaptor(data),encrypt); -}, -WX_ShareAppMessage:function(option){ - window.WXWASMSDK.WX_ShareAppMessage(_WXPointer_stringify_adaptor(option)); -}, -WX_TriggerGC:function(){ - window.WXWASMSDK.WX_TriggerGC(); -}, -WX_StopDownloadTexture:function(){ - window.WXWASMSDK.WX_StopDownloadTexture(); -}, -WX_StarDownloadTexture:function(){ - window.WXWASMSDK.WX_StarDownloadTexture(); -}, - -WX_OnAccelerometerChange:function(){ - window.WXWASMSDK.WX_OnAccelerometerChange(); -}, -WX_OffAccelerometerChange:function(){ - window.WXWASMSDK.WX_OffAccelerometerChange(); -}, -WX_OnAudioInterruptionBegin:function(){ - window.WXWASMSDK.WX_OnAudioInterruptionBegin(); -}, -WX_OffAudioInterruptionBegin:function(){ - window.WXWASMSDK.WX_OffAudioInterruptionBegin(); -}, -WX_OnAudioInterruptionEnd:function(){ - window.WXWASMSDK.WX_OnAudioInterruptionEnd(); -}, -WX_OffAudioInterruptionEnd:function(){ - window.WXWASMSDK.WX_OffAudioInterruptionEnd(); -}, -WX_OnBLECharacteristicValueChange:function(){ - window.WXWASMSDK.WX_OnBLECharacteristicValueChange(); -}, -WX_OffBLECharacteristicValueChange:function(){ - window.WXWASMSDK.WX_OffBLECharacteristicValueChange(); -}, -WX_OnBLEConnectionStateChange:function(){ - window.WXWASMSDK.WX_OnBLEConnectionStateChange(); -}, -WX_OffBLEConnectionStateChange:function(){ - window.WXWASMSDK.WX_OffBLEConnectionStateChange(); -}, -WX_OnBLEMTUChange:function(){ - window.WXWASMSDK.WX_OnBLEMTUChange(); -}, -WX_OffBLEMTUChange:function(){ - window.WXWASMSDK.WX_OffBLEMTUChange(); -}, -WX_OnBLEPeripheralConnectionStateChanged:function(){ - window.WXWASMSDK.WX_OnBLEPeripheralConnectionStateChanged(); -}, -WX_OffBLEPeripheralConnectionStateChanged:function(){ - window.WXWASMSDK.WX_OffBLEPeripheralConnectionStateChanged(); -}, -WX_OnBeaconServiceChange:function(){ - window.WXWASMSDK.WX_OnBeaconServiceChange(); -}, -WX_OffBeaconServiceChange:function(){ - window.WXWASMSDK.WX_OffBeaconServiceChange(); -}, -WX_OnBeaconUpdate:function(){ - window.WXWASMSDK.WX_OnBeaconUpdate(); -}, -WX_OffBeaconUpdate:function(){ - window.WXWASMSDK.WX_OffBeaconUpdate(); -}, -WX_OnBluetoothAdapterStateChange:function(){ - window.WXWASMSDK.WX_OnBluetoothAdapterStateChange(); -}, -WX_OffBluetoothAdapterStateChange:function(){ - window.WXWASMSDK.WX_OffBluetoothAdapterStateChange(); -}, -WX_OnBluetoothDeviceFound:function(){ - window.WXWASMSDK.WX_OnBluetoothDeviceFound(); -}, -WX_OffBluetoothDeviceFound:function(){ - window.WXWASMSDK.WX_OffBluetoothDeviceFound(); -}, -WX_OnCompassChange:function(){ - window.WXWASMSDK.WX_OnCompassChange(); -}, -WX_OffCompassChange:function(){ - window.WXWASMSDK.WX_OffCompassChange(); -}, -WX_OnDeviceMotionChange:function(){ - window.WXWASMSDK.WX_OnDeviceMotionChange(); -}, -WX_OffDeviceMotionChange:function(){ - window.WXWASMSDK.WX_OffDeviceMotionChange(); -}, -WX_OnDeviceOrientationChange:function(){ - window.WXWASMSDK.WX_OnDeviceOrientationChange(); -}, -WX_OffDeviceOrientationChange:function(){ - window.WXWASMSDK.WX_OffDeviceOrientationChange(); -}, -WX_OnError:function(){ - window.WXWASMSDK.WX_OnError(); -}, -WX_OffError:function(){ - window.WXWASMSDK.WX_OffError(); -}, -WX_OnGyroscopeChange:function(){ - window.WXWASMSDK.WX_OnGyroscopeChange(); -}, -WX_OffGyroscopeChange:function(){ - window.WXWASMSDK.WX_OffGyroscopeChange(); -}, -WX_OnHide:function(){ - window.WXWASMSDK.WX_OnHide(); -}, -WX_OffHide:function(){ - window.WXWASMSDK.WX_OffHide(); -}, -WX_OnInteractiveStorageModified:function(){ - window.WXWASMSDK.WX_OnInteractiveStorageModified(); -}, -WX_OffInteractiveStorageModified:function(){ - window.WXWASMSDK.WX_OffInteractiveStorageModified(); -}, -WX_OnKeyDown:function(){ - window.WXWASMSDK.WX_OnKeyDown(); -}, -WX_OffKeyDown:function(){ - window.WXWASMSDK.WX_OffKeyDown(); -}, -WX_OnKeyUp:function(){ - window.WXWASMSDK.WX_OnKeyUp(); -}, -WX_OffKeyUp:function(){ - window.WXWASMSDK.WX_OffKeyUp(); -}, -WX_OnKeyboardComplete:function(){ - window.WXWASMSDK.WX_OnKeyboardComplete(); -}, -WX_OffKeyboardComplete:function(){ - window.WXWASMSDK.WX_OffKeyboardComplete(); -}, -WX_OnKeyboardConfirm:function(){ - window.WXWASMSDK.WX_OnKeyboardConfirm(); -}, -WX_OffKeyboardConfirm:function(){ - window.WXWASMSDK.WX_OffKeyboardConfirm(); -}, -WX_OnKeyboardHeightChange:function(){ - window.WXWASMSDK.WX_OnKeyboardHeightChange(); -}, -WX_OffKeyboardHeightChange:function(){ - window.WXWASMSDK.WX_OffKeyboardHeightChange(); -}, -WX_OnKeyboardInput:function(){ - window.WXWASMSDK.WX_OnKeyboardInput(); -}, -WX_OffKeyboardInput:function(){ - window.WXWASMSDK.WX_OffKeyboardInput(); -}, -WX_OnMemoryWarning:function(){ - window.WXWASMSDK.WX_OnMemoryWarning(); -}, -WX_OffMemoryWarning:function(){ - window.WXWASMSDK.WX_OffMemoryWarning(); -}, -WX_OnMessage:function(){ - window.WXWASMSDK.WX_OnMessage(); -}, -WX_OffMessage:function(){ - window.WXWASMSDK.WX_OffMessage(); -}, -WX_OnNetworkStatusChange:function(){ - window.WXWASMSDK.WX_OnNetworkStatusChange(); -}, -WX_OffNetworkStatusChange:function(){ - window.WXWASMSDK.WX_OffNetworkStatusChange(); -}, -WX_OnNetworkWeakChange:function(){ - window.WXWASMSDK.WX_OnNetworkWeakChange(); -}, -WX_OffNetworkWeakChange:function(){ - window.WXWASMSDK.WX_OffNetworkWeakChange(); -}, -WX_OnShareMessageToFriend:function(){ - window.WXWASMSDK.WX_OnShareMessageToFriend(); -}, -WX_OffShareMessageToFriend:function(){ - window.WXWASMSDK.WX_OffShareMessageToFriend(); -}, -WX_OnShow:function(){ - window.WXWASMSDK.WX_OnShow(); -}, -WX_OffShow:function(){ - window.WXWASMSDK.WX_OffShow(); -}, -WX_OnSocketClose:function(){ - window.WXWASMSDK.WX_OnSocketClose(); -}, -WX_OffSocketClose:function(){ - window.WXWASMSDK.WX_OffSocketClose(); -}, -WX_OnSocketError:function(){ - window.WXWASMSDK.WX_OnSocketError(); -}, -WX_OffSocketError:function(){ - window.WXWASMSDK.WX_OffSocketError(); -}, -WX_OnSocketMessage:function(){ - window.WXWASMSDK.WX_OnSocketMessage(); -}, -WX_OffSocketMessage:function(){ - window.WXWASMSDK.WX_OffSocketMessage(); -}, -WX_OnSocketOpen:function(){ - window.WXWASMSDK.WX_OnSocketOpen(); -}, -WX_OffSocketOpen:function(){ - window.WXWASMSDK.WX_OffSocketOpen(); -}, -WX_OnTouchCancel:function(){ - window.WXWASMSDK.WX_OnTouchCancel(); -}, -WX_OffTouchCancel:function(){ - window.WXWASMSDK.WX_OffTouchCancel(); -}, -WX_OnTouchEnd:function(){ - window.WXWASMSDK.WX_OnTouchEnd(); -}, -WX_OffTouchEnd:function(){ - window.WXWASMSDK.WX_OffTouchEnd(); -}, -WX_OnTouchMove:function(){ - window.WXWASMSDK.WX_OnTouchMove(); -}, -WX_OffTouchMove:function(){ - window.WXWASMSDK.WX_OffTouchMove(); -}, -WX_OnTouchStart:function(){ - window.WXWASMSDK.WX_OnTouchStart(); -}, -WX_OffTouchStart:function(){ - window.WXWASMSDK.WX_OffTouchStart(); -}, -WX_OnUnhandledRejection:function(){ - window.WXWASMSDK.WX_OnUnhandledRejection(); -}, -WX_OffUnhandledRejection:function(){ - window.WXWASMSDK.WX_OffUnhandledRejection(); -}, -WX_OnUserCaptureScreen:function(){ - window.WXWASMSDK.WX_OnUserCaptureScreen(); -}, -WX_OffUserCaptureScreen:function(){ - window.WXWASMSDK.WX_OffUserCaptureScreen(); -}, -WX_OnVoIPChatInterrupted:function(){ - window.WXWASMSDK.WX_OnVoIPChatInterrupted(); -}, -WX_OffVoIPChatInterrupted:function(){ - window.WXWASMSDK.WX_OffVoIPChatInterrupted(); -}, -WX_OnVoIPChatMembersChanged:function(){ - window.WXWASMSDK.WX_OnVoIPChatMembersChanged(); -}, -WX_OffVoIPChatMembersChanged:function(){ - window.WXWASMSDK.WX_OffVoIPChatMembersChanged(); -}, -WX_OnVoIPChatSpeakersChanged:function(){ - window.WXWASMSDK.WX_OnVoIPChatSpeakersChanged(); -}, -WX_OffVoIPChatSpeakersChanged:function(){ - window.WXWASMSDK.WX_OffVoIPChatSpeakersChanged(); -}, -WX_OnVoIPChatStateChanged:function(){ - window.WXWASMSDK.WX_OnVoIPChatStateChanged(); -}, -WX_OffVoIPChatStateChanged:function(){ - window.WXWASMSDK.WX_OffVoIPChatStateChanged(); -}, -WX_OnWindowResize:function(){ - window.WXWASMSDK.WX_OnWindowResize(); -}, -WX_OffWindowResize:function(){ - window.WXWASMSDK.WX_OffWindowResize(); -}, - -WX_OnAddToFavorites:function(){ - window.WXWASMSDK.WX_OnAddToFavorites(); -}, -WX_OffAddToFavorites:function(){ - window.WXWASMSDK.WX_OffAddToFavorites(); -}, -WX_OnAddToFavorites_Resolve:function(conf){ - window.WXWASMSDK.WX_OnAddToFavorites_Resolve(_WXPointer_stringify_adaptor(conf)); -}, -WX_OnCopyUrl:function(){ - window.WXWASMSDK.WX_OnCopyUrl(); -}, -WX_OffCopyUrl:function(){ - window.WXWASMSDK.WX_OffCopyUrl(); -}, -WX_OnCopyUrl_Resolve:function(conf){ - window.WXWASMSDK.WX_OnCopyUrl_Resolve(_WXPointer_stringify_adaptor(conf)); -}, -WX_OnHandoff:function(){ - window.WXWASMSDK.WX_OnHandoff(); -}, -WX_OffHandoff:function(){ - window.WXWASMSDK.WX_OffHandoff(); -}, -WX_OnHandoff_Resolve:function(conf){ - window.WXWASMSDK.WX_OnHandoff_Resolve(_WXPointer_stringify_adaptor(conf)); -}, -WX_OnShareTimeline:function(){ - window.WXWASMSDK.WX_OnShareTimeline(); -}, -WX_OffShareTimeline:function(){ - window.WXWASMSDK.WX_OffShareTimeline(); -}, -WX_OnShareTimeline_Resolve:function(conf){ - window.WXWASMSDK.WX_OnShareTimeline_Resolve(_WXPointer_stringify_adaptor(conf)); -}, -WX_OnGameLiveStateChange:function(){ - window.WXWASMSDK.WX_OnGameLiveStateChange(); -}, -WX_OffGameLiveStateChange:function(){ - window.WXWASMSDK.WX_OffGameLiveStateChange(); -}, -WX_OnGameLiveStateChange_Resolve:function(conf){ - window.WXWASMSDK.WX_OnGameLiveStateChange_Resolve(_WXPointer_stringify_adaptor(conf)); -}, - -WX_SetHandoffQuery:function( - query -){ - var res = window.WXWASMSDK.WX_SetHandoffQuery(_WXPointer_stringify_adaptor(query)); - return res; -}, -WX_GetAccountInfoSync:function( -){ - var res = window.WXWASMSDK.WX_GetAccountInfoSync(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetBatteryInfoSync:function( -){ - var res = window.WXWASMSDK.WX_GetBatteryInfoSync(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetEnterOptionsSync:function( -){ - var res = window.WXWASMSDK.WX_GetEnterOptionsSync(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetExptInfoSync:function( - keys -){ - var res = window.WXWASMSDK.WX_GetExptInfoSync(_WXPointer_stringify_adaptor(keys)); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetExtConfigSync:function( -){ - var res = window.WXWASMSDK.WX_GetExtConfigSync(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetLaunchOptionsSync:function( -){ - var res = window.WXWASMSDK.WX_GetLaunchOptionsSync(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetMenuButtonBoundingClientRect:function( -){ - var res = window.WXWASMSDK.WX_GetMenuButtonBoundingClientRect(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetStorageInfoSync:function( -){ - var res = window.WXWASMSDK.WX_GetStorageInfoSync(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetSystemInfoSync:function( -){ - var res = window.WXWASMSDK.WX_GetSystemInfoSync(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_SetCursor:function( - path,x,y -){ - var res = window.WXWASMSDK.WX_SetCursor(_WXPointer_stringify_adaptor(path),x,y); - return res; -}, -WX_SetMessageToFriendQuery:function( - option -){ - var res = window.WXWASMSDK.WX_SetMessageToFriendQuery(_WXPointer_stringify_adaptor(option)); - return res; -}, -WX_GetTextLineHeight:function( - option -){ - var res = window.WXWASMSDK.WX_GetTextLineHeight(_WXPointer_stringify_adaptor(option)); - return res; -}, -WX_LoadFont:function( - path -){ - var res = window.WXWASMSDK.WX_LoadFont(_WXPointer_stringify_adaptor(path)); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, -WX_GetGameLiveState:function( -){ - var res = window.WXWASMSDK.WX_GetGameLiveState(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; -}, - - WX_GetUpdateManager:function( -){ - var res = window.WXWASMSDK.WX_GetUpdateManager(); - var bufferSize = lengthBytesUTF8(res) + 1; - var buffer = _malloc(bufferSize); - stringToUTF8(res, buffer, bufferSize); - return buffer; - }, - - -WX_ApplyUpdate:function(id){ - window.WXWASMSDK.WX_ApplyUpdate(_WXPointer_stringify_adaptor(id)); -}, - -WX_OnCheckForUpdate:function(id){ - window.WXWASMSDK.WX_OnCheckForUpdate(_WXPointer_stringify_adaptor(id)); -}, - -WX_OnUpdateFailed:function(id){ - window.WXWASMSDK.WX_OnUpdateFailed(_WXPointer_stringify_adaptor(id)); -}, - -WX_OnUpdateReady:function(id){ - window.WXWASMSDK.WX_OnUpdateReady(_WXPointer_stringify_adaptor(id)); -}, - -}) \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS.jslib.meta b/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS.jslib.meta deleted file mode 100644 index 62c97ba7..00000000 --- a/Assets/WX-WASM-SDK/Plugins/SDK-Call-JS.jslib.meta +++ /dev/null @@ -1,32 +0,0 @@ -fileFormatVersion: 2 -guid: 340c9937849614db7bd7a069ff60c77b -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - WebGL: WebGL - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Plugins/UDP.jslib b/Assets/WX-WASM-SDK/Plugins/UDP.jslib deleted file mode 100644 index 941f2b2a..00000000 --- a/Assets/WX-WASM-SDK/Plugins/UDP.jslib +++ /dev/null @@ -1,110 +0,0 @@ -var UDPSocketLibrary = -{ - $udpSocketManager: - { - /* - * Map of instances - * - * Instance structure: - * { - * url: string, - * ws: WebSocket - * } - */ - instances: {}, - - /* Last instance ID */ - lastId: 0, - - /* Event listeners */ - onOpen: null, - onMessage: null, - onError: null, - onClose: null, - }, - - - WXCreateUDPSocket: function (server, remotePort, localPort) { - var instanceId = ++udpSocketManager.lastId; - var udpSocket = wx.createUDPSocket(); - if (localPort == 0) { - localPort = udpSocket.bind() - } else { - udpSocket.bind(localPort) - } - var instance = { - instanceId: instanceId, - socket: udpSocket, - server: UTF8ToString(server), - remotePort: remotePort, - localPort: localPort, - OnMessage: (function (res) { - if (udpSocketManager.onMessage) { - var dataBuffer = new Uint8Array(res.message); - var buffer = _malloc(dataBuffer.length); - HEAPU8.set(dataBuffer, buffer); - Module.dynCall_viii(udpSocketManager.onMessage, instanceId, buffer, dataBuffer.length); - _free(buffer) - } - }), - OnError: (function (res) { - if (udpSocketManager.onError) { - var msg = res.errMsg; - console.log("udp socket on error " + instanceId + " " + msg); - var length = lengthBytesUTF8(msg) + 1; - var buffer = _malloc(length); - stringToUTF8(msg, buffer, length); - Module.dynCall_vii(udpSocketManager.onError, instanceId, buffer); - _free(buffer) - } - }), - OnClose: (function (res) { - if (udpSocketManager.onClose) { - Module.dynCall_vi(udpSocketManager.onClose, instanceId) - } - }) - }; - udpSocket.onMessage(instance.OnMessage); - udpSocket.onError(instance.OnError); - udpSocket.onClose(instance.OnClose); - udpSocketManager.instances[instanceId] = instance; - return instanceId - }, - - WXSendUDPSocket: function (instanceId, bufferPtr, offset, length) { - var instance = udpSocketManager.instances[instanceId]; - if (instance && instance.socket) { - instance.socket.send({ - address: instance.server, - port: instance.remotePort, - message: buffer.slice(bufferPtr + offset, bufferPtr + length) - }) - } else { - console.log("udp socket instance not found " + instanceId) - } - }, - - WXCloseUDPSocket: function (instanceId) { - var instance = udpSocketManager.instances[instanceId]; - if (instance && instance.socket) { - instance.socket.close(); - instance.socket = null; - delete udpSocketManager.instances[instanceId] - } else { - console.log("udp socket instance not found " + instanceId) - } - }, - WXUDPSocketSetOnMessage: function (callback) { - udpSocketManager.onMessage = callback - }, - - WXUDPSocketSetOnClose: function (callback) { - udpSocketManager.onClose = callback - }, - WXUDPSocketSetOnError: function (callback) { - udpSocketManager.onError = callback - } -}; - -autoAddDeps(UDPSocketLibrary, '$udpSocketManager'); -mergeInto(LibraryManager.library, UDPSocketLibrary); \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/Plugins/UDP.jslib.meta b/Assets/WX-WASM-SDK/Plugins/UDP.jslib.meta deleted file mode 100644 index 0b6fb3a6..00000000 --- a/Assets/WX-WASM-SDK/Plugins/UDP.jslib.meta +++ /dev/null @@ -1,32 +0,0 @@ -fileFormatVersion: 2 -guid: 1a619860d36bdfb4eaa583d3ba561e99 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - WebGL: WebGL - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/Plugins/dumper.jslib b/Assets/WX-WASM-SDK/Plugins/dumper.jslib deleted file mode 100644 index e5c06782..00000000 --- a/Assets/WX-WASM-SDK/Plugins/dumper.jslib +++ /dev/null @@ -1,36 +0,0 @@ -mergeInto(LibraryManager.library, { - DumpUICallback: function (str) { - if(typeof GameGlobal!='undefined'){ - GameGlobal.monkeyCallback(_WXPointer_stringify_adaptor(str)); - } - }, - GetScreenSizeCallback: function(width, height){ - if(typeof GameGlobal!='undefined'){ - GameGlobal.monkeyCallback([width, height]); - } - }, - GetUnityVersionCallback: function(version){ - if(typeof GameGlobal!='undefined'){ - GameGlobal.monkeyCallback(_WXPointer_stringify_adaptor(version)); - } - - }, - GetUnityFrameRateCallback: function(rate){ - if(typeof GameGlobal!='undefined'){ - GameGlobal.monkeyCallback(rate) - } - - }, - GetUnityCacheDetailCallback: function(str) { - if(typeof GameGlobal!='undefined'){ - GameGlobal.monkeyCallback(_WXPointer_stringify_adaptor(str)); - } - - }, - SetUnityUIType: function(str){ - if(typeof GameGlobal!='undefined'){ - GameGlobal.UnityUIType = _WXPointer_stringify_adaptor(str); - } - - }, -}); diff --git a/Assets/WX-WASM-SDK/Plugins/dumper.jslib.meta b/Assets/WX-WASM-SDK/Plugins/dumper.jslib.meta deleted file mode 100644 index ee7f1cc8..00000000 --- a/Assets/WX-WASM-SDK/Plugins/dumper.jslib.meta +++ /dev/null @@ -1,32 +0,0 @@ -fileFormatVersion: 2 -guid: dae845d21bfc9479cbd0cbe4e34ac070 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - WebGL: WebGL - second: - enabled: 1 - settings: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/UnityDumper.cs b/Assets/WX-WASM-SDK/UnityDumper.cs deleted file mode 100644 index 1578b85b..00000000 --- a/Assets/WX-WASM-SDK/UnityDumper.cs +++ /dev/null @@ -1,795 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using UnityEngine; -using UnityEngine.SceneManagement; -using LitJson; //LisJson支持vector3等 https://www.cnblogs.com/msxh/p/12541159.html -using System.Runtime.InteropServices; -#if UNITY_UI_FAIRYGUI -using FairyGUI; -#endif -namespace WeChatWASM -{ - - public class UnityDumper : MonoBehaviour { - - public class CObjectData - { - public string url; - public string format; - public string name; - public long cpuMemory; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void DumpUICallback(string str); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void GetScreenSizeCallback(int width, int height); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void GetUnityVersionCallback(string version); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void GetUnityFrameRateCallback(int rate); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void GetUnityCacheDetailCallback(string str); - - public static int index = 1; - private static string sceneName = ""; - private static Camera cam; - private static long allMemory = 0; - - #if UNITY_UI_UGUI - public static string platform = "ugui"; - #elif UNITY_UI_NGUI - public static string platform = "ngui"; - #elif UNITY_UI_FAIRYGUI - public static string platform = "fairygui"; - #else - public static string platform = "undefined"; - #endif - - public void getNowScenesComponents() { - if(platform == "undefined") { - DumpUICallback(""); - } - - Debug.Log("getNowScenesComponents"); - cam = Camera.main; - List forest = new List(); - Scene scene = SceneManager.GetActiveScene(); - sceneName = scene.name; - if(sceneName.Length == 0) { - sceneName = "default"; - } - index = 1; - foreach (GameObject rootObj in scene.GetRootGameObjects()) { - if (rootObj.transform.parent == null) { - // Debug.Log(rootObj.name + ":" + rootObj.GetType().Name); - Node node = new Node(rootObj, "0"); - forest.Add(node); - } - } - - Node rootNode = new Node("root", forest); - // WriteFileByLine (Application.persistentDataPath,String.Format("tree_{0}.txt", 0), JsonMapper.ToJson(rootNode)); - - // var countI = 0; - // Debug.Log(Application.persistentDataPath); - // foreach(string str in forest) { - // WriteFileByLine (Application.persistentDataPath,String.Format("tree_{0}.txt", countI), str); - // countI++; - // } - // Debug.Log(JsonMapper.ToJson(rootNode)); - DumpUICallback(JsonMapper.ToJson(rootNode)); - } - - private static Canvas GetRootCanvas(GameObject gameObject){ - Canvas canvas = gameObject.GetComponentInParent(); - // 如果unity版本小于unity5.5,就用递归的方式取吧,没法直接取rootCanvas - // 如果有用到4.6以下版本的话就自己手动在这里添加条件吧 - #if UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3 || UNITY_5_4 - if (canvas && canvas.isRootCanvas) { - return canvas; - } else { - if (gameObject.transform.parent.gameObject != null) { - return GetRootCanvas(gameObject.transform.parent.gameObject); - } else { - return null; - } - } - #else - if (canvas && canvas.isRootCanvas){ - return canvas; - } - else if (canvas) { - return canvas.rootCanvas; - } - else { - return null; - } - #endif - } - - private void WriteFileByLine(string file_path,string file_name,string str_info) { - StreamWriter sw; - if(!File.Exists(file_path+"//"+file_name)) { - sw=File.CreateText(file_path+"//"+file_name);//创建一个用于写入 UTF-8 编码的文本 - Debug.Log("文件创建成功!"); - } else { - sw=File.AppendText(file_path+"//"+file_name);//打开现有 UTF-8 编码文本文件以进行读取 - } - sw.WriteLine(str_info);//以行为单位写入字符串 - sw.Close (); - sw.Dispose ();//文件流释放 - } - - - private class Node { - public string id; - public string name; - public Feature feature; - public Rect originalPosition; - public int childrenCount; - public Rect position; - public int z; - public string zPath = ""; - - public List children = new List(); - public bool show = false; - public bool enable = false; - public bool useless = true; - public bool visible = false; - public List components = new List(); - - //根节点的构造函数 - public Node(string name, List children){ - this.name = name; - this.zPath = "0"; - this.children = children; - this.childrenCount = children.Count; - this.z = 0; - this.id = "root"; - } - - #if UNITY_UI_FAIRYGUI - public Dictionary> actionInfo = new Dictionary>(); - #else - public string action_info = "#todo"; - #endif - - #if UNITY_UI_FAIRYGUI - public Node(GObject obj, string zPath) { - List GComponentList = new List{"GComponent", "GButton", "GComboBox", "GLabel", "GList", "GProgressBar", "GRoot", "GScrollBar", "GSlider", "Window"}; - this.feature = new Feature(obj); - this.z = index; - index++; - this.zPath = zPath.Length > 0 ? zPath + "_" + this.z.ToString(): this.z.ToString(); - this.id = sceneName + ":" + feature.className + ":" + feature.tag + ":" + obj.id; - name = obj.name; - childrenCount = 0; - enable = obj.enabled; - visible = obj.visible; - originalPosition = feature.rect; - actionInfo = new Dictionary>(); - var eventList = new Dictionary(); - bool hasEvent = false; - if(!obj.onClick.isEmpty) { - eventList.Add("onClick", true); - hasEvent = true; - } else { - eventList.Add("onClick", false); - } - - if(!obj.onDragMove.isEmpty){ - eventList.Add("onDragMove", true); - hasEvent = true; - } else { - eventList.Add("onDragMove", false); - } - - if(!obj.onDragEnd.isEmpty){ - eventList.Add("onDragEnd", true); - hasEvent = true; - } else { - eventList.Add("onDragEnd", false); - } - - if(!obj.onDragStart.isEmpty){ - eventList.Add("onDragStart", true); - hasEvent = true; - } else { - eventList.Add("onDragStart", false); - } - - if(!obj.onKeyDown.isEmpty){ - eventList.Add("onKeyDown", true); - hasEvent = true; - } else { - eventList.Add("onKeyDown", false); - } - - if(!obj.onRightClick.isEmpty){ - eventList.Add("onRightClick", true); - hasEvent = true; - } else { - eventList.Add("onRightClick", false); - } - - if(!obj.onTouchBegin.isEmpty){ - eventList.Add("onTouchBegin", true); - hasEvent = true; - } else { - eventList.Add("onTouchBegin", false); - } - - if(!obj.onTouchEnd.isEmpty){ - eventList.Add("onTouchEnd", true); - hasEvent = true; - } else { - eventList.Add("onTouchEnd", false); - } - - if(!obj.onTouchMove.isEmpty){ - eventList.Add("onTouchMove", true); - hasEvent = true; - } else { - eventList.Add("onTouchMove", false); - } - actionInfo.Add("eventList", eventList); - - if(hasEvent && visible && enable){ - enable = true; - }else{ - enable = false; - } - useless = !enable; - - //fairygui坐标系以左上角为(0,0),往右为x正方向,往下位y正方向 - position = new Rect(feature.rect.x, feature.rect.y, feature.rect.width, feature.rect.height); - - //只有特定几类的ui才有children,其他的没有 - if(GComponentList.Contains(feature.originalClassName)) { - GComponent tmpObj = (GComponent)obj; - childrenCount = tmpObj.numChildren; - foreach(GObject child in tmpObj.GetChildren()) { - Node childNode = new Node(child, this.zPath); - children.Add(childNode); - } - } - } - #endif - public Node(GameObject obj, string zPath) { - if(platform == "undefined") { - Debug.Log("unsupport undefined platform"); - } - this.feature = new Feature(obj); - this.z = index; - index++; - this.zPath = zPath.Length > 0 ? zPath + "_" + this.z.ToString(): this.z.ToString(); - id = sceneName + ":" + feature.className + ":" + feature.tag; - name = obj.name; - childrenCount = obj.transform.childCount; - // unity坐标系转换为手机屏幕的坐标系 - position = new Rect(feature.rect.x, UnityEngine.Screen.height - feature.rect.y, feature.rect.width, feature.rect.height); - show = (position.width > 0 && position.height > 0); - #if UNITY_UI_UGUI - Renderer render = obj.GetComponent(); - if (render != null) { - visible = render.enabled; - } else { - visible = false; - } - - Button button = obj.GetComponent - /// 请升级微信版本 - /// ``` - /// ```js - /// Page({ - /// data: { - /// canIUse: wx.canIUse('button.open-type.getUserInfo') - /// }, - /// onLoad: function() { - /// // 查看是否授权 - /// wx.getSetting({ - /// success (res){ - /// if (res.authSetting['scope.userInfo']) { - /// // 已经授权,可以直接调用 getUserInfo 获取头像昵称 - /// wx.getUserInfo({ - /// success: function(res) { - /// console.log(res.userInfo) - /// } - /// }) - /// } - /// } - /// }) - /// }, - /// bindGetUserInfo (e) { - /// console.log(e.detail.userInfo) - /// } - /// }) - /// ``` - ///
- public static void GetUserInfo(GetUserInfoOption callback) - { - WXSDKManagerHandler.Instance.GetUserInfo(callback); - } - /// - /// [wx.getUserInteractiveStorage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getUserInteractiveStorage.html) - /// 需要基础库: `2.7.7` - /// 获取当前用户互动型托管数据对应 key 的数据。该接口需要用户授权。 - /// - public static void GetUserInteractiveStorage(GetUserInteractiveStorageOption callback) - { - WXSDKManagerHandler.Instance.GetUserInteractiveStorage(callback); - } - /// - /// [wx.getWeRunData(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/werun/wx.getWeRunData.html) - /// 需要基础库: `1.2.0` - /// 获取用户过去三十天微信运动步数。需要先调用 [wx.login](https://developers.weixin.qq.com/minigame/dev/api/open-api/login/wx.login.html) 接口。步数信息会在用户主动进入小程序时更新。 - /// **示例代码** - /// ```js - /// wx.getWeRunData({ - /// success (res) { - /// // 拿 encryptedData 到开发者后台解密开放数据 - /// const encryptedData = res.encryptedData - /// // 或拿 cloudID 通过云调用直接获取开放数据 - /// const cloudID = res.cloudID - /// } - /// }) - /// ``` - /// **开放数据 JSON 结构** - /// 敏感数据有两种获取方式,一是使用 [加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) 。 - /// 获取得到的开放数据为以下 json 结构: - /// ```json - /// { - /// "stepInfoList": [ - /// { - /// "timestamp": 1445866601, - /// "step": 100 - /// }, - /// { - /// "timestamp": 1445876601, - /// "step": 120 - /// } - /// ] - /// } - /// ``` - /// stepInfoList 中,每一项结构如下: - /// | 属性 | 类型 | 说明 | - /// | --- | ---- | --- | - /// | timestamp | number | 时间戳,表示数据对应的时间 | - /// | step | number | 微信运动步数 | - /// - public static void GetWeRunData(GetWeRunDataOption callback) - { - WXSDKManagerHandler.Instance.GetWeRunData(callback); - } - /// - /// [wx.hideKeyboard(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.hideKeyboard.html) - /// 隐藏键盘 - /// - public static void HideKeyboard(HideKeyboardOption callback) - { - WXSDKManagerHandler.Instance.HideKeyboard(callback); - } - /// - /// [wx.hideLoading(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.hideLoading.html) - /// 需要基础库: `1.1.0` - /// 隐藏 loading 提示框 - /// - public static void HideLoading(HideLoadingOption callback) - { - WXSDKManagerHandler.Instance.HideLoading(callback); - } - /// - /// [wx.hideShareMenu(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.hideShareMenu.html) - /// 需要基础库: `1.1.0` - /// 隐藏当前页面的转发按钮 - /// **** - /// ## 注意事项 - /// - "shareAppMessage"表示“发送给朋友”按钮,"shareTimeline"表示“分享到朋友圈”按钮 - /// - 隐藏“发送给朋友”按钮时必须同时隐藏“分享到朋友圈”按钮,隐藏“分享到朋友圈”按钮时则允许不隐藏“发送给朋友”按钮 - /// **示例代码** - /// ```js - /// wx.hideShareMenu({ - /// menus: ['shareAppMessage', 'shareTimeline'] - /// }) - /// ``` - /// - public static void HideShareMenu(HideShareMenuOption callback) - { - WXSDKManagerHandler.Instance.HideShareMenu(callback); - } - /// - /// [wx.hideToast(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.hideToast.html) - /// 隐藏消息提示框 - /// - public static void HideToast(HideToastOption callback) - { - WXSDKManagerHandler.Instance.HideToast(callback); - } - /// - /// [wx.initFaceDetect(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ai/face/wx.initFaceDetect.html) - /// 需要基础库: `2.18.0` - /// 初始化人脸识别 - /// - public static void InitFaceDetect(InitFaceDetectOption callback) - { - WXSDKManagerHandler.Instance.InitFaceDetect(callback); - } - /// - /// [wx.isBluetoothDevicePaired(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.isBluetoothDevicePaired.html) - /// 需要基础库: `2.20.1` - /// 查询蓝牙设备是否配对,仅安卓支持。 - /// - public static void IsBluetoothDevicePaired(IsBluetoothDevicePairedOption callback) - { - WXSDKManagerHandler.Instance.IsBluetoothDevicePaired(callback); - } - /// - /// [wx.joinVoIPChat(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/voip/wx.joinVoIPChat.html) - /// 需要基础库: `2.7.0` - /// 加入 (创建) 实时语音通话,更多信息可见 [实时语音指南](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/voip-chat.html)。调用前需要用户授权 `scope.record`,若房间类型为视频房间需要用户授权 `scope.camera`。 - /// - public static void JoinVoIPChat(JoinVoIPChatOption callback) - { - WXSDKManagerHandler.Instance.JoinVoIPChat(callback); - } - /// - /// [wx.login(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/login/wx.login.html) - /// 调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、微信开放平台帐号下的唯一标识(unionid,若当前小程序已绑定到微信开放平台帐号)及本次登录的会话密钥(session_key)等。用户数据的加解密通讯需要依赖会话密钥完成。更多使用方法详见 [小程序登录](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/login.html)。 - /// **示例代码** - /// ```js - /// wx.login({ - /// success (res) { - /// if (res.code) { - /// //发起网络请求 - /// wx.request({ - /// url: 'https://example.com/onLogin', - /// data: { - /// code: res.code - /// } - /// }) - /// } else { - /// console.log('登录失败!' + res.errMsg) - /// } - /// } - /// }) - /// ``` - /// - public static void Login(LoginOption callback) - { - WXSDKManagerHandler.Instance.Login(callback); - } - /// - /// [wx.makeBluetoothPair(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.makeBluetoothPair.html) - /// 需要基础库: `2.12.0` - /// 蓝牙配对接口,仅安卓支持。 - /// 通常情况下(需要指定 `pin` 码或者密码时)系统会接管配对流程,直接调用 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 即可。该接口只应当在开发者不想让用户手动输入 `pin` 码且真机验证确认可以正常生效情况下用。 - /// - public static void MakeBluetoothPair(MakeBluetoothPairOption callback) - { - WXSDKManagerHandler.Instance.MakeBluetoothPair(callback); - } - /// - /// [wx.modifyFriendInteractiveStorage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.modifyFriendInteractiveStorage.html) - /// 需要基础库: `2.7.7` - /// 修改好友的互动型托管数据,该接口只可在开放数据域下使用。 - /// **赠送动作的校验** - /// 调用该接口需要上传 JSServer 函数 "checkInteractiveData",该函数可用于执行赠送动作的校验逻辑,校验通过后返回结果表示本次赠送是否合法。只有 checkInteractiveData 返回了 `{ret: true}`,此次修改才会成功。 - /// **使用模板规则进行交互** - /// 每次调用该接口会弹窗询问用户是否确认执行该操作,2.9.0 之后版本,需要在 game.json 中设置 `modifyFriendInteractiveStorageTemplates` 来定制交互的文案。 - /// `modifyFriendInteractiveStorageTemplates` 是一个模板数组,每一个模板需要有 key, action, object 参数,还有一个可选参数 ratio,详细说明见示例配置: - /// ```json - /// { - /// "modifyFriendInteractiveStorageTemplates": [ - /// { - /// "key": "1", // 这个 key 与接口中同名参数相对应,不同的 key 对应不同的模板 - /// "action": "赠送", // 互动行为 - /// "object": "金币", // 互动物品 - /// "ratio": 10 // 物品比率,opNum * ratio 代表物品个数 - /// } - /// ] - /// } - /// ``` - /// 最后生成的文案为 "确认 ${action} ${nickname} ${object}?",或者 "确认 ${action} ${nickname} ${object} x ${opNum * ratio}?" - /// **使用自定义文案进行交互** - /// 2.7.7 之后,2.9.0 之前的版本,文案通过 game.json 的 `modifyFriendInteractiveStorageConfirmWording` 字段配置。 - /// 配置内容可包含 nickname 变量,用 ${nickname} 表示,实际调用时会被替换成好友的昵称。示例配置: - /// ```json - /// { - /// "modifyFriendInteractiveStorageConfirmWording": "确认送给${nickname}一个体力?" - /// } - /// ``` - /// 2.9.0 之后,在 `modifyFriendInteractiveStorageTemplates` 和 `modifyFriendInteractiveStorageConfirmWording` 都存在的情况下,会优先使用前者。 - /// - public static void ModifyFriendInteractiveStorage(ModifyFriendInteractiveStorageOption callback) - { - WXSDKManagerHandler.Instance.ModifyFriendInteractiveStorage(callback); - } - /// - /// [wx.navigateToMiniProgram(Object object)](https://developers.weixin.qq.com/minigame/dev/api/navigate/wx.navigateToMiniProgram.html) - /// 需要基础库: `2.2.0` - /// 打开另一个小程序 - /// **使用限制** - /// ##### 需要用户触发跳转 - /// 从 2.3.0 版本开始,若用户未点击小程序页面任意位置,则开发者将无法调用此接口自动跳转至其他小程序。 - /// ##### 需要用户确认跳转 - /// 从 2.3.0 版本开始,在跳转至其他小程序前,将统一增加弹窗,询问是否跳转,用户确认后才可以跳转其他小程序。如果用户点击取消,则回调 `fail cancel`。 - /// ##### 无需声明跳转名单,不限跳转数量(众测中) - /// 1. 从2020年4月24日起,使用跳转其他小程序功能将无需在全局配置中声明跳转名单,调用此接口时将不再校验所跳转的 AppID 是否在 navigateToMiniProgramAppIdList 中。 - /// 2. 从2020年4月24日起,跳转其他小程序将不再受数量限制,使用此功能时请注意遵守运营规范。 - /// **运营规范** - /// 平台将坚决打击小程序盒子等互推行为,使用此功能时请严格遵守[《微信小程序平台运营规范》](https://developers.weixin.qq.com/miniprogram/product/#_5-10-%E4%BA%92%E6%8E%A8%E8%A1%8C%E4%B8%BA),若发现小程序违反运营规范将被下架处理。 - /// **关于调试** - /// - 在开发者工具上调用此 API 并不会真实的跳转到另外的小程序,但是开发者工具会校验本次调用跳转是否成功。[详情](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#跳转小程序调试支持) - /// - 开发者工具上支持被跳转的小程序处理接收参数的调试。[详情](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#跳转小程序调试支持) - /// **示例代码** - /// ```js - /// wx.navigateToMiniProgram({ - /// appId: '', - /// path: 'page/index/index?id=123', - /// extraData: { - /// foo: 'bar' - /// }, - /// envVersion: 'develop', - /// success(res) { - /// // 打开成功 - /// } - /// }) - /// ``` - /// - public static void NavigateToMiniProgram(NavigateToMiniProgramOption callback) - { - WXSDKManagerHandler.Instance.NavigateToMiniProgram(callback); - } - /// - /// [wx.notifyBLECharacteristicValueChange(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) - /// 需要基础库: `2.9.2` - /// 启用蓝牙低功耗设备特征值变化时的 notify 功能,订阅特征。注意:必须设备的特征支持 notify 或者 indicate 才可以成功调用。 - /// 另外,必须先启用 [wx.notifyBLECharacteristicValueChange](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) 才能监听到设备 `characteristicValueChange` 事件 - /// **注意** - /// - 订阅操作成功后需要设备主动更新特征的 value,才会触发 [wx.onBLECharacteristicValueChange](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.onBLECharacteristicValueChange.html) 回调。 - /// - 安卓平台上,在本接口调用成功后立即调用 [wx.writeBLECharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.writeBLECharacteristicValue.html) 接口,在部分机型上会发生 10008 系统错误 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// wx.notifyBLECharacteristicValueChange({ - /// state: true, // 启用 notify 功能 - /// // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接 - /// deviceId, - /// // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取 - /// serviceId, - /// // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取 - /// characteristicId, - /// success (res) { - /// console.log('notifyBLECharacteristicValueChange success', res.errMsg) - /// } - /// }) - /// ``` - /// - public static void NotifyBLECharacteristicValueChange(NotifyBLECharacteristicValueChangeOption callback) - { - WXSDKManagerHandler.Instance.NotifyBLECharacteristicValueChange(callback); - } - /// - /// [wx.openBluetoothAdapter(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.openBluetoothAdapter.html) - /// 需要基础库: `2.9.2` - /// 初始化蓝牙模块。iOS 上开启主机/从机(外围设备)模式时需分别调用一次,并指定对应的 `mode`。 - /// **object.fail 回调函数返回的 state 参数(仅 iOS)** - /// | 状态码 | 说明 | - /// | ------ | ------ | - /// | 0 | 未知 | - /// | 1 | 重置中 | - /// | 2 | 不支持 | - /// | 3 | 未授权 | - /// | 4 | 未开启 | - /// **注意** - /// - 其他蓝牙相关 API 必须在 [wx.openBluetoothAdapter](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.openBluetoothAdapter.html) 调用之后使用。否则 API 会返回错误(errCode=10000)。 - /// - 在用户蓝牙开关未开启或者手机不支持蓝牙功能的情况下,调用 [wx.openBluetoothAdapter](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.openBluetoothAdapter.html) 会返回错误(errCode=10001),表示手机蓝牙功能不可用。此时小程序蓝牙模块已经初始化完成,可通过 [wx.onBluetoothAdapterStateChange](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.onBluetoothAdapterStateChange.html) 监听手机蓝牙状态的改变,也可以调用蓝牙模块的所有API。 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// wx.openBluetoothAdapter({ - /// success (res) { - /// console.log(res) - /// } - /// }) - /// ``` - /// - public static void OpenBluetoothAdapter(OpenBluetoothAdapterOption callback) - { - WXSDKManagerHandler.Instance.OpenBluetoothAdapter(callback); - } - /// - /// [wx.openCard(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/card/wx.openCard.html) - /// 需要基础库: `2.5.0` - /// 查看微信卡包中的卡券。只有通过 [认证](https://developers.weixin.qq.com/miniprogram/product/renzheng.html) 的小程序或文化互动类目的小游戏才能使用。更多文档请参考 [微信卡券接口文档](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1490190158&version=1&lang=zh_CN&platform=2)。 - /// **示例代码** - /// ```js - /// wx.openCard({ - /// cardList: [{ - /// cardId: '', - /// code: '' - /// }, { - /// cardId: '', - /// code: '' - /// }], - /// success (res) { } - /// }) - /// ``` - /// - public static void OpenCard(OpenCardOption callback) - { - WXSDKManagerHandler.Instance.OpenCard(callback); - } - /// - /// [wx.openChannelsActivity(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/channels/wx.openChannelsActivity.html) - /// 需要基础库: `2.19.2` - /// 打开视频号视频 - /// - public static void OpenChannelsActivity(OpenChannelsActivityOption callback) - { - WXSDKManagerHandler.Instance.OpenChannelsActivity(callback); - } - /// - /// [wx.openChannelsEvent(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/channels/wx.openChannelsEvent.html) - /// 需要基础库: `2.21.0` - /// 打开视频号活动页 - /// - public static void OpenChannelsEvent(OpenChannelsEventOption callback) - { - WXSDKManagerHandler.Instance.OpenChannelsEvent(callback); - } - /// - /// [wx.openChannelsLive(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/channels/wx.openChannelsLive.html) - /// 需要基础库: `2.15.0` - /// 打开视频号直播 - /// - public static void OpenChannelsLive(OpenChannelsLiveOption callback) - { - WXSDKManagerHandler.Instance.OpenChannelsLive(callback); - } - /// - /// [wx.openChannelsUserProfile(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/channels/wx.openChannelsUserProfile.html) - /// 需要基础库: `2.21.2` - /// 打开视频号主页 - /// - public static void OpenChannelsUserProfile(OpenChannelsUserProfileOption callback) - { - WXSDKManagerHandler.Instance.OpenChannelsUserProfile(callback); - } - /// - /// [wx.openCustomerServiceConversation(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/customer-message/wx.openCustomerServiceConversation.html) - /// 需要基础库: `2.0.3` - /// 进入客服会话。要求在用户发生过至少一次 touch 事件后才能调用。后台接入方式与小程序一致,详见 [客服消息接入](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html) - /// - public static void OpenCustomerServiceConversation(OpenCustomerServiceConversationOption callback) - { - WXSDKManagerHandler.Instance.OpenCustomerServiceConversation(callback); - } - /// - /// [wx.openSetting(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/wx.openSetting.html) - /// 需要基础库: `1.1.0` - /// 调起客户端小程序设置界面,返回用户设置的操作结果。**设置界面只会出现小程序已经向用户请求过的[权限](https://developers.weixin.qq.com/minigame/dev/guide/framework/authorize.html)**。 - /// **** - /// - 注意:[2.3.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,用户发生点击行为后,才可以跳转打开设置页,管理授权信息。[详情](https://developers.weixin.qq.com/community/develop/doc/000cea2305cc5047af5733de751008) - /// **示例代码** - /// ```js - /// wx.openSetting({ - /// success (res) { - /// console.log(res.authSetting) - /// // res.authSetting = { - /// // "scope.userInfo": true, - /// // "scope.userLocation": true - /// // } - /// } - /// }) - /// ``` - /// - public static void OpenSetting(OpenSettingOption callback) - { - WXSDKManagerHandler.Instance.OpenSetting(callback); - } - /// - /// [wx.previewImage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/image/wx.previewImage.html) - /// 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。 - /// **示例代码** - /// ```js - /// wx.previewImage({ - /// current: '', // 当前显示图片的http链接 - /// urls: [] // 需要预览的图片http链接列表 - /// }) - /// ``` - /// - public static void PreviewImage(PreviewImageOption callback) - { - WXSDKManagerHandler.Instance.PreviewImage(callback); - } - /// - /// [wx.previewMedia(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/image/wx.previewMedia.html) - /// 需要基础库: `2.12.0` - /// 预览图片和视频。 - /// - public static void PreviewMedia(PreviewMediaOption callback) - { - WXSDKManagerHandler.Instance.PreviewMedia(callback); - } - /// - /// [wx.readBLECharacteristicValue(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.readBLECharacteristicValue.html) - /// 需要基础库: `2.9.2` - /// 读取蓝牙低功耗设备特征值的二进制数据。注意:必须设备的特征支持 read 才可以成功调用。 - /// **注意** - /// - 并行调用多次会存在读失败的可能性。 - /// - 接口读取到的信息需要在 [wx.onBLECharacteristicValueChange](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.onBLECharacteristicValueChange.html) 方法注册的回调中获取。 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// // 必须在这里的回调才能获取 - /// wx.onBLECharacteristicValueChange(function(characteristic) { - /// console.log('characteristic value comed:', characteristic) - /// }) - /// wx.readBLECharacteristicValue({ - /// // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接 - /// deviceId, - /// // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取 - /// serviceId, - /// // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取 - /// characteristicId, - /// success (res) { - /// console.log('readBLECharacteristicValue:', res.errCode) - /// } - /// }) - /// ``` - /// - public static void ReadBLECharacteristicValue(ReadBLECharacteristicValueOption callback) - { - WXSDKManagerHandler.Instance.ReadBLECharacteristicValue(callback); - } - /// - /// [wx.removeStorage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.removeStorage.html) - /// 从本地缓存中移除指定 key。缓存相关策略请查看 [存储](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/storage.html)。 - /// **示例代码** - /// ```js - /// wx.removeStorage({ - /// key: 'key', - /// success (res) { - /// console.log(res) - /// } - /// }) - /// ``` - /// ```js - /// try { - /// wx.removeStorageSync('key') - /// } catch (e) { - /// // Do something when catch error - /// } - /// ``` - /// - public static void RemoveStorage(RemoveStorageOption callback) - { - WXSDKManagerHandler.Instance.RemoveStorage(callback); - } - /// - /// [wx.removeUserCloudStorage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.removeUserCloudStorage.html) - /// 需要基础库: `1.9.92` - /// 删除用户托管数据当中对应 key 的数据。 - /// - public static void RemoveUserCloudStorage(RemoveUserCloudStorageOption callback) - { - WXSDKManagerHandler.Instance.RemoveUserCloudStorage(callback); - } - /// - /// [wx.requestMidasFriendPayment(Object object)](https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasFriendPayment.html) - /// 需要基础库: `2.11.0` - /// 发起米大师朋友礼物索要。接口用法详见 [小游戏礼物索要接入指南](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/friend-payment.html) - /// **示例代码** - /// ```js - /// wx.requestMidasFriendPayment({ - /// success(res) { - /// // res - /// { - /// errMsg: 'requestMidasFriendPayment:ok', - /// encryptedData: 'xxxx', - /// iv: 'xxx' - /// } - /// }, - /// fail() { - /// } - /// }) - /// ``` - /// encryptedData 解密后数据结构如下: - /// ```json - /// { - /// "outTradeNo": "xxxxxxxx", - /// "orderNo": "PBgAAHMjeOhixxxx", - /// "watermark": { - /// "timestamp": 1585537091, - /// "appid": "wx7a727ff7d940xxxx" - /// } - /// } - /// ``` - /// **buyQuantity限制说明** - /// 购买游戏币的时候,buyQuantity 不可任意填写。需满足 buyQuantity * 游戏币单价 = 限定的价格等级。如:游戏币单价为 0.1 元,一次购买最少数量是 10。 - /// 有效价格等级如下: - /// | 价格等级(单位:人民币) | - /// |----------------------| - /// | 1 | - /// | 3 | - /// | 6 | - /// | 8 | - /// | 12 | - /// | 18 | - /// | 25 | - /// | 30 | - /// | 40 | - /// | 45 | - /// | 50 | - /// | 60 | - /// | 68 | - /// | 73 | - /// | 78 | - /// | 88 | - /// | 98 | - /// | 108 | - /// | 118 | - /// | 128 | - /// | 148 | - /// | 168 | - /// | 188 | - /// | 198 | - /// | 328 | - /// | 648 | - /// | 998 | - /// | 1998 | - /// | 2998 | - /// - public static void RequestMidasFriendPayment(RequestMidasFriendPaymentOption callback) - { - WXSDKManagerHandler.Instance.RequestMidasFriendPayment(callback); - } - /// - /// [wx.requestMidasPayment(Object object)](https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasPayment.html) - /// 发起米大师支付 - /// **buyQuantity 限制说明** - /// 购买游戏币的时候,buyQuantity 不可任意填写。需满足 buyQuantity * 游戏币单价 = 限定的价格等级。如:游戏币单价为 0.1 元,一次购买最少数量是 10。 - /// 有效价格等级如下: - /// | 价格等级(单位:人民币) | - /// |----------------------| - /// | 1 | - /// | 3 | - /// | 6 | - /// | 8 | - /// | 12 | - /// | 18 | - /// | 25 | - /// | 30 | - /// | 40 | - /// | 45 | - /// | 50 | - /// | 60 | - /// | 68 | - /// | 73 | - /// | 78 | - /// | 88 | - /// | 98 | - /// | 108 | - /// | 118 | - /// | 128 | - /// | 148 | - /// | 168 | - /// | 188 | - /// | 198 | - /// | 328 | - /// | 648 | - /// | 998 | - /// | 1998 | - /// | 2998 | - /// - public static void RequestMidasPayment(RequestMidasPaymentOption callback) - { - WXSDKManagerHandler.Instance.RequestMidasPayment(callback); - } - /// - /// [wx.requestSubscribeMessage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeMessage.html) - /// 需要基础库: `2.4.4` - /// 调起客户端小游戏订阅消息界面,返回用户订阅消息的操作结果。当用户勾选了订阅面板中的“总是保持以上选择,不再询问”时,模板消息会被添加到用户的小游戏设置页,通过 [wx.getSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/wx.getSetting.html) 接口可获取用户对相关模板消息的订阅状态。 - /// ## 注意事项 - /// - 一次性模板 id 和永久模板 id 不可同时使用。 - /// - 低版本基础库2.4.4~2.8.3 已支持订阅消息接口调用,仅支持传入一个一次性 tmplId / 永久 tmplId。 - /// - [2.8.2](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,用户发生点击行为或者发起支付回调后,才可以调起订阅消息界面。 - /// - [2.10.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,开发版和体验版小游戏将禁止使用模板消息 fomrId。 - /// - 使用前建议阅读 [小游戏订阅消息使用指引](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/subscribe-message.html)。 - /// - 一次授权调用里,每个tmplId对应的模板标题不能存在相同的,若出现相同的,只保留一个。 - /// **错误码** - /// | errCode | errMsg | 说明 | - /// | ------- | ------------------------------------------------------ | -------------------------------------------------------------- | - /// | 10001 | TmplIds can't be empty | 参数传空了 | - /// | 10002 | Request list fail | 网络问题,请求消息列表失败 | - /// | 10003 | Request subscribe fail | 网络问题,订阅请求发送失败 | - /// | 10004 | Invalid template id | 参数类型错误 | - /// | 10005 | Cannot show subscribe message UI | 无法展示 UI,一般是小游戏这个时候退后台了导致的 | - /// | 20001 | No template data return, verify the template id exist | 没有模板数据,一般是模板 ID 不存在 或者和模板类型不对应 导致的 | - /// | 20002 | Templates type must be same | 模板消息类型 既有一次性的又有永久的 | - /// | 20003 | Templates count out of max bounds | 模板消息数量超过上限 | - /// | 20004 | The main switch is switched off | 用户关闭了主开关,无法进行订阅 | - /// | 20005 | This mini program was banned from subscribing messages | 小游戏被禁封 | - /// **示例代码** - /// ```js - /// wx.requestSubscribeMessage({ - /// tmplIds: [''], - /// success (res) { - /// console.log(res) - /// res === { - /// errMsg: "requestSubscribeMessage:ok", - /// "zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE": "accept" - /// } - /// } - /// }) - /// ``` - /// - public static void RequestSubscribeMessage(RequestSubscribeMessageOption callback) - { - WXSDKManagerHandler.Instance.RequestSubscribeMessage(callback); - } - /// - /// [wx.requestSubscribeSystemMessage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeSystemMessage.html) - /// 需要基础库: `2.9.4` - /// 调起小游戏系统订阅消息界面,返回用户订阅消息的操作结果。当用户勾选了订阅面板中的“总是保持以上选择,不再询问”时,模板消息会被添加到用户的小游戏设置页,通过 [wx.getSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/wx.getSetting.html) 接口可获取用户对相关模板消息的订阅状态。 - /// ## 注意事项 - /// - 需要在 touchend 事件的回调中调用。 - /// - 使用前建议阅读 [小游戏系统订阅消息使用指引](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/subscribe-system-message.html)。 - /// - 系统订阅消息只需要订阅一次,永久有效。 - /// **错误码** - /// | errCode | errMsg | 说明 | - /// | ------- | ------------------------------------------------------ | -------------------------------------------------------------- | - /// | 10001 | TmplIds can't be empty | 参数传空了 | - /// | 10002 | Request list fail | 网络问题,请求消息列表失败 | - /// | 10003 | Request subscribe fail | 网络问题,订阅请求发送失败 | - /// | 10004 | Invalid template id | 参数类型错误 | - /// | 10005 | Cannot show subscribe message UI | 无法展示 UI,一般是小游戏这个时候退后台了导致的 | - /// | 20004 | The main switch is switched off | 用户关闭了主开关,无法进行订阅 | - /// | 20005 | This mini program was banned from subscribing messages | 小游戏被禁封 | - /// **示例代码** - /// ```js - /// wx.requestSubscribeSystemMessage({ - /// msgTypeList: ['SYS_MSG_TYPE_INTERACTIVE', 'SYS_MSG_TYPE_RANK'], - /// success (res) { - /// console.log(res) - /// // res === { - /// // errMsg: "requestSubscribeSystemMessage:ok", - /// // SYS_MSG_TYPE_INTERACTIVE: "accept", - /// // SYS_MSG_TYPE_RANK: 'reject' - /// // } - /// } - /// }) - /// ``` - /// - public static void RequestSubscribeSystemMessage(RequestSubscribeSystemMessageOption callback) - { - WXSDKManagerHandler.Instance.RequestSubscribeSystemMessage(callback); - } - /// - /// [wx.saveFileToDisk(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/wx.saveFileToDisk.html) - /// 需要基础库: `2.11.0` - /// 保存文件系统的文件到用户磁盘,仅在 PC 端支持 - /// **示例代码** - /// ```js - /// wx.saveFileToDisk({ - /// filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - /// success(res) { - /// console.log(res) - /// }, - /// fail(res) { - /// console.error(res) - /// } - /// }) - /// ``` - /// - public static void SaveFileToDisk(SaveFileToDiskOption callback) - { - WXSDKManagerHandler.Instance.SaveFileToDisk(callback); - } - /// - /// [wx.saveImageToPhotosAlbum(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/image/wx.saveImageToPhotosAlbum.html) - /// 需要基础库: `1.2.0` - /// 保存图片到系统相册。 - /// **示例代码** - /// ```js - /// wx.saveImageToPhotosAlbum({ - /// success(res) { } - /// }) - /// ``` - /// - public static void SaveImageToPhotosAlbum(SaveImageToPhotosAlbumOption callback) - { - WXSDKManagerHandler.Instance.SaveImageToPhotosAlbum(callback); - } - /// - /// [wx.scanCode(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/scan/wx.scanCode.html) - /// 需要基础库: `2.16.1` - /// 调起客户端扫码界面进行扫码 - /// **示例代码** - /// ```js - /// // 允许从相机和相册扫码 - /// wx.scanCode({ - /// success (res) { - /// console.log(res) - /// } - /// }) - /// // 只允许从相机扫码 - /// wx.scanCode({ - /// onlyFromCamera: true, - /// success (res) { - /// console.log(res) - /// } - /// }) - /// ``` - /// - public static void ScanCode(ScanCodeOption callback) - { - WXSDKManagerHandler.Instance.ScanCode(callback); - } - /// - /// [wx.sendSocketMessage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/wx.sendSocketMessage.html) - /// 通过 WebSocket 连接发送数据。需要先 wx.connectSocket,并在 wx.onSocketOpen 回调之后才能发送。**推荐使用 [SocketTask](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控。同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** - /// **示例代码** - /// ```js - /// let socketOpen = false - /// let socketMsgQueue = [] - /// wx.connectSocket({ - /// url: 'test.php' - /// }) - /// wx.onSocketOpen(function(res) { - /// socketOpen = true - /// for (let i = 0; i < socketMsgQueue.length; i++){ - /// sendSocketMessage(socketMsgQueue[i]) - /// } - /// socketMsgQueue = [] - /// }) - /// function sendSocketMessage(msg) { - /// if (socketOpen) { - /// wx.sendSocketMessage({ - /// data:msg - /// }) - /// } else { - /// socketMsgQueue.push(msg) - /// } - /// } - /// ``` - /// - public static void SendSocketMessage(SendSocketMessageOption callback) - { - WXSDKManagerHandler.Instance.SendSocketMessage(callback); - } - /// - /// [wx.setBLEMTU(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.setBLEMTU.html) - /// 需要基础库: `2.11.0` - /// 协商设置蓝牙低功耗的最大传输单元 (Maximum Transmission Unit, MTU)。需在 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 调用成功后调用。仅安卓系统 5.1 以上版本有效,iOS 因系统限制不支持。 - /// - public static void SetBLEMTU(SetBLEMTUOption callback) - { - WXSDKManagerHandler.Instance.SetBLEMTU(callback); - } - /// - /// [wx.setClipboardData(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/clipboard/wx.setClipboardData.html) - /// 需要基础库: `1.1.0` - /// 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s - /// **示例代码** - /// ```js - /// wx.setClipboardData({ - /// data: 'data', - /// success (res) { - /// wx.getClipboardData({ - /// success (res) { - /// console.log(res.data) // data - /// } - /// }) - /// } - /// }) - /// ``` - /// - public static void SetClipboardData(SetClipboardDataOption callback) - { - WXSDKManagerHandler.Instance.SetClipboardData(callback); - } - /// - /// [wx.setEnableDebug(Object object)](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.setEnableDebug.html) - /// 需要基础库: `1.4.0` - /// 设置是否打开调试开关。此开关对正式版也能生效。 - /// **示例代码** - /// ```javascript - /// // 打开调试 - /// wx.setEnableDebug({ - /// enableDebug: true - /// }) - /// // 关闭调试 - /// wx.setEnableDebug({ - /// enableDebug: false - /// }) - /// ``` - /// **Tips** - /// - 在正式版打开调试还有一种方法,就是先在开发版或体验版打开调试,再切到正式版就能看到vConsole。 - /// - public static void SetEnableDebug(SetEnableDebugOption callback) - { - WXSDKManagerHandler.Instance.SetEnableDebug(callback); - } - /// - /// [wx.setInnerAudioOption(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/audio/wx.setInnerAudioOption.html) - /// 需要基础库: `2.3.0` - /// 设置 [InnerAudioContext](https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html) 的播放选项。设置之后对当前小程序全局生效。 - /// **** - /// ## 注意事项 - /// - 为保证微信整体体验,speakerOn 为 true 时,客户端会忽略 mixWithOthers 参数的内容,强制与其它音频互斥 - /// - 不支持在播放音频的过程中切换为扬声器播放,开发者如需切换可以先暂停当前播放的音频并记录下当前暂停的时间点,然后切换后重新从原来暂停的时间点开始播放音频 - /// - 目前 wx.setInnerAudioOption 接口不兼容 wx.createWebAudioContext 接口,也不兼容 wx.createInnerAudioContext 开启 useWebAudioImplement 的情况,将在后续版本中支持 - /// - public static void SetInnerAudioOption(SetInnerAudioOption callback) - { - WXSDKManagerHandler.Instance.SetInnerAudioOption(callback); - } - /// - /// [wx.setKeepScreenOn(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/screen/wx.setKeepScreenOn.html) - /// 需要基础库: `1.4.0` - /// 设置是否保持常亮状态。仅在当前小程序生效,离开小程序后设置失效。 - /// **示例代码** - /// ```js - /// wx.setKeepScreenOn({ - /// keepScreenOn: true - /// }) - /// ``` - /// - public static void SetKeepScreenOn(SetKeepScreenOnOption callback) - { - WXSDKManagerHandler.Instance.SetKeepScreenOn(callback); - } - /// - /// [wx.setMenuStyle(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/menu/wx.setMenuStyle.html) - /// 动态设置通过右上角按钮拉起的菜单的样式。 - /// - public static void SetMenuStyle(SetMenuStyleOption callback) - { - WXSDKManagerHandler.Instance.SetMenuStyle(callback); - } - /// - /// [wx.setScreenBrightness(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/screen/wx.setScreenBrightness.html) - /// 需要基础库: `1.2.0` - /// 设置屏幕亮度 - /// - public static void SetScreenBrightness(SetScreenBrightnessOption callback) - { - WXSDKManagerHandler.Instance.SetScreenBrightness(callback); - } - /// - /// [wx.setStatusBarStyle(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/statusbar/wx.setStatusBarStyle.html) - /// 当在配置中设置 showStatusBarStyle 时,屏幕顶部会显示状态栏。此接口可以修改状态栏的样式。 - /// - public static void SetStatusBarStyle(SetStatusBarStyleOption callback) - { - WXSDKManagerHandler.Instance.SetStatusBarStyle(callback); - } - /// - /// [wx.setUserCloudStorage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.setUserCloudStorage.html) - /// 需要基础库: `1.9.92` - /// 对用户托管数据进行写数据操作。允许同时写多组 KV 数据。 - /// **托管数据的限制** - /// 1. 每个openid所标识的微信用户在每个游戏上托管的数据不能超过128个key-value对。 - /// 2. 上报的key-value列表当中每一项的key+value长度都不能超过1K(1024)字节。 - /// 3. 上报的key-value列表当中每一个key长度都不能超过128字节。 - /// - public static void SetUserCloudStorage(SetUserCloudStorageOption callback) - { - WXSDKManagerHandler.Instance.SetUserCloudStorage(callback); - } - /// - /// [wx.shareMessageToFriend(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.shareMessageToFriend.html) - /// 需要基础库: `2.9.0` - /// 给指定的好友分享游戏信息,该接口只可在开放数据域下使用。接收者打开之后,可以用 `wx.modifyFriendInteractiveStorage` 传入参数 quiet=true 发起一次无需弹框确认的好友互动。 - /// **** - /// 定向分享不允许直接在开放数据域设置 query 参数 - /// 需要设置请参见游戏域 `wx.setMessageToFriendQuery` 接口 - /// - public static void ShareMessageToFriend(ShareMessageToFriendOption callback) - { - WXSDKManagerHandler.Instance.ShareMessageToFriend(callback); - } - /// - /// [wx.showActionSheet(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showActionSheet.html) - /// 显示操作菜单 - /// **示例代码** - /// ```js - /// wx.showActionSheet({ - /// itemList: ['A', 'B', 'C'], - /// success (res) { - /// console.log(res.tapIndex) - /// }, - /// fail (res) { - /// console.log(res.errMsg) - /// } - /// }) - /// ``` - /// **注意** - /// - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; - /// - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 - /// - public static void ShowActionSheet(ShowActionSheetOption callback) - { - WXSDKManagerHandler.Instance.ShowActionSheet(callback); - } - /// - /// [wx.showKeyboard(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.showKeyboard.html) - /// 显示键盘 - /// - public static void ShowKeyboard(ShowKeyboardOption callback) - { - WXSDKManagerHandler.Instance.ShowKeyboard(callback); - } - /// - /// [wx.showLoading(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showLoading.html) - /// 需要基础库: `1.1.0` - /// 显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框 - /// **示例代码** - /// ```js - /// wx.showLoading({ - /// title: '加载中', - /// }) - /// setTimeout(function () { - /// wx.hideLoading() - /// }, 2000) - /// ``` - /// **注意** - /// - [wx.showLoading](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showLoading.html) 和 [wx.showToast](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showToast.html) 同时只能显示一个 - /// - [wx.showLoading](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showLoading.html) 应与 [wx.hideLoading](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.hideLoading.html) 配对使用 - /// - public static void ShowLoading(ShowLoadingOption callback) - { - WXSDKManagerHandler.Instance.ShowLoading(callback); - } - /// - /// [wx.showModal(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showModal.html) - /// 显示模态对话框 - /// **示例代码** - /// ```js - /// wx.showModal({ - /// title: '提示', - /// content: '这是一个模态弹窗', - /// success (res) { - /// if (res.confirm) { - /// console.log('用户点击确定') - /// } else if (res.cancel) { - /// console.log('用户点击取消') - /// } - /// } - /// }) - /// ``` - /// **注意** - /// - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; - /// - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 - /// - 自基础库 2.17.1 版本起,支持传入 editable 参数,显示带输入框的弹窗 - /// - public static void ShowModal(ShowModalOption callback) - { - WXSDKManagerHandler.Instance.ShowModal(callback); - } - /// - /// [wx.showShareImageMenu(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.showShareImageMenu.html) - /// 需要基础库: `2.14.3` - /// 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 - /// - public static void ShowShareImageMenu(ShowShareImageMenuOption callback) - { - WXSDKManagerHandler.Instance.ShowShareImageMenu(callback); - } - /// - /// [wx.showShareMenu(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.showShareMenu.html) - /// 需要基础库: `1.1.0` - /// 显示当前页面的转发按钮 - /// **** - /// ## 注意事项 - /// - "shareAppMessage"表示“发送给朋友”按钮,"shareTimeline"表示“分享到朋友圈”按钮 - /// - 显示“分享到朋友圈”按钮时必须同时显示“发送给朋友”按钮,显示“发送给朋友”按钮时则允许不显示“分享到朋友圈”按钮 - /// **示例代码** - /// ```js - /// wx.showShareMenu({ - /// withShareTicket: true, - /// menus: ['shareAppMessage', 'shareTimeline'] - /// }) - /// ``` - /// - public static void ShowShareMenu(ShowShareMenuOption callback) - { - WXSDKManagerHandler.Instance.ShowShareMenu(callback); - } - /// - /// [wx.showToast(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showToast.html) - /// 显示消息提示框 - /// **示例代码** - /// ```js - /// wx.showToast({ - /// title: '成功', - /// icon: 'success', - /// duration: 2000 - /// }) - /// ``` - /// **注意** - /// - [wx.showLoading](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showLoading.html) 和 [wx.showToast](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showToast.html) 同时只能显示一个 - /// - [wx.showToast](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showToast.html) 应与 [wx.hideToast](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.hideToast.html) 配对使用 - /// - public static void ShowToast(ShowToastOption callback) - { - WXSDKManagerHandler.Instance.ShowToast(callback); - } - /// - /// [wx.startAccelerometer(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/accelerometer/wx.startAccelerometer.html) - /// 需要基础库: `1.1.0` - /// 开始监听加速度数据。 - /// **示例代码** - /// ```js - /// wx.startAccelerometer({ - /// interval: 'game' - /// }) - /// ``` - /// **注意** - /// - 根据机型性能、当前 CPU 与内存的占用情况,`interval` 的设置与实际 `wx.onAccelerometerChange()` 回调函数的执行频率会有一些出入。 - /// - public static void StartAccelerometer(StartAccelerometerOption callback) - { - WXSDKManagerHandler.Instance.StartAccelerometer(callback); - } - /// - /// [wx.startBeaconDiscovery(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/ibeacon/wx.startBeaconDiscovery.html) - /// 需要基础库: `2.9.2` - /// 开始搜索附近的 Beacon 设备 - /// **示例代码** - /// ```js - /// wx.startBeaconDiscovery({ - /// success(res) { } - /// }) - /// ``` - /// - public static void StartBeaconDiscovery(StartBeaconDiscoveryOption callback) - { - WXSDKManagerHandler.Instance.StartBeaconDiscovery(callback); - } - /// - /// [wx.startBluetoothDevicesDiscovery(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.startBluetoothDevicesDiscovery.html) - /// 需要基础库: `2.9.2` - /// 开始搜寻附近的蓝牙外围设备。 - /// **此操作比较耗费系统资源,请在搜索到需要的设备后及时调用 [wx.stopBluetoothDevicesDiscovery](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.stopBluetoothDevicesDiscovery.html) 停止搜索。** - /// **注意** - /// - 考虑到蓝牙功能可以间接进行定位,安卓 6.0 及以上版本,无定位权限或定位开关未打开时,无法进行设备搜索。这种情况下,安卓 8.0.16 前,接口调用成功但无法扫描设备;8.0.16 及以上版本,会返回错误。 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/m7klFDmZ72i1) - /// ```js - /// // 以微信硬件平台的蓝牙智能灯为例,主服务的 UUID 是 FEE7。传入这个参数,只搜索主服务 UUID 为 FEE7 的设备 - /// wx.startBluetoothDevicesDiscovery({ - /// services: ['FEE7'], - /// success (res) { - /// console.log(res) - /// } - /// }) - /// ``` - /// - public static void StartBluetoothDevicesDiscovery(StartBluetoothDevicesDiscoveryOption callback) - { - WXSDKManagerHandler.Instance.StartBluetoothDevicesDiscovery(callback); - } - /// - /// [wx.startCompass(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/compass/wx.startCompass.html) - /// 需要基础库: `1.1.0` - /// 开始监听罗盘数据 - /// **示例代码** - /// ```js - /// wx.startCompass() - /// ``` - /// - public static void StartCompass(StartCompassOption callback) - { - WXSDKManagerHandler.Instance.StartCompass(callback); - } - /// - /// [wx.startDeviceMotionListening(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/motion/wx.startDeviceMotionListening.html) - /// 需要基础库: `2.3.0` - /// 开始监听设备方向的变化。 - /// - public static void StartDeviceMotionListening(StartDeviceMotionListeningOption callback) - { - WXSDKManagerHandler.Instance.StartDeviceMotionListening(callback); - } - /// - /// [wx.startGyroscope(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/gyroscope/wx.startGyroscope.html) - /// 需要基础库: `2.3.0` - /// 开始监听陀螺仪数据。 - /// - public static void StartGyroscope(StartGyroscopeOption callback) - { - WXSDKManagerHandler.Instance.StartGyroscope(callback); - } - /// - /// [wx.stopAccelerometer(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/accelerometer/wx.stopAccelerometer.html) - /// 需要基础库: `1.1.0` - /// 停止监听加速度数据。 - /// **示例代码** - /// ```js - /// wx.stopAccelerometer() - /// ``` - /// - public static void StopAccelerometer(StopAccelerometerOption callback) - { - WXSDKManagerHandler.Instance.StopAccelerometer(callback); - } - /// - /// [wx.stopBeaconDiscovery(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/ibeacon/wx.stopBeaconDiscovery.html) - /// 需要基础库: `2.9.2` - /// 停止搜索附近的 Beacon 设备 - /// - public static void StopBeaconDiscovery(StopBeaconDiscoveryOption callback) - { - WXSDKManagerHandler.Instance.StopBeaconDiscovery(callback); - } - /// - /// [wx.stopBluetoothDevicesDiscovery(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.stopBluetoothDevicesDiscovery.html) - /// 需要基础库: `2.9.2` - /// 停止搜寻附近的蓝牙外围设备。若已经找到需要的蓝牙设备并不需要继续搜索时,建议调用该接口停止蓝牙搜索。 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// wx.stopBluetoothDevicesDiscovery({ - /// success (res) { - /// console.log(res) - /// } - /// }) - /// ``` - /// - public static void StopBluetoothDevicesDiscovery(StopBluetoothDevicesDiscoveryOption callback) - { - WXSDKManagerHandler.Instance.StopBluetoothDevicesDiscovery(callback); - } - /// - /// [wx.stopCompass(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/compass/wx.stopCompass.html) - /// 需要基础库: `1.1.0` - /// 停止监听罗盘数据 - /// **示例代码** - /// ```js - /// wx.stopCompass() - /// ``` - /// - public static void StopCompass(StopCompassOption callback) - { - WXSDKManagerHandler.Instance.StopCompass(callback); - } - /// - /// [wx.stopDeviceMotionListening(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/motion/wx.stopDeviceMotionListening.html) - /// 需要基础库: `2.3.0` - /// 停止监听设备方向的变化。 - /// - public static void StopDeviceMotionListening(StopDeviceMotionListeningOption callback) - { - WXSDKManagerHandler.Instance.StopDeviceMotionListening(callback); - } - /// - /// [wx.stopFaceDetect(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ai/face/wx.stopFaceDetect.html) - /// 需要基础库: `2.18.0` - /// 停止人脸识别 - /// - public static void StopFaceDetect(StopFaceDetectOption callback) - { - WXSDKManagerHandler.Instance.StopFaceDetect(callback); - } - /// - /// [wx.stopGyroscope(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/gyroscope/wx.stopGyroscope.html) - /// 需要基础库: `2.3.0` - /// 停止监听陀螺仪数据。 - /// - public static void StopGyroscope(StopGyroscopeOption callback) - { - WXSDKManagerHandler.Instance.StopGyroscope(callback); - } - /// - /// [wx.updateKeyboard(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.updateKeyboard.html) - /// 需要基础库: `2.1.0` - /// 更新键盘输入框内容。只有当键盘处于拉起状态时才会产生效果 - /// - public static void UpdateKeyboard(UpdateKeyboardOption callback) - { - WXSDKManagerHandler.Instance.UpdateKeyboard(callback); - } - /// - /// [wx.updateShareMenu(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.updateShareMenu.html) - /// 需要基础库: `1.2.0` - /// 更新转发属性 - /// **示例代码** - /// ```js - /// wx.updateShareMenu({ - /// withShareTicket: true, - /// success () { } - /// }) - /// ``` - /// ```js - /// // 转发私密消息 - /// wx.updateShareMenu({ - /// isPrivateMessage: true, - /// activityId: 'xxx', - /// templateInfo: {}, - /// success () { }, - /// fail () {} - /// }) - /// ``` - /// - public static void UpdateShareMenu(UpdateShareMenuOption callback) - { - WXSDKManagerHandler.Instance.UpdateShareMenu(callback); - } - /// - /// [wx.updateVoIPChatMuteConfig(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/voip/wx.updateVoIPChatMuteConfig.html) - /// 需要基础库: `2.7.0` - /// 更新实时语音静音设置 - /// - public static void UpdateVoIPChatMuteConfig(UpdateVoIPChatMuteConfigOption callback) - { - WXSDKManagerHandler.Instance.UpdateVoIPChatMuteConfig(callback); - } - /// - /// [wx.updateWeChatApp(Object object)](https://developers.weixin.qq.com/minigame/dev/api/base/update/wx.updateWeChatApp.html) - /// 需要基础库: `2.12.0` - /// 更新客户端版本。当判断用户小程序所在客户端版本过低时,可使用该接口跳转到更新微信页面。 - /// - public static void UpdateWeChatApp(UpdateWeChatAppOption callback) - { - WXSDKManagerHandler.Instance.UpdateWeChatApp(callback); - } - /// - /// [wx.vibrateLong(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/vibrate/wx.vibrateLong.html) - /// 需要基础库: `1.2.0` - /// 使手机发生较长时间的振动(400 ms) - /// - public static void VibrateLong(VibrateLongOption callback) - { - WXSDKManagerHandler.Instance.VibrateLong(callback); - } - /// - /// [wx.vibrateShort(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/vibrate/wx.vibrateShort.html) - /// 需要基础库: `1.2.0` - /// 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效 - /// - public static void VibrateShort(VibrateShortOption callback) - { - WXSDKManagerHandler.Instance.VibrateShort(callback); - } - /// - /// [wx.writeBLECharacteristicValue(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.writeBLECharacteristicValue.html) - /// 需要基础库: `2.9.2` - /// 向蓝牙低功耗设备特征值中写入二进制数据。注意:必须设备的特征支持 write 才可以成功调用。 - /// **注意** - /// - 并行调用多次会存在写失败的可能性。 - /// - 小程序不会对写入数据包大小做限制,但系统与蓝牙设备会限制蓝牙 4.0 单次传输的数据大小,超过最大字节数后会发生写入错误,建议每次写入不超过 20 字节。 - /// - 若单次写入数据过长,iOS 上存在系统不会有任何回调的情况(包括错误回调)。 - /// - 安卓平台上,在调用 [wx.notifyBLECharacteristicValueChange](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) 成功后立即调用本接口,在部分机型上会发生 10008 系统错误 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// // 向蓝牙设备发送一个0x00的16进制数据 - /// let buffer = new ArrayBuffer(1) - /// let dataView = new DataView(buffer) - /// dataView.setUint8(0, 0) - /// wx.writeBLECharacteristicValue({ - /// // 这里的 deviceId 需要在 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 - /// deviceId, - /// // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取 - /// serviceId, - /// // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取 - /// characteristicId, - /// // 这里的value是ArrayBuffer类型 - /// value: buffer, - /// success (res) { - /// console.log('writeBLECharacteristicValue success', res.errMsg) - /// } - /// }) - /// ``` - /// - public static void WriteBLECharacteristicValue(WriteBLECharacteristicValueOption callback) - { - WXSDKManagerHandler.Instance.WriteBLECharacteristicValue(callback); - } - /// - /// 小游戏内主动发起直播,开发者可在游戏内设置一键开播入口 - /// wx.startGameLive 接口需要用户产生点击行为后才能调用,要在WX.OnTouchEnd事件中调用 - /// 需要基础库: `2.19.0` - /// - public static void StartGameLive(StartGameLiveOption callback) - { - WXSDKManagerHandler.Instance.StartGameLive(callback); - } - /// - /// 检查用户是否有直播权限以及用户设备是否支持直播 - /// 需要基础库: `2.19.0` - /// - public static void CheckGameLiveEnabled(CheckGameLiveEnabledOption callback) - { - WXSDKManagerHandler.Instance.CheckGameLiveEnabled(callback); - } - /// - /// 获取小游戏用户当前正在直播的信息(可查询当前直播的 feedId) - /// - public static void GetUserCurrentGameliveInfo(GetUserCurrentGameliveInfoOption callback) - { - WXSDKManagerHandler.Instance.GetUserCurrentGameliveInfo(callback); - } - /// - /// 获取小游戏用户最近已结束的直播的信息(可查询最近已结束的直播的 feedId) - /// - public static void GetUserRecentGameLiveInfo(GetUserRecentGameLiveInfoOption callback) - { - WXSDKManagerHandler.Instance.GetUserRecentGameLiveInfo(callback); - } - /// - /// 获取小游戏用户的已结束的直播数据 - /// 错误码:-10000400:参数无效;-10115001:存在未结束的直播 - /// encryptedData 解密后得到的数据结构: - /// { - /// watermark: { - /// timestamp, - /// appid - /// }, - /// liveInfoList: [{ - /// feedId, // 直播id - /// description, // 直播主题 - /// startTime, // 开播时间戳 - /// endTime, // 关播时间戳 - /// totalCheerCount, // 主播收到的喝彩总数 - /// totalAudienceCount, // 直播间总观众人数 - /// liveDurationInSeconds // 直播总时长 - /// }] - /// } - /// - public static void GetUserGameLiveDetails(GetUserGameLiveDetailsOption callback) - { - WXSDKManagerHandler.Instance.GetUserGameLiveDetails(callback); - } - /// - /// 支持打开当前游戏的直播专区 - /// 接口需要用户产生点击行为后才能调用,要在WX.OnTouchEnd事件中调用 - /// - public static void OpenChannelsLiveCollection(OpenChannelsLiveCollectionOption callback) - { - WXSDKManagerHandler.Instance.OpenChannelsLiveCollection(callback); - } - -/// -/// [wx.restartMiniProgram()](https://developers.weixin.qq.com/minigame/dev/api/navigate/wx.restartMiniProgram.html) -/// 需要基础库: `2.22.1` -/// 重启当前小程序 -/// -public static void RestartMiniProgram() -{ - WXSDKManagerHandler.Instance.RestartMiniProgram(); -} -/// -/// [wx.removeStorageSync(string key)](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.removeStorageSync.html) -/// [wx.removeStorage](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.removeStorage.html) 的同步版本 -/// **示例代码** -/// ```js -/// wx.removeStorage({ -/// key: 'key', -/// success (res) { -/// console.log(res) -/// } -/// }) -/// ``` -/// ```js -/// try { -/// wx.removeStorageSync('key') -/// } catch (e) { -/// // Do something when catch error -/// } -/// ``` -/// -public static void RemoveStorageSync(string key) -{ - WXSDKManagerHandler.Instance.RemoveStorageSync(key); -} -/// -/// [wx.reportEvent(string eventId, object data)](https://developers.weixin.qq.com/minigame/dev/api/data-analysis/wx.reportEvent.html) -/// 需要基础库: `2.14.4` -/// 事件上报 -/// -public static void ReportEvent(string eventId,T data) -{ - WXSDKManagerHandler.Instance.ReportEvent(eventId,data); -} -/// -/// [wx.reportMonitor(string name, number value)](https://developers.weixin.qq.com/minigame/dev/api/data-analysis/wx.reportMonitor.html) -/// 需要基础库: `2.1.2` -/// 自定义业务数据监控上报接口。 -/// **使用说明** -/// 使用前,需要在「小程序管理后台-运维中心-性能监控-业务数据监控」中新建监控事件,配置监控描述与告警类型。每一个监控事件对应唯一的监控ID,开发者最多可以创建128个监控事件。 -/// **示例代码** -/// ```js -/// wx.reportMonitor('1', 1) -/// ``` -/// -public static void ReportMonitor(string name,double value) -{ - WXSDKManagerHandler.Instance.ReportMonitor(name,value); -} -/// -/// [wx.reportPerformance(Number id, Number value, String|Array dimensions)](https://developers.weixin.qq.com/minigame/dev/api/base/performance/wx.reportPerformance.html) -/// 需要基础库: `2.10.0` -/// 小程序测速上报。使用前,需要在小程序管理后台配置。 详情参见[小程序测速](https://developers.weixin.qq.com/miniprogram/dev/framework/performanceReport/)指南。 -/// **示例代码** -/// ```js -/// wx.reportPerformance(1101, 680) -/// wx.reportPerformance(1101, 680, 'custom') -/// ``` -/// -public static void ReportPerformance(double id,double value,string dimensions) -{ - WXSDKManagerHandler.Instance.ReportPerformance(id,value,dimensions); -} -/// -/// [wx.reportUserBehaviorBranchAnalytics(Object object)](https://developers.weixin.qq.com/minigame/dev/api/data-analysis/wx.reportUserBehaviorBranchAnalytics.html) -/// 需要基础库: `2.12.0` -/// 用于分支相关的UI组件(一般是按钮)相关事件的上报,事件目前有曝光、点击两种 -/// -public static void ReportUserBehaviorBranchAnalytics(ReportUserBehaviorBranchAnalyticsOption option) -{ - WXSDKManagerHandler.Instance.ReportUserBehaviorBranchAnalytics(option); -} -/// -/// [wx.reserveChannelsLive(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/channels/wx.reserveChannelsLive.html) -/// 需要基础库: `2.19.0` -/// 预约视频号直播 -/// -public static void ReserveChannelsLive(ReserveChannelsLiveOption option) -{ - WXSDKManagerHandler.Instance.ReserveChannelsLive(option); -} -/// -/// [wx.revokeBufferURL(string url)](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.revokeBufferURL.html) -/// 需要基础库: `2.14.0` -/// 根据 URL 销毁存在内存中的数据 -/// -public static void RevokeBufferURL(string url) -{ - WXSDKManagerHandler.Instance.RevokeBufferURL(url); -} -/// -/// [wx.setPreferredFramesPerSecond(number fps)](https://developers.weixin.qq.com/minigame/dev/api/render/frame/wx.setPreferredFramesPerSecond.html) -/// 可以修改渲染帧率。默认渲染帧率为 60 帧每秒。修改后,requestAnimationFrame 的回调频率会发生改变。 -/// -public static void SetPreferredFramesPerSecond(double fps) -{ - WXSDKManagerHandler.Instance.SetPreferredFramesPerSecond(fps); -} -/// -/// [wx.setStorageSync(string key, any data, Boolean encrypt)](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.setStorageSync.html) -/// [wx.setStorage](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.setStorage.html) 的同步版本 -/// **示例代码** -/// ```js -/// wx.setStorage({ -/// key:"key", -/// data:"value" -/// }) -/// ``` -/// ```js -/// try { -/// wx.setStorageSync('key', 'value') -/// } catch (e) { } -/// ``` -/// ```js -/// // 开启加密存储 -/// wx.setStorage({ -/// key: "key", -/// data: "value", -/// encrypt: true, // 若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true -/// success() { -/// wx.getStorage({ -/// key: "key", -/// encrypt: true, // 若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true -/// success(res) { -/// console.log(res.data) -/// } -/// }) -/// } -/// }) -/// ``` -/// -public static void SetStorageSync(string key,T data,bool encrypt) -{ - WXSDKManagerHandler.Instance.SetStorageSync(key,data,encrypt); -} -/// -/// [wx.shareAppMessage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.shareAppMessage.html) -/// 主动拉起转发,进入选择通讯录界面。 -/// -public static void ShareAppMessage(ShareAppMessageOption option) -{ - WXSDKManagerHandler.Instance.ShareAppMessage(option); -} -/// -/// [wx.triggerGC()](https://developers.weixin.qq.com/minigame/dev/api/base/performance/wx.triggerGC.html) -/// 加快触发 JavaScriptCore 垃圾回收(Garbage Collection)。GC 时机是由 JavaScriptCore 来控制的,并不能保证调用后马上触发 GC。 -/// -public static void TriggerGC() -{ - WXSDKManagerHandler.Instance.TriggerGC(); -} -/// -/// 停止纹理下载 -/// -public static void StopDownloadTexture() -{ - WXSDKManagerHandler.Instance.StopDownloadTexture(); -} -/// -/// 开始纹理下载 -/// -public static void StarDownloadTexture() -{ - WXSDKManagerHandler.Instance.StarDownloadTexture(); -} - - /// - /// [wx.onAccelerometerChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/accelerometer/wx.onAccelerometerChange.html) - /// 监听加速度数据事件。频率根据 [wx.startAccelerometer()](https://developers.weixin.qq.com/minigame/dev/api/device/accelerometer/wx.startAccelerometer.html) 的 interval 参数, 接口调用后会自动开始监听。 - /// **示例代码** - /// ```js - /// wx.onAccelerometerChange(callback) - /// ``` - /// - public static void OnAccelerometerChange(Action result) - { - WXSDKManagerHandler.Instance.OnAccelerometerChange(result); - } - public static void OffAccelerometerChange(Action result) - { - WXSDKManagerHandler.Instance.OffAccelerometerChange(result); - } - /// - /// [wx.onAudioInterruptionBegin(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/app/app-event/wx.onAudioInterruptionBegin.html) - /// 需要基础库: `1.8.0` - /// 监听音频因为受到系统占用而被中断开始事件。以下场景会触发此事件:闹钟、电话、FaceTime 通话、微信语音聊天、微信视频聊天。此事件触发后,小程序内所有音频会暂停。 - /// - public static void OnAudioInterruptionBegin(Action res) - { - WXSDKManagerHandler.Instance.OnAudioInterruptionBegin(res); - } - public static void OffAudioInterruptionBegin(Action res) - { - WXSDKManagerHandler.Instance.OffAudioInterruptionBegin(res); - } - /// - /// [wx.onAudioInterruptionEnd(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/app/app-event/wx.onAudioInterruptionEnd.html) - /// 需要基础库: `1.8.0` - /// 监听音频中断结束事件。在收到 onAudioInterruptionBegin 事件之后,小程序内所有音频会暂停,收到此事件之后才可再次播放成功 - /// - public static void OnAudioInterruptionEnd(Action res) - { - WXSDKManagerHandler.Instance.OnAudioInterruptionEnd(res); - } - public static void OffAudioInterruptionEnd(Action res) - { - WXSDKManagerHandler.Instance.OffAudioInterruptionEnd(res); - } - /// - /// [wx.onBLECharacteristicValueChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.onBLECharacteristicValueChange.html) - /// 需要基础库: `2.9.2` - /// 监听蓝牙低功耗设备的特征值变化事件。必须先调用 [wx.notifyBLECharacteristicValueChange](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) 接口才能接收到设备推送的 notification。 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// // ArrayBuffer转16进制字符串示例 - /// function ab2hex(buffer) { - /// let hexArr = Array.prototype.map.call( - /// new Uint8Array(buffer), - /// function(bit) { - /// return ('00' + bit.toString(16)).slice(-2) - /// } - /// ) - /// return hexArr.join(''); - /// } - /// wx.onBLECharacteristicValueChange(function(res) { - /// console.log(`characteristic ${res.characteristicId} has changed, now is ${res.value}`) - /// console.log(ab2hex(res.value)) - /// }) - /// ``` - /// - public static void OnBLECharacteristicValueChange(Action result) - { - WXSDKManagerHandler.Instance.OnBLECharacteristicValueChange(result); - } - public static void OffBLECharacteristicValueChange(Action result) - { - WXSDKManagerHandler.Instance.OffBLECharacteristicValueChange(result); - } - /// - /// [wx.onBLEConnectionStateChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.onBLEConnectionStateChange.html) - /// 需要基础库: `2.9.2` - /// 监听蓝牙低功耗连接状态的改变事件。包括开发者主动连接或断开连接,设备丢失,连接异常断开等等 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// wx.onBLEConnectionStateChange(function(res) { - /// // 该方法回调中可以用于处理连接意外断开等异常情况 - /// console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`) - /// }) - /// ``` - /// - public static void OnBLEConnectionStateChange(Action result) - { - WXSDKManagerHandler.Instance.OnBLEConnectionStateChange(result); - } - public static void OffBLEConnectionStateChange(Action result) - { - WXSDKManagerHandler.Instance.OffBLEConnectionStateChange(result); - } - /// - /// [wx.onBLEMTUChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.onBLEMTUChange.html) - /// 需要基础库: `2.20.1` - /// 监听蓝牙低功耗的最大传输单元变化事件(仅安卓触发)。 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// wx.onBLEMTUChange(function (res) { - /// console.log('bluetooth mtu is', res.mtu) - /// }) - /// ``` - /// - public static void OnBLEMTUChange(Action result) - { - WXSDKManagerHandler.Instance.OnBLEMTUChange(result); - } - public static void OffBLEMTUChange(Action result) - { - WXSDKManagerHandler.Instance.OffBLEMTUChange(result); - } - /// - /// [wx.onBLEPeripheralConnectionStateChanged(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/wx.onBLEPeripheralConnectionStateChanged.html) - /// 需要基础库: `2.10.3` - /// 监听当前外围设备被连接或断开连接事件 - /// - public static void OnBLEPeripheralConnectionStateChanged(Action result) - { - WXSDKManagerHandler.Instance.OnBLEPeripheralConnectionStateChanged(result); - } - public static void OffBLEPeripheralConnectionStateChanged(Action result) - { - WXSDKManagerHandler.Instance.OffBLEPeripheralConnectionStateChanged(result); - } - /// - /// [wx.onBeaconServiceChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/ibeacon/wx.onBeaconServiceChange.html) - /// 需要基础库: `2.9.2` - /// 监听 Beacon 服务状态变化事件,仅能注册一个监听 - /// - public static void OnBeaconServiceChange(Action result) - { - WXSDKManagerHandler.Instance.OnBeaconServiceChange(result); - } - public static void OffBeaconServiceChange(Action result) - { - WXSDKManagerHandler.Instance.OffBeaconServiceChange(result); - } - /// - /// [wx.onBeaconUpdate(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/ibeacon/wx.onBeaconUpdate.html) - /// 需要基础库: `2.9.2` - /// 监听 Beacon 设备更新事件,仅能注册一个监听 - /// - public static void OnBeaconUpdate(Action result) - { - WXSDKManagerHandler.Instance.OnBeaconUpdate(result); - } - public static void OffBeaconUpdate(Action result) - { - WXSDKManagerHandler.Instance.OffBeaconUpdate(result); - } - /// - /// [wx.onBluetoothAdapterStateChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.onBluetoothAdapterStateChange.html) - /// 需要基础库: `2.9.2` - /// 监听蓝牙适配器状态变化事件 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// wx.onBluetoothAdapterStateChange(function (res) { - /// console.log('adapterState changed, now is', res) - /// }) - /// ``` - /// - public static void OnBluetoothAdapterStateChange(Action result) - { - WXSDKManagerHandler.Instance.OnBluetoothAdapterStateChange(result); - } - public static void OffBluetoothAdapterStateChange(Action result) - { - WXSDKManagerHandler.Instance.OffBluetoothAdapterStateChange(result); - } - /// - /// [wx.onBluetoothDeviceFound(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.onBluetoothDeviceFound.html) - /// 需要基础库: `2.9.2` - /// 监听搜索到新设备的事件 - /// **注意** - /// - 若在 [wx.onBluetoothDeviceFound](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.onBluetoothDeviceFound.html) 回调了某个设备,则此设备会添加到 [wx.getBluetoothDevices](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth/wx.getBluetoothDevices.html) 接口获取到的数组中。 - /// **示例代码** - /// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) - /// ```js - /// // ArrayBuffer转16进度字符串示例 - /// function ab2hex(buffer) { - /// var hexArr = Array.prototype.map.call( - /// new Uint8Array(buffer), - /// function(bit) { - /// return ('00' + bit.toString(16)).slice(-2) - /// } - /// ) - /// return hexArr.join(''); - /// } - /// wx.onBluetoothDeviceFound(function(res) { - /// var devices = res.devices; - /// console.log('new device list has founded') - /// console.dir(devices) - /// console.log(ab2hex(devices[0].advertisData)) - /// }) - /// ``` - /// **注意** - /// - 蓝牙设备在被搜索到时,系统返回的 `name` 字段一般为广播包中的 `LocalName` 字段中的设备名称,而如果与蓝牙设备建立连接,系统返回的 `name` 字段会改为从蓝牙设备上获取到的 `GattName`。若需要动态改变设备名称并展示,建议使用 `localName` 字段。 - /// - 安卓下部分机型需要有位置权限才能搜索到设备,需留意是否开启了位置权限 - /// - public static void OnBluetoothDeviceFound(Action result) - { - WXSDKManagerHandler.Instance.OnBluetoothDeviceFound(result); - } - public static void OffBluetoothDeviceFound(Action result) - { - WXSDKManagerHandler.Instance.OffBluetoothDeviceFound(result); - } - /// - /// [wx.onCompassChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/compass/wx.onCompassChange.html) - /// 监听罗盘数据变化事件。频率:5 次/秒,接口调用后会自动开始监听,可使用 wx.stopCompass 停止监听。 - /// **accuracy 在 iOS/Android 的差异** - /// 由于平台差异,accuracy 在 iOS/Android 的值不同。 - /// - iOS:accuracy 是一个 number 类型的值,表示相对于磁北极的偏差。0 表示设备指向磁北,90 表示指向东,180 表示指向南,依此类推。 - /// - Android:accuracy 是一个 string 类型的枚举值。 - /// | 值 | 说明 | - /// | --------------- | -------------------------------------------------------------------------------------- | - /// | high | 高精度 | - /// | medium | 中等精度 | - /// | low | 低精度 | - /// | no-contact | 不可信,传感器失去连接 | - /// | unreliable | 不可信,原因未知 | - /// | unknow ${value} | 未知的精度枚举值,即该 Android 系统此时返回的表示精度的 value 不是一个标准的精度枚举值 | - /// - public static void OnCompassChange(Action result) - { - WXSDKManagerHandler.Instance.OnCompassChange(result); - } - public static void OffCompassChange(Action result) - { - WXSDKManagerHandler.Instance.OffCompassChange(result); - } - /// - /// [wx.onDeviceMotionChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/motion/wx.onDeviceMotionChange.html) - /// 需要基础库: `2.3.0` - /// 监听设备方向变化事件。频率根据 [wx.startDeviceMotionListening()](https://developers.weixin.qq.com/minigame/dev/api/device/motion/wx.startDeviceMotionListening.html) 的 interval 参数。可以使用 [wx.stopDeviceMotionListening()](https://developers.weixin.qq.com/minigame/dev/api/device/motion/wx.stopDeviceMotionListening.html) 停止监听。 - /// - public static void OnDeviceMotionChange(Action result) - { - WXSDKManagerHandler.Instance.OnDeviceMotionChange(result); - } - public static void OffDeviceMotionChange(Action result) - { - WXSDKManagerHandler.Instance.OffDeviceMotionChange(result); - } - /// - /// [wx.onDeviceOrientationChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/orientation/wx.onDeviceOrientationChange.html) - /// 需要基础库: `2.1.0` - /// 监听横竖屏切换事件 - /// - public static void OnDeviceOrientationChange(Action result) - { - WXSDKManagerHandler.Instance.OnDeviceOrientationChange(result); - } - public static void OffDeviceOrientationChange(Action result) - { - WXSDKManagerHandler.Instance.OffDeviceOrientationChange(result); - } - /// - /// [wx.onError(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/app/app-event/wx.onError.html) - /// 监听全局错误事件 - /// - public static void OnError(Action result) - { - WXSDKManagerHandler.Instance.OnError(result); - } - public static void OffError(Action result) - { - WXSDKManagerHandler.Instance.OffError(result); - } - /// - /// [wx.onGyroscopeChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/gyroscope/wx.onGyroscopeChange.html) - /// 需要基础库: `2.3.0` - /// 监听陀螺仪数据变化事件。频率根据 [wx.startGyroscope()](https://developers.weixin.qq.com/minigame/dev/api/device/gyroscope/wx.startGyroscope.html) 的 interval 参数。可以使用 [wx.stopGyroscope()](https://developers.weixin.qq.com/minigame/dev/api/device/gyroscope/wx.stopGyroscope.html) 停止监听。 - /// - public static void OnGyroscopeChange(Action result) - { - WXSDKManagerHandler.Instance.OnGyroscopeChange(result); - } - public static void OffGyroscopeChange(Action result) - { - WXSDKManagerHandler.Instance.OffGyroscopeChange(result); - } - /// - /// [wx.onHide(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onHide.html) - /// 监听小游戏隐藏到后台事件。锁屏、按 HOME 键退到桌面、显示在聊天顶部等操作会触发此事件。 - /// - public static void OnHide(Action res) - { - WXSDKManagerHandler.Instance.OnHide(res); - } - public static void OffHide(Action res) - { - WXSDKManagerHandler.Instance.OffHide(res); - } - /// - /// [wx.onInteractiveStorageModified(function callback)](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.onInteractiveStorageModified.html) - /// 需要基础库: `2.9.0` - /// 监听成功修改好友的互动型托管数据事件,该接口在游戏主域使用 - /// - public static void OnInteractiveStorageModified(Action res) - { - WXSDKManagerHandler.Instance.OnInteractiveStorageModified(res); - } - public static void OffInteractiveStorageModified(Action res) - { - WXSDKManagerHandler.Instance.OffInteractiveStorageModified(res); - } - /// - /// [wx.onKeyDown(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.onKeyDown.html) - /// 需要基础库: `2.10.1` - /// 监听键盘按键按下事件,仅适用于 PC 平台 - /// - public static void OnKeyDown(Action result) - { - WXSDKManagerHandler.Instance.OnKeyDown(result); - } - public static void OffKeyDown(Action result) - { - WXSDKManagerHandler.Instance.OffKeyDown(result); - } - /// - /// [wx.onKeyUp(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.onKeyUp.html) - /// 需要基础库: `2.10.1` - /// 监听键盘按键弹起事件,仅适用于 PC 平台 - /// - public static void OnKeyUp(Action result) - { - WXSDKManagerHandler.Instance.OnKeyUp(result); - } - public static void OffKeyUp(Action result) - { - WXSDKManagerHandler.Instance.OffKeyUp(result); - } - /// - /// [wx.onKeyboardComplete(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.onKeyboardComplete.html) - /// 监听监听键盘收起的事件 - /// - public static void OnKeyboardComplete(Action result) - { - WXSDKManagerHandler.Instance.OnKeyboardComplete(result); - } - public static void OffKeyboardComplete(Action result) - { - WXSDKManagerHandler.Instance.OffKeyboardComplete(result); - } - /// - /// [wx.onKeyboardConfirm(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.onKeyboardConfirm.html) - /// 监听用户点击键盘 Confirm 按钮时的事件 - /// - public static void OnKeyboardConfirm(Action result) - { - WXSDKManagerHandler.Instance.OnKeyboardConfirm(result); - } - public static void OffKeyboardConfirm(Action result) - { - WXSDKManagerHandler.Instance.OffKeyboardConfirm(result); - } - /// - /// [wx.onKeyboardHeightChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.onKeyboardHeightChange.html) - /// 需要基础库: `2.21.3` - /// 监听键盘高度变化 - /// **示例代码** - /// ```js - /// wx.onKeyboardHeightChange(res => { - /// console.log(res.height) - /// }) - /// ``` - /// - public static void OnKeyboardHeightChange(Action result) - { - WXSDKManagerHandler.Instance.OnKeyboardHeightChange(result); - } - public static void OffKeyboardHeightChange(Action result) - { - WXSDKManagerHandler.Instance.OffKeyboardHeightChange(result); - } - /// - /// [wx.onKeyboardInput(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/keyboard/wx.onKeyboardInput.html) - /// 监听键盘输入事件 - /// - public static void OnKeyboardInput(Action result) - { - WXSDKManagerHandler.Instance.OnKeyboardInput(result); - } - public static void OffKeyboardInput(Action result) - { - WXSDKManagerHandler.Instance.OffKeyboardInput(result); - } - /// - /// [wx.onMemoryWarning(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/memory/wx.onMemoryWarning.html) - /// 需要基础库: `2.0.2` - /// 监听内存不足告警事件。 - /// 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。 - /// **示例代码** - /// ```js - /// wx.onMemoryWarning(function () { - /// console.log('onMemoryWarningReceive') - /// }) - /// `` - /// - public static void OnMemoryWarning(Action result) - { - WXSDKManagerHandler.Instance.OnMemoryWarning(result); - } - public static void OffMemoryWarning(Action result) - { - WXSDKManagerHandler.Instance.OffMemoryWarning(result); - } - /// - /// [wx.onMessage(function callback)](https://developers.weixin.qq.com/minigame/dev/api/open-api/context/wx.onMessage.html) - /// 监听主域发送的消息 - /// - public static void OnMessage(Action res) - { - WXSDKManagerHandler.Instance.OnMessage(res); - } - public static void OffMessage(Action res) - { - WXSDKManagerHandler.Instance.OffMessage(res); - } - /// - /// [wx.onNetworkStatusChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/network/wx.onNetworkStatusChange.html) - /// 需要基础库: `1.1.0` - /// 监听网络状态变化事件 - /// **示例代码** - /// ```js - /// wx.onNetworkStatusChange(function (res) { - /// console.log(res.isConnected) - /// console.log(res.networkType) - /// }) - /// ``` - /// - public static void OnNetworkStatusChange(Action result) - { - WXSDKManagerHandler.Instance.OnNetworkStatusChange(result); - } - public static void OffNetworkStatusChange(Action result) - { - WXSDKManagerHandler.Instance.OffNetworkStatusChange(result); - } - /// - /// [wx.onNetworkWeakChange(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/network/wx.onNetworkWeakChange.html) - /// 需要基础库: `2.21.0` - /// 监听弱网状态变化事件 - /// **示例代码** - /// ```js - /// wx.onNetworkWeakChange(function (res) { - /// console.log(res.weakNet) - /// console.log(res.networkType) - /// }) - /// // 取消监听 - /// wx.offNetworkWeakChange() - /// ``` - /// - public static void OnNetworkWeakChange(Action result) - { - WXSDKManagerHandler.Instance.OnNetworkWeakChange(result); - } - public static void OffNetworkWeakChange(Action result) - { - WXSDKManagerHandler.Instance.OffNetworkWeakChange(result); - } - /// - /// [wx.onShareMessageToFriend(function callback)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.onShareMessageToFriend.html) - /// 需要基础库: `2.9.4` - /// 监听主域接收 `wx.shareMessageToFriend` 接口的成功失败通知 - /// - public static void OnShareMessageToFriend(Action result) - { - WXSDKManagerHandler.Instance.OnShareMessageToFriend(result); - } - public static void OffShareMessageToFriend(Action result) - { - WXSDKManagerHandler.Instance.OffShareMessageToFriend(result); - } - /// - /// [wx.onShow(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html) - /// 监听小游戏回到前台的事件 - /// - public static void OnShow(Action result) - { - WXSDKManagerHandler.Instance.OnShow(result); - } - public static void OffShow(Action result) - { - WXSDKManagerHandler.Instance.OffShow(result); - } - /// - /// [wx.onSocketClose(function callback)](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/wx.onSocketClose.html) - /// 监听 WebSocket 连接关闭事件。**推荐使用 [SocketTask](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控。同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** - /// - public static void OnSocketClose(Action result) - { - WXSDKManagerHandler.Instance.OnSocketClose(result); - } - public static void OffSocketClose(Action result) - { - WXSDKManagerHandler.Instance.OffSocketClose(result); - } - /// - /// [wx.onSocketError(function callback)](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/wx.onSocketError.html) - /// 监听 WebSocket 错误事件。**推荐使用 [SocketTask](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控。同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** - /// - public static void OnSocketError(Action result) - { - WXSDKManagerHandler.Instance.OnSocketError(result); - } - public static void OffSocketError(Action result) - { - WXSDKManagerHandler.Instance.OffSocketError(result); - } - /// - /// [wx.onSocketMessage(function callback)](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/wx.onSocketMessage.html) - /// 监听 WebSocket 接受到服务器的消息事件。**推荐使用 [SocketTask](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控。同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** - /// - public static void OnSocketMessage(Action result) - { - WXSDKManagerHandler.Instance.OnSocketMessage(result); - } - public static void OffSocketMessage(Action result) - { - WXSDKManagerHandler.Instance.OffSocketMessage(result); - } - /// - /// [wx.onSocketOpen(function callback)](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/wx.onSocketOpen.html) - /// 监听 WebSocket 连接打开事件。**推荐使用 [SocketTask](https://developers.weixin.qq.com/minigame/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控。同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** - /// - public static void OnSocketOpen(Action result) - { - WXSDKManagerHandler.Instance.OnSocketOpen(result); - } - public static void OffSocketOpen(Action result) - { - WXSDKManagerHandler.Instance.OffSocketOpen(result); - } - /// - /// [wx.onTouchCancel(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/touch-event/wx.onTouchCancel.html) - /// 监听触点失效事件 - /// - public static void OnTouchCancel(Action result) - { - WXSDKManagerHandler.Instance.OnTouchCancel(result); - } - public static void OffTouchCancel(Action result) - { - WXSDKManagerHandler.Instance.OffTouchCancel(result); - } - /// - /// [wx.onTouchEnd(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/touch-event/wx.onTouchEnd.html) - /// 监听触摸结束事件 - /// - public static void OnTouchEnd(Action result) - { - WXSDKManagerHandler.Instance.OnTouchEnd(result); - } - public static void OffTouchEnd(Action result) - { - WXSDKManagerHandler.Instance.OffTouchEnd(result); - } - /// - /// [wx.onTouchMove(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/touch-event/wx.onTouchMove.html) - /// 监听触点移动事件 - /// - public static void OnTouchMove(Action result) - { - WXSDKManagerHandler.Instance.OnTouchMove(result); - } - public static void OffTouchMove(Action result) - { - WXSDKManagerHandler.Instance.OffTouchMove(result); - } - /// - /// [wx.onTouchStart(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/touch-event/wx.onTouchStart.html) - /// 监听开始触摸事件 - /// - public static void OnTouchStart(Action result) - { - WXSDKManagerHandler.Instance.OnTouchStart(result); - } - public static void OffTouchStart(Action result) - { - WXSDKManagerHandler.Instance.OffTouchStart(result); - } - /// - /// [wx.onUnhandledRejection(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/app/app-event/wx.onUnhandledRejection.html) - /// 需要基础库: `2.10.0` - /// 监听未处理的 Promise 拒绝事件 - /// **注意** - /// 安卓平台暂时不会派发该事件 - /// - public static void OnUnhandledRejection(Action result) - { - WXSDKManagerHandler.Instance.OnUnhandledRejection(result); - } - public static void OffUnhandledRejection(Action result) - { - WXSDKManagerHandler.Instance.OffUnhandledRejection(result); - } - /// - /// [wx.onUserCaptureScreen(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/screen/wx.onUserCaptureScreen.html) - /// 需要基础库: `2.8.1` - /// 监听用户主动截屏事件。用户使用系统截屏按键截屏时触发,只能注册一个监听 - /// **示例代码** - /// ```js - /// wx.onUserCaptureScreen(function (res) { - /// console.log('用户截屏了') - /// }) - /// ``` - /// - public static void OnUserCaptureScreen(Action res) - { - WXSDKManagerHandler.Instance.OnUserCaptureScreen(res); - } - public static void OffUserCaptureScreen(Action res) - { - WXSDKManagerHandler.Instance.OffUserCaptureScreen(res); - } - /// - /// [wx.onVoIPChatInterrupted(function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/voip/wx.onVoIPChatInterrupted.html) - /// 需要基础库: `2.7.0` - /// 监听被动断开实时语音通话事件。包括小游戏切入后端时断开 - /// - public static void OnVoIPChatInterrupted(Action result) - { - WXSDKManagerHandler.Instance.OnVoIPChatInterrupted(result); - } - public static void OffVoIPChatInterrupted(Action result) - { - WXSDKManagerHandler.Instance.OffVoIPChatInterrupted(result); - } - /// - /// [wx.onVoIPChatMembersChanged(function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/voip/wx.onVoIPChatMembersChanged.html) - /// 需要基础库: `2.7.0` - /// 监听实时语音通话成员在线状态变化事件。有成员加入/退出通话时触发回调 - /// - public static void OnVoIPChatMembersChanged(Action result) - { - WXSDKManagerHandler.Instance.OnVoIPChatMembersChanged(result); - } - public static void OffVoIPChatMembersChanged(Action result) - { - WXSDKManagerHandler.Instance.OffVoIPChatMembersChanged(result); - } - /// - /// [wx.onVoIPChatSpeakersChanged(function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/voip/wx.onVoIPChatSpeakersChanged.html) - /// 需要基础库: `2.7.0` - /// 监听实时语音通话成员通话状态变化事件。有成员开始/停止说话时触发回调 - /// - public static void OnVoIPChatSpeakersChanged(Action result) - { - WXSDKManagerHandler.Instance.OnVoIPChatSpeakersChanged(result); - } - public static void OffVoIPChatSpeakersChanged(Action result) - { - WXSDKManagerHandler.Instance.OffVoIPChatSpeakersChanged(result); - } - /// - /// [wx.onVoIPChatStateChanged(function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/voip/wx.onVoIPChatStateChanged.html) - /// 需要基础库: `2.16.0` - /// 监听房间状态变化事件。 - /// - public static void OnVoIPChatStateChanged(Action result) - { - WXSDKManagerHandler.Instance.OnVoIPChatStateChanged(result); - } - public static void OffVoIPChatStateChanged(Action result) - { - WXSDKManagerHandler.Instance.OffVoIPChatStateChanged(result); - } - /// - /// [wx.onWindowResize(function callback)](https://developers.weixin.qq.com/minigame/dev/api/ui/window/wx.onWindowResize.html) - /// 监听窗口尺寸变化事件 - /// - public static void OnWindowResize(Action result) - { - WXSDKManagerHandler.Instance.OnWindowResize(result); - } - public static void OffWindowResize(Action result) - { - WXSDKManagerHandler.Instance.OffWindowResize(result); - } - - /// - /// [wx.onAddToFavorites(function callback)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.onAddToFavorites.html) - /// 需要基础库: `2.10.3` - /// 监听用户点击菜单「收藏」按钮时触发的事件(安卓7.0.15起支持,iOS 暂不支持) - /// - public static void OnAddToFavorites(Action> callback) - { - WXSDKManagerHandler.Instance.OnAddToFavorites(callback); - } - public static void OffAddToFavorites(Action> callback = null) - { - WXSDKManagerHandler.Instance.OffAddToFavorites(callback); - } - /// - /// [wx.onCopyUrl(function callback)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.onCopyUrl.html) - /// 需要基础库: `2.14.3` - /// 监听用户点击右上角菜单的「复制链接」按钮时触发的事件。本接口为 Beta 版本,暂只在 Android 平台支持。 - /// - public static void OnCopyUrl(Action> callback) - { - WXSDKManagerHandler.Instance.OnCopyUrl(callback); - } - public static void OffCopyUrl(Action> callback = null) - { - WXSDKManagerHandler.Instance.OffCopyUrl(callback); - } - /// - /// [wx.onHandoff(function callback)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.onHandoff.html) - /// 需要基础库: `2.14.4` - /// 监听用户点击菜单「在电脑上打开」按钮时触发的事件 - /// - public static void OnHandoff(Action> callback) - { - WXSDKManagerHandler.Instance.OnHandoff(callback); - } - public static void OffHandoff(Action> callback = null) - { - WXSDKManagerHandler.Instance.OffHandoff(callback); - } - /// - /// [wx.onShareTimeline(function callback)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.onShareTimeline.html) - /// 需要基础库: `2.11.3` - /// 监听用户点击右上角菜单的「分享到朋友圈」按钮时触发的事件。本接口为 Beta 版本,暂只在 Android 平台支持。 - /// - public static void OnShareTimeline(Action> callback) - { - WXSDKManagerHandler.Instance.OnShareTimeline(callback); - } - public static void OffShareTimeline(Action> callback = null) - { - WXSDKManagerHandler.Instance.OffShareTimeline(callback); - } - /// - /// 监听小游戏直播状态变化事件 - /// 需要基础库: `2.18.1` - /// - public static void OnGameLiveStateChange(Action> callback) - { - WXSDKManagerHandler.Instance.OnGameLiveStateChange(callback); - } - public static void OffGameLiveStateChange(Action> callback = null) - { - WXSDKManagerHandler.Instance.OffGameLiveStateChange(callback); - } - -/// -/// [Boolean wx.setHandoffQuery(String query)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.setHandoffQuery.html) -/// 需要基础库: `2.14.4` -/// 设置接力参数,该接口需要在游戏域调用 -/// -public static bool SetHandoffQuery(string query) -{ - return WXSDKManagerHandler.Instance.SetHandoffQuery(query); -} -/// -/// [Object wx.getAccountInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/open-api/account-info/wx.getAccountInfoSync.html) -/// 需要基础库: `2.11.2` -/// 获取当前帐号信息。线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。 -/// **示例代码** -/// ```js -/// const accountInfo = wx.getAccountInfoSync(); -/// console.log(accountInfo.miniProgram.appId) // 小程序 appId -/// console.log(accountInfo.plugin.appId) // 插件 appId -/// console.log(accountInfo.plugin.version) // 插件版本号, 'a.b.c' 这样的形式 -/// ``` -/// -public static AccountInfo GetAccountInfoSync() -{ - return WXSDKManagerHandler.Instance.GetAccountInfoSync(); -} -/// -/// [Object wx.getBatteryInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/device/battery/wx.getBatteryInfoSync.html) -/// [wx.getBatteryInfo](https://developers.weixin.qq.com/minigame/dev/api/device/battery/wx.getBatteryInfo.html) 的同步版本 -/// -public static GetBatteryInfoSyncResult GetBatteryInfoSync() -{ - return WXSDKManagerHandler.Instance.GetBatteryInfoSync(); -} -/// -/// [Object wx.getEnterOptionsSync()](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getEnterOptionsSync.html) -/// 需要基础库: `2.13.2` -/// 获取小游戏打开的参数(包括冷启动和热启动) -/// **返回有效 referrerInfo 的场景** -/// | 场景值 | 场景 | appId含义 | -/// | ------ | ------------------------------- | ---------- | -/// | 1020 | 公众号 profile 页相关小程序列表 | 来源公众号 | -/// | 1035 | 公众号自定义菜单 | 来源公众号 | -/// | 1036 | App 分享消息卡片 | 来源App | -/// | 1037 | 小程序打开小程序 | 来源小程序 | -/// | 1038 | 从另一个小程序返回 | 来源小程序 | -/// | 1043 | 公众号模板消息 | 来源公众号 | -/// **注意** -/// 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 -/// -public static EnterOptionsGame GetEnterOptionsSync() -{ - return WXSDKManagerHandler.Instance.GetEnterOptionsSync(); -} -/// -/// [Object wx.getExptInfoSync(Array.<string> keys)](https://developers.weixin.qq.com/minigame/dev/api/data-analysis/wx.getExptInfoSync.html) -/// 需要基础库: `2.17.0` -/// 给定实验参数数组,获取对应的实验参数值 -/// **提示** -/// 假设实验参数有 `color`, `size` -/// 调用 wx.getExptInfoSync() 会返回 `{color:'#fff',size:20}` 类似的结果 -/// 而 wx.getExptInfoSync(['color']) 则只会返回 `{color:'#fff'}` -/// -public static T GetExptInfoSync(string[] keys) -{ - return WXSDKManagerHandler.Instance.GetExptInfoSync(keys); -} -/// -/// [Object wx.getExtConfigSync()](https://developers.weixin.qq.com/minigame/dev/api/ext/wx.getExtConfigSync.html) -/// 需要基础库: `2.8.3` -/// [wx.getExtConfig](https://developers.weixin.qq.com/minigame/dev/api/ext/wx.getExtConfig.html) 的同步版本。 -/// **Tips** -/// 1. 本接口暂时无法通过 [wx.canIUse](#) 判断是否兼容,开发者需要自行判断 [wx.getExtConfigSync](https://developers.weixin.qq.com/minigame/dev/api/ext/wx.getExtConfigSync.html) 是否存在来兼容 -/// **** -/// ```js -/// let extConfig = wx.getExtConfigSync? wx.getExtConfigSync(): {} -/// console.log(extConfig) -/// ``` -/// -public static T GetExtConfigSync() -{ - return WXSDKManagerHandler.Instance.GetExtConfigSync(); -} -/// -/// [Object wx.getLaunchOptionsSync()](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) -/// 获取小游戏冷启动时的参数。热启动参数通过 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html) 接口获取。 -/// **返回有效 referrerInfo 的场景** -/// | 场景值 | 场景 | appId含义 | -/// | ------ | ------------------------------- | ---------- | -/// | 1020 | 公众号 profile 页相关小程序列表 | 来源公众号 | -/// | 1035 | 公众号自定义菜单 | 来源公众号 | -/// | 1036 | App 分享消息卡片 | 来源App | -/// | 1037 | 小程序打开小程序 | 来源小程序 | -/// | 1038 | 从另一个小程序返回 | 来源小程序 | -/// | 1043 | 公众号模板消息 | 来源公众号 | -/// **注意** -/// 部分版本在无`referrerInfo`的时候会返回 `undefined`, -/// 建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 -/// -public static LaunchOptionsGame GetLaunchOptionsSync() -{ - return WXSDKManagerHandler.Instance.GetLaunchOptionsSync(); -} -/// -/// [Object wx.getMenuButtonBoundingClientRect()](https://developers.weixin.qq.com/minigame/dev/api/ui/menu/wx.getMenuButtonBoundingClientRect.html) -/// 需要基础库: `2.1.0` -/// 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。 -/// **示例代码** -/// ```js -/// const res = wx.getMenuButtonBoundingClientRect() -/// console.log(res.width) -/// console.log(res.height) -/// console.log(res.top) -/// console.log(res.right) -/// console.log(res.bottom) -/// console.log(res.left) -/// ``` -/// -public static ClientRect GetMenuButtonBoundingClientRect() -{ - return WXSDKManagerHandler.Instance.GetMenuButtonBoundingClientRect(); -} -/// -/// [Object wx.getStorageInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.getStorageInfoSync.html) -/// [wx.getStorageInfo](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.getStorageInfo.html) 的同步版本 -/// **示例代码** -/// ```js -/// wx.getStorageInfo({ -/// success (res) { -/// console.log(res.keys) -/// console.log(res.currentSize) -/// console.log(res.limitSize) -/// } -/// }) -/// ``` -/// ```js -/// try { -/// const res = wx.getStorageInfoSync() -/// console.log(res.keys) -/// console.log(res.currentSize) -/// console.log(res.limitSize) -/// } catch (e) { -/// // Do something when catch error -/// } -/// ``` -/// -public static GetStorageInfoSyncOption GetStorageInfoSync() -{ - return WXSDKManagerHandler.Instance.GetStorageInfoSync(); -} -/// -/// [Object wx.getSystemInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfoSync.html) -/// [wx.getSystemInfo](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfo.html) 的同步版本 -/// **示例代码** -/// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/WkUCgXmS7mqO) -/// ```js -/// wx.getSystemInfo({ -/// success (res) { -/// console.log(res.model) -/// console.log(res.pixelRatio) -/// console.log(res.windowWidth) -/// console.log(res.windowHeight) -/// console.log(res.language) -/// console.log(res.version) -/// console.log(res.platform) -/// } -/// }) -/// ``` -/// ```js -/// try { -/// const res = wx.getSystemInfoSync() -/// console.log(res.model) -/// console.log(res.pixelRatio) -/// console.log(res.windowWidth) -/// console.log(res.windowHeight) -/// console.log(res.language) -/// console.log(res.version) -/// console.log(res.platform) -/// } catch (e) { -/// // Do something when catch error -/// } -/// ``` -/// -public static SystemInfo GetSystemInfoSync() -{ - return WXSDKManagerHandler.Instance.GetSystemInfoSync(); -} -/// -/// [boolean wx.setCursor(string path, number x, number y)](https://developers.weixin.qq.com/minigame/dev/api/render/cursor/wx.setCursor.html) -/// 需要基础库: `2.10.1` -/// 加载自定义光标,仅支持 PC 平台 -/// **注意** -/// - 传入图片太大可能会导致设置无效,推荐图标大小 32x32 -/// - 基础库 v2.16.0 后,支持更多图片格式以及关键字种类(参考 CSS 标准) -/// -public static bool SetCursor(string path,double x,double y) -{ - return WXSDKManagerHandler.Instance.SetCursor(path,x,y); -} -/// -/// [boolean wx.setMessageToFriendQuery(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.setMessageToFriendQuery.html) -/// 设置 wx.shareMessageToFriend 接口 query 字段的值 -/// -public static bool SetMessageToFriendQuery(SetMessageToFriendQueryOption option) -{ - return WXSDKManagerHandler.Instance.SetMessageToFriendQuery(option); -} -/// -/// [number wx.getTextLineHeight(Object object)](https://developers.weixin.qq.com/minigame/dev/api/render/font/wx.getTextLineHeight.html) -/// 获取一行文本的行高 -/// -public static double GetTextLineHeight(GetTextLineHeightOption option) -{ - return WXSDKManagerHandler.Instance.GetTextLineHeight(option); -} -/// -/// [string wx.loadFont(string path)](https://developers.weixin.qq.com/minigame/dev/api/render/font/wx.loadFont.html) -/// 加载自定义字体文件 -/// -public static string LoadFont(string path) -{ - return WXSDKManagerHandler.Instance.LoadFont(path); -} -/// -/// 查询当前直播状态 -/// -public static GameLiveState GetGameLiveState() -{ - return WXSDKManagerHandler.Instance.GetGameLiveState(); -} - -/// -/// [[UpdateManager](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html) wx.getUpdateManager()](https://developers.weixin.qq.com/minigame/dev/api/base/update/wx.getUpdateManager.html) -/// 需要基础库: `1.9.90` -/// 获取**全局唯一**的版本更新管理器,用于管理小程序更新。关于小程序的更新机制,可以查看[运行机制](https://developers.weixin.qq.com/minigame/dev/guide/runtime/operating-mechanism.html)文档。 -/// **示例代码** -/// [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) -/// -public static UpdateManager GetUpdateManager() -{ - return WXSDKManagerHandler.Instance.GetUpdateManager(); -} - - } -} - diff --git a/Assets/WX-WASM-SDK/WX.cs.meta b/Assets/WX-WASM-SDK/WX.cs.meta deleted file mode 100644 index 4f180e6a..00000000 --- a/Assets/WX-WASM-SDK/WX.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 648f61029e927424199cc04da96e384f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXAdBaseStyle.cs b/Assets/WX-WASM-SDK/WXAdBaseStyle.cs deleted file mode 100644 index 48d9fba9..00000000 --- a/Assets/WX-WASM-SDK/WXAdBaseStyle.cs +++ /dev/null @@ -1,83 +0,0 @@ -namespace WeChatWASM -{ - - public class WXAdBaseStyle - { - // 这个类是为了和JS的API保持一致的调用方法 - private Style style; - private string ADId; - - public WXAdBaseStyle(string id, Style style) - { - ADId = id; - this.style = style; - } - - - public int left - { - get - { - return style.left; - } - set - { - style.left = value; - WXSDKManagerHandler.Instance.ADStyleChange(ADId, "left", value); - } - } - public int top - { - get - { - return style.top; - } - set - { - style.top = value; - WXSDKManagerHandler.Instance.ADStyleChange(ADId, "top", value); - } - } - public int width - { - get - { - return style.width; - } - set - { - style.width = value; - WXSDKManagerHandler.Instance.ADStyleChange(ADId, "width", value); - } - } - public int height - { - get - { - return style.height; - } - set - { - style.height = value; - WXSDKManagerHandler.Instance.ADStyleChange(ADId, "height", value); - } - } - - public int realHeight - { - get - { - return WXSDKManagerHandler.Instance.ADGetStyleValue(ADId, "realHeight"); - } - } - - public int realWidth - { - get - { - return WXSDKManagerHandler.Instance.ADGetStyleValue(ADId, "realWidth"); - } - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXAdBaseStyle.cs.meta b/Assets/WX-WASM-SDK/WXAdBaseStyle.cs.meta deleted file mode 100644 index 863d2a5f..00000000 --- a/Assets/WX-WASM-SDK/WXAdBaseStyle.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bb825ab4f474b4f40abcb7faf1ae3722 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXAdCustomStyle.cs b/Assets/WX-WASM-SDK/WXAdCustomStyle.cs deleted file mode 100644 index 9b527120..00000000 --- a/Assets/WX-WASM-SDK/WXAdCustomStyle.cs +++ /dev/null @@ -1,56 +0,0 @@ -namespace WeChatWASM -{ - - public class WXAdCustomStyle - { - // 这个类是为了和JS的API保持一致的调用方法 - private CustomStyle style; - private readonly string ADId; - - - public WXAdCustomStyle(string id, CustomStyle style) - { - ADId = id; - this.style = style; - } - - - public int left - { - get - { - return style.left; - } - set - { - style.left = value; - WXSDKManagerHandler.Instance.ADStyleChange(ADId, "left", value); - } - } - public int top - { - get - { - return style.top; - } - set - { - style.top = value; - WXSDKManagerHandler.Instance.ADStyleChange(ADId, "top", value); - } - } - public bool isFixed - { - get - { - return style.isFixed; - } - set - { - style.isFixed = value; - WXSDKManagerHandler.Instance.ADStyleChange(ADId, "fixed", value ? 1 : 0); - } - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXAdCustomStyle.cs.meta b/Assets/WX-WASM-SDK/WXAdCustomStyle.cs.meta deleted file mode 100644 index f9194c01..00000000 --- a/Assets/WX-WASM-SDK/WXAdCustomStyle.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c4faf0360d561e34e932273775c879de -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXBannerAd.cs b/Assets/WX-WASM-SDK/WXBannerAd.cs deleted file mode 100644 index 23417f04..00000000 --- a/Assets/WX-WASM-SDK/WXBannerAd.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; - -namespace WeChatWASM -{ - - /// - /// Banner 广告,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/banner-ad.html - /// - public class WXBannerAd : WXBaseAd, IWXAdResizable - { - public WXAdBaseStyle style; - - public Action onResizeAction; - - public WXBannerAd(string id,Style style) : base(id) - { - this.style = new WXAdBaseStyle(id, style); - } - - public void OnResizeCallback(WXADResizeResponse res) - { - onResizeAction?.Invoke(res); - } - - /// - /// 监听 banner 广告尺寸变化事件。 - /// - /// banner 广告尺寸变化事件的回调函数 - public void OnResize(Action action) - { - onResizeAction += action; - } - - /// - /// 取消监听 banner 广告尺寸变化事件 - /// - /// banner 广告尺寸变化事件的回调函数 - public void OffResize(Action action) - { - onResizeAction -= action; - } - - /// - /// 隐藏 banner 广告。 - /// - public void Hide() - { - WXSDKManagerHandler.Instance.HideAd(instanceId); - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXBannerAd.cs.meta b/Assets/WX-WASM-SDK/WXBannerAd.cs.meta deleted file mode 100644 index e7363424..00000000 --- a/Assets/WX-WASM-SDK/WXBannerAd.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ad544fd98bf8e0d4ea80e6e6280922b1 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXBase.cs b/Assets/WX-WASM-SDK/WXBase.cs deleted file mode 100644 index 565f8551..00000000 --- a/Assets/WX-WASM-SDK/WXBase.cs +++ /dev/null @@ -1,693 +0,0 @@ -using UnityEngine; -using System; - -namespace WeChatWASM -{ - /// - /// 微信SDK对外暴露的API - /// - public class WXBase - { - - #region env - /// - /// 微信提供了一个用户文件目录给开发者,开发者对这个目录有完全自由的读写权限。通过 WX.env.USER_DATA_PATH 可以获取到这个目录的路径。 - /// - public static WXEnv env - { - get - { - return WXSDKManagerHandler.Env; - } - } - #endregion - - - #region cloud - /// - /// 云函数 - /// - public static Cloud cloud - { - get - { - return WXSDKManagerHandler.cloud; - } - } - #endregion - - - - #region 初始化SDK - /// - /// 初始化SDK - /// - /// 初始化完毕后回调,请回调后再执行游戏主逻辑 - public static void InitSDK(Action callback) - { - - WXSDKManagerHandler.Instance.InitSDK(callback); - - } - #endregion - - #region 数据上报 - - /// - /// 游戏开始运行时上报 - /// - public static void ReportGameStart() - { - WXSDKManagerHandler.Instance.ReportGameStart(); - } - - /// - /// 设置游戏当前阶段,通知插件侧游戏当前所处阶段,便于用户退出或异常发生时,独立域插件能上报游戏当前阶段 - /// - /// 自定义的阶段id,id>=200, id<=10000 - public static void SetGameStage(int stageType) - { - WXSDKManagerHandler.Instance.SetGameStage(stageType); - } - - /// - /// 上报当前自定义阶段耗时 - /// - /// 自定义阶段耗时,没有就传0 - /// 上报的额外信息,json序列化字符串 - public static void ReportGameStageCostTime(int costTime, string extJsonStr) - { - WXSDKManagerHandler.Instance.ReportGameStageCostTime(costTime, extJsonStr); - } - - /// - /// 上报当前自定义阶段错误信息 - /// - /// 错误类型, 取值范围0-10000 - /// 错误信息 - /// 上报的额外信息,json序列化字符串 - public static void ReportGameStageError(int errorType, string errStr, string extJsonStr) - { - WXSDKManagerHandler.Instance.ReportGameStageError(errorType, errStr, extJsonStr); - } - - /// - /// 向日志管理器中写log - /// 日志管理器文档:https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.html - /// - /// log信息 - public static void WriteLog(string str) - { - WXSDKManagerHandler.Instance.WriteLog(str); - } - - /// - /// 向日志管理器中写warn - /// 日志管理器文档:https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.html - /// - /// warn信息 - public static void WriteWarn(string str) - { - WXSDKManagerHandler.Instance.WriteWarn(str); - } - - public static void HideLoadingPage() - { - WXSDKManagerHandler.Instance.HideLoadingPage(); - } - - /// - /// 控制预载并发数 - /// - /// 并发数,取值范围[1, 10] - public static void PreloadConcurrent(int count) - { - WXSDKManagerHandler.Instance.PreloadConcurrent(count); - } - - /// - /// 用于分支相关的UI组件(一般是按钮)相关事件的上报,事件目前有曝光、点击两种 - /// - /// 分支ID,在「小程序管理后台」获取 - /// 自定义维度 - /// 事件类型,1:曝光; 2:点击 - public static void ReportUserBehaviorBranchAnalytics(string branchId, string branchDim, int eventType) - { - WXSDKManagerHandler.Instance.ReportUserBehaviorBranchAnalytics(branchId, branchDim, eventType); - } - - #endregion - - - - #region 本地存储 - // 更多关于存储的隔离策略和清理策略说明可以查看这里 https://developers.weixin.qq.com/minigame/dev/guide/base-ability/storage.html - - /* - * @description 同步设置int型数据存储, - * @param key 键名 - * @param value 数值 - */ - public static void StorageSetIntSync(string key, int value) - { - WXSDKManagerHandler.Instance.StorageSetIntSync(key, value); - } - - - /* - * @description 同步获取之前设置过的int型数据, - * @param key 键名 - * @param defaultValue 默认值 - * @returns 异常的和空时候会返回默认值 - */ - public static int StorageGetIntSync(string key, int defaultValue) - { - return WXSDKManagerHandler.Instance.StorageGetIntSync(key, defaultValue); - } - - - - /* - * @description 同步设置string型数据存储, - * @param key 键名 - * @param value 数值 - */ - public static void StorageSetStringSync(string key, string value = "") - { - WXSDKManagerHandler.Instance.StorageSetStringSync(key, value); - } - - - /* - * @description 同步获取之前设置过的string型数据, - * @param key 键名 - * @param defaultValue 默认值 - * @returns 异常的和空时候会返回默认值 - */ - public static string StorageGetStringSync(string key, string defaultValue) - { - return WXSDKManagerHandler.Instance.StorageGetStringSync(key, defaultValue); - } - - - /* - * @description 同步设置float型数据存储, - * @param key 键名 - * @param value 数值 - */ - public static void StorageSetFloatSync(string key, float value) - { - WXSDKManagerHandler.Instance.StorageSetFloatSync(key, value); - } - - - /* - * @description 同步获取之前设置过的float型数据, - * @param key 键名 - * @param defaultValue 默认值 - * @returns 异常的和空时候会返回默认值 - */ - public static float StorageGetFloatSync(string key, float defaultValue) - { - return WXSDKManagerHandler.Instance.StorageGetFloatSync(key, defaultValue); - } - - /* - * @description 同步删除所有数据 - */ - public static void StorageDeleteAllSync() - { - WXSDKManagerHandler.Instance.StorageDeleteAllSync(); - } - - - - /* - * @description 同步删除对应一个key的数据 - * @param key 键名 - */ - public static void StorageDeleteKeySync(string key) - { - WXSDKManagerHandler.Instance.StorageDeleteKeySync(key); - } - - - /* - * @description 判断一个key是否有值 - * @param key 键名 - * @returns true:有,false:没有 - */ - public static bool StorageHasKeySync(string key) - { - return WXSDKManagerHandler.Instance.StorageHasKeySync(key); - } - - #endregion - - - #region 用户信息 - - - /// - /// 创建用户信息按钮,这里是在屏幕上额外创建一块透明区域,其为点击区域,用户点击后,就会请求用户授权获取用户信息。游戏中的该区域最好为按钮区域,这样就能看起来用户是在点击游戏中的按钮 - /// - /// x 左上角横坐标(以屏幕左上角为0) - /// y 左上角纵坐标(以屏幕左上角为0) - /// 区域宽度 - /// 区域高度 - /// 显示用户信息的语言 可取(en,zh_CN,zh_TW)的一个 - /// 是否带上登录态信息。当 withCredentials 为 true 时,要求此前有调用过 wx.login 且登录态尚未过期,此时返回的数据会包含 encryptedData, iv 等敏感信息;当 withCredentials 为 false 时,不要求有登录态,返回的数据不包含 encryptedData, iv 等敏感信息。 - /// 返回对象用于后续控制该透明区域的点击,展示和隐藏等行为 - public static WXUserInfoButton CreateUserInfoButton(int x, int y, int width, int height, string lang, bool withCredentials) - { - return WXSDKManagerHandler.Instance.CreateUserInfoButton(x, y, width, height, lang, withCredentials); - } - - #endregion - - - #region 分享转发 - - /// - /// 监听用户点击右上角菜单的「转发」按钮时触发的事件 - /// - /// 默认的设置内容 - /// 用户点击右上角菜单的「转发」按钮时触发的事件的回调函数,请在回调后三秒内,触发 Action返回设置的内容,否则会使用 defaultParam - public static void OnShareAppMessage(WXShareAppMessageParam defaultParam, Action> action = null) - { - WXSDKManagerHandler.Instance.OnShareAppMessage(defaultParam, action); - } - - #endregion - - #region 广告 - - /// - /// banner 广告组件。banner 广告组件是一个原生组件,层级比普通组件高。banner 广告组件默认是隐藏的,需要调用 BannerAd.show() 将其显示。banner 广告会根据开发者设置的宽度进行等比缩放,缩放后的尺寸将通过 BannerAd.onResize() 事件中提供。 使用可参考 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/banner-ad.html - /// - /// param各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createBannerAd.html - /// 对banner广告做操作的对象,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.html - /// - /// // 底部banner广告示例 - /// var sysInfo = WX.GetSystemInfoSync(); - /// var banner = WX.CreateBannerAd(new WXCreateBannerAdParam() - /// { - /// adUnitId = "adunit-2e20328227ca771b", - /// adIntervals = 30, - /// style = new Style() - /// { - /// left = 0, - /// top = sysInfo.windowHeight - 100, - /// width = sysInfo.windowWidth, - /// height = 100 - /// } - /// }); - /// banner.OnError((WXADErrorResponse res)=> - /// { - /// Debug.Log("bannerad error response"); - /// }); - /// banner.OnLoad(()=> { - /// banner.Show(); - /// }); - /// banner.OnResize((WXADResizeResponse res) => - /// { - /// //拉取的广告可能跟设置的不一样,需要动态调整位置 - /// banner.style.top = sysInfo.windowHeight - res.height; - /// }); - /// - public static WXBannerAd CreateBannerAd(WXCreateBannerAdParam param) - { - return WXSDKManagerHandler.Instance.CreateBannerAd(param); - } - - /// - /// 这个方法提供一个固定在底部,且固定高度,且水平居中的bannerAd,此方法不需要再手动监听OnResize事件调整位置了 - /// - /// 广告单元 id - /// 广告自动刷新的间隔时间,单位为秒,参数值必须大于等于30(该参数不传入时 Banner 广告不会自动刷新) - /// 要固定的高度 - /// 对banner广告做操作的对象,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.html - public static WXBannerAd CreateFixedBottomMiddleBannerAd(string adUnitId, int adIntervals, int height) - { - return WXSDKManagerHandler.Instance.CreateFixedBottomMiddleBannerAd(adUnitId, adIntervals, height); - } - - - /// - /// 激励视频广告 详细参见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/rewarded-video-ad.html - /// - /// - /// 广告操作对象,https://developers.weixin.qq.com/minigame/dev/api/ad/RewardedVideoAd.html - public static WXRewardedVideoAd CreateRewardedVideoAd(WXCreateRewardedVideoAdParam param) - { - return WXSDKManagerHandler.Instance.CreateRewardedVideoAd(param); - } - - /// - /// 创建插屏广告组件 详细参见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createInterstitialAd.html - /// - /// - /// 广告操作对象,https://developers.weixin.qq.com/minigame/dev/api/ad/InterstitialAd.html - public static WXInterstitialAd CreateInterstitialAd(WXCreateInterstitialAdParam param) - { - return WXSDKManagerHandler.Instance.CreateInterstitialAd(param); - } - - - - /// - /// Grid 广告 详细参见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/grid-ad.html - /// - /// 详细参见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createGridAd.html - /// 广告操作对象,https://developers.weixin.qq.com/minigame/dev/api/ad/GridAd.html - public static WXGridAd CreateGridAd(WXCreateGridAdParam param) - { - return WXSDKManagerHandler.Instance.CreateGridAd(param); - } - - /// - /// 创建原生模板广告组件 详细参见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createCustomAd.html - /// - /// - /// 广告操作对象,https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.html - public static WXCustomAd CreateCustomAd(WXCreateCustomAdParam param) - { - return WXSDKManagerHandler.Instance.CreateCustomAd(param); - } - #endregion - - - #region 文件 - /// - /// 获取全局唯一的文件管理器 详见 https://developers.weixin.qq.com/minigame/dev/guide/base-ability/file-system.html - /// - /// 返回数据详见,https://developers.weixin.qq.com/minigame/dev/api/file/wx.getFileSystemManager.html - /// - /// // 在本地用户文件目录下创建一个文件 share.jpg,文件名可以自己随便取,写入内容为图片二进制内容 bytes - /// var fs = WX.GetFileSystemManager(); - /// fs.WriteFileSync(WX.env.USER_DATA_PATH+"/share.jpg", bytes); - /// - public static WXFileSystemManager GetFileSystemManager() - { - return new WXFileSystemManager(); - } - #endregion - - - #region 开放数据域,关系链,排行榜这一类 - - /// - /// 获取开放数据域,关系链相关可以参看 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/open-data.html - /// - /// 开放数据域对象 - public static WXOpenDataContext GetOpenDataContext() - { - return new WXOpenDataContext(); - } - - - /// - /// 展示开放数据域 - /// - /// 用来占位的纹理,前端绘制的开放域数据会自动替换这一纹理,因为客户顿纹理映射倒立问题,这一纹理请设置rotationX为180才能正常展示。 - /// 占位对应屏幕左上角横坐标 - /// 占位对应屏幕左上角纵坐标,注意左上角为(0,0) - /// 占位对应的宽度 - /// 占位对应的高度 - public static void ShowOpenData(Texture texture, int x, int y, int width, int height) - { - WXSDKManagerHandler.Instance.ShowOpenData(texture, x, y, width, height); - } - - /// - /// 关闭开放数据域 - /// - public static void HideOpenData() - { - WXSDKManagerHandler.Instance.HideOpenData(); - } - - #endregion - - - #region 音频 - /// - /// InnerAudioContext 实例,可通过 WX.CreateInnerAudioContext 接口获取实例。注意,音频播放过程中,可能被系统中断,可通过 WX.OnAudioInterruptionBegin、WX.OnAudioInterruptionEnd事件来处理这种情况。详见:https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html - /// - /// - //var music = WX.CreateInnerAudioContext(new InnerAudioContextParam() { - // src = "Assets/Audio/Chill_1.wav", - // needDownload = true //表示等下载完之后再播放,便于后续复用,无延迟 - //}); - //music.OnCanplay(() => - //{ - // Debug.Log("OnCanplay"); - // music.Play(); - //}); - /// - public static WXInnerAudioContext CreateInnerAudioContext(InnerAudioContextParam param = null) - { - return WXSDKManagerHandler.Instance.CreateInnerAudioContext(param); - } - - /// - /// 音频为网络请求,可能会有延迟,所以可以先调用这个接口预先下载音频缓存到本地,避免延迟 - /// - /// 音频的地址数组,如 { "Assets/Audio/0.wav", "Assets/Audio/1.wav" } - /// 全部音频下载完成后回调,返回码为0表示下载完成 - /// - /// string[] a = { "Assets/Audio/0.wav", "Assets/Audio/1.wav" }; - // WX.PreDownloadAudios(a, (code) => - // { - // Debug.Log("Downloaded" + code); - // if (code == 0) - // { - // var music0 = WX.CreateInnerAudioContext(new InnerAudioContextParam() - // { - // src = "Assets/Audio/0.wav" - // }); - // music0.Play(); - - // var music1 = WX.CreateInnerAudioContext(new InnerAudioContextParam() - // { - // src = "Assets/Audio/1.wav" - // }); - // music1.Play(); - // } - //}); - /// - public static void PreDownloadAudios(string[] pathList, Action action) - { - WXSDKManagerHandler.Instance.PreDownloadAudios(pathList, action); - } - #endregion - - /// - /// 创建视频,详见 https://developers.weixin.qq.com/minigame/dev/api/media/video/wx.createVideo.html - /// - /// - /// - #region 视频 - public static WXVideo CreateVideo(WXCreateVideoParam param) { - return WXSDKManagerHandler.Instance.CreateVideo(param); - } - - - /// - /// 适合几秒d短音频播放 - /// - public static WXShortAudioPlayer ShortAudioPlayer = WXShortAudioPlayer.Instance; - - #endregion - - - - #region 性能 - /// - /// 获取当前UnityHeap总内存(峰值) - /// - public static uint GetTotalMemorySize() - { - return WXSDKManagerHandler.Instance.GetTotalMemorySize(); - } - /// - /// 获取当前UnityHeap Stack大小 - /// - public static uint GetTotalStackSize() - { - return WXSDKManagerHandler.Instance.GetTotalStackSize(); - } - /// - /// 获取当前UnityHeap静态内存 - /// - public static uint GetStaticMemorySize() - { - return WXSDKManagerHandler.Instance.GetStaticMemorySize(); - } - /// - /// 获取当前UnityHeap动态内存 - /// - public static uint GetDynamicMemorySize() - { - return WXSDKManagerHandler.Instance.GetDynamicMemorySize(); - } - /// - /// 获取当前UnityHeap动态内存 - /// - public static uint GetUsedMemorySize() - { - return WXSDKManagerHandler.Instance.GetUsedMemorySize(); - } - /// - /// 获取当前UnityHeap动态内存 - /// - public static uint GetUnAllocatedMemorySize() - { - return WXSDKManagerHandler.Instance.GetUnAllocatedMemorySize(); - } - - - /// - /// 打印UnityHeap内存 - /// - public static void LogUnityHeapMem() - { - WXSDKManagerHandler.Instance.LogUnityHeapMem(); - } - - /// - /// 打开性能面板 - /// - public static void OpenProfileStats() - { - WXSDKManagerHandler.Instance.OpenProfileStats(); - } - #endregion - - - #region 调试 - /// - /// 写 debug 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.debug.html - /// - /// - public static void LogManagerDebug(string str) { - WXSDKManagerHandler.Instance.LogManagerDebug(str); - } - - /// - /// 写 info 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.info.html - /// - /// - public static void LogManagerInfo(string str) - { - WXSDKManagerHandler.Instance.LogManagerInfo(str); - } - - - /// - /// 写 log 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.log.html - /// - /// - public static void LogManagerLog(string str) - { - WXSDKManagerHandler.Instance.LogManagerLog(str); - } - - - /// - /// 写 warn 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.warn.html - /// - /// - public static void LogManagerWarn(string str) - { - WXSDKManagerHandler.Instance.LogManagerWarn(str); - } - - #endregion - - #region 云测试 - /// - /// 是否小游戏云测试环境 - /// - public static bool IsCloudTest() - { - return WXSDKManagerHandler.Instance.IsCloudTest(); - } - #endregion - - #region 清理文件缓存 - /// - /// 游戏异常时,使用本接口清理资源缓存 - /// - public static void CleanAllFileCache(Action action = null) - { - WXSDKManagerHandler.Instance.CleanAllFileCache(action); - } - - /// - /// 当空间不足时,清理指定大小缓存,按文件最近访问时间排序 - /// - /// 需要清理的文件大小,单位bytes - public static void CleanFileCache(int fileSize, Action action = null) - { - WXSDKManagerHandler.Instance.CleanFileCache(fileSize, action); - } - - /// - /// 删除指定文件 - /// - /// 需要清理的文件路径,支持完整路径,也支持StreamingAssets/filepath格式 - public static void RemoveFile(string path, Action action = null) - { - WXSDKManagerHandler.Instance.RemoveFile(path, action); - } - - #endregion - /// - /// 获取启动loader的启动数据 - /// - /// - public static void OnLaunchProgress(Action action = null) - { - WXSDKManagerHandler.Instance.OnLaunchProgress(action); - } - - public static void UncaughtException() - { - WXSDKManagerHandler.Instance.UncaughtException(); - } - - #region 交互 - - - /// - /// 创建游戏圈按钮,详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/game-club/wx.createGameClubButton.html - /// - /// - public static WXGameClubButton CreateGameClubButton(WXCreateGameClubButtonParam param) - { - return WXSDKManagerHandler.Instance.CreateGameClubButton(param); - } - - #endregion - - - #region UDP - public static int CreateUDPSocket(string ip, int remotePort, int bindPort = 0) - { - return WXSDKManagerHandler.Instance.CreateUDPSocket(ip, remotePort, bindPort); - } - - public static void CloseUDPSocket(int socketId) - { - WXSDKManagerHandler.Instance.CloseUDPSocket(socketId); - } - - public static void SendUDPSocket(int socketId, byte[] buffer, int offset, int length) - { - WXSDKManagerHandler.Instance.SendUDPSocket(socketId, buffer, offset, length); - } - #endregion - } -} - diff --git a/Assets/WX-WASM-SDK/WXBase.cs.meta b/Assets/WX-WASM-SDK/WXBase.cs.meta deleted file mode 100644 index 703fab1b..00000000 --- a/Assets/WX-WASM-SDK/WXBase.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8951daeeec764441c9e35bfb2bf54930 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXBaseAd.cs b/Assets/WX-WASM-SDK/WXBaseAd.cs deleted file mode 100644 index edd7fcc5..00000000 --- a/Assets/WX-WASM-SDK/WXBaseAd.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace WeChatWASM -{ - /// - /// 广告的基类 - /// - public class WXBaseAd - { - public string instanceId; - - public static Dictionary Dict = new Dictionary(); - - public Action onErrorAction; - - public Action onLoadActon; - - - - - public WXBaseAd(string id) - { - instanceId = id; - Dict.Add(id, this); - } - - - /// - /// 显示广告。 - /// - /// 成功回调 - /// 失败回调 - public void Show(Action success = null, Action failed = null) - { - - WXSDKManagerHandler.Instance.ShowAd(instanceId, WXCallBackHandler.Add(success), WXCallBackHandler.Add(failed)); - } - - /// - /// 显示广告。 - /// - /// 成功回调 - /// 失败回调 - public void Show(string branchId, string branchDim, Action success = null, Action failed = null) - { - - WXSDKManagerHandler.Instance.ShowAd(instanceId, branchId, branchDim, WXCallBackHandler.Add(success), WXCallBackHandler.Add(failed)); - } - - /// - /// 监听广告错误事件。 - /// - /// 广告错误事件的回调函数,可详见 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.onError.html - public void OnError(Action action) - { - onErrorAction += action; - } - - /// - /// 监听 banner 广告加载事件。 - /// - /// 广告加载事件的回调函数 - public void OnLoad(Action action) - { - onLoadActon += action; - } - - - /// - /// 取消监听广告错误事件 - /// - /// 广告错误事件的回调函数 - public void OffError(Action action) - { - onErrorAction -= action; - } - - /// - /// 取消监听广告加载事件 - /// - /// 广告加载事件的回调函数 - public void OffLoad(Action action) - { - onLoadActon -= action; - } - - /// - /// 销毁广告,如果是激励视频广告且multiton参数默认设置为false,则请慎用Destroy,调用后,后续可能无法再创建激励视频广告 - /// - public void Destroy() - { - WXSDKManagerHandler.Instance.ADDestroy(instanceId); - Dict.Remove(instanceId); - } - - } - -} - diff --git a/Assets/WX-WASM-SDK/WXBaseAd.cs.meta b/Assets/WX-WASM-SDK/WXBaseAd.cs.meta deleted file mode 100644 index b4172c71..00000000 --- a/Assets/WX-WASM-SDK/WXBaseAd.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3ce1c25d1fc66e540b427d2d4a9ebfb9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXCallBackHandler.cs b/Assets/WX-WASM-SDK/WXCallBackHandler.cs deleted file mode 100644 index 66af851d..00000000 --- a/Assets/WX-WASM-SDK/WXCallBackHandler.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace WeChatWASM -{ - - - class WXCallBackHandler - { - - //用于暂存回调 - private static readonly Hashtable responseHT = new Hashtable(); - - - //用于作为回调id的一部分 - private static int htCounter = 0; - - - private static int GenarateCallbackId() - { - if (htCounter > 1000000) - { - htCounter = 0; - } - htCounter++; - - return htCounter; - } - - - public static bool NeedCheckAndClear() - { - if (responseHT.Count == 1) - { - return true; - } - return false; - } - - - public static string Add(Action callback) where T : WXBaseResponse - { - if(callback == null) - { - return ""; - } - int id = GenarateCallbackId(); - TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); - var timestamp = Convert.ToInt64(ts.TotalSeconds); - var key = timestamp.ToString() + '-' + id; - responseHT.Add(key,callback); - if (NeedCheckAndClear()) - { - WXSDKManagerHandler.Instance.StartCoroutine(CheckAndCLear()); - } - return key; - } - - - public static void InvokeResponseCallback(string str) where T : WXBaseResponse - { - if (str != null) - { - T res = JsonUtility.FromJson(str); - - var id = res.callbackId; - - if (responseHT.ContainsKey(id)) - { - var callback = (Action)responseHT[id]; - callback(res); - responseHT.Remove(id); - } - } - } - - - - - public static void InvokeUserInfoButtonCallback(string str) - { - if (str != null) - { - WXUserInfoResponse res = JsonUtility.FromJson(str); - var id = res.callbackId; - if (WXUserInfoButton.Dict.ContainsKey(id)) - { - res.userInfo = JsonUtility.FromJson(res.userInfoRaw); - var button = WXUserInfoButton.Dict[id]; - button.InvokeCallback(res); - } - } - } - - - - - static IEnumerator CheckAndCLear() - { - yield return new WaitForSeconds(8.0f); // 清除超过8秒的回调 - - if (responseHT.Count > 0) - { - ICollection key = responseHT.Keys; - TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); - long now = Convert.ToInt64(ts.TotalSeconds); - List tempItems = new List(); - foreach (string k in key) - { - long.TryParse(k.Split('-')[0], out long time); - if (now - time > 8) - { - tempItems.Add(k); - } - } - foreach (string tempItem in tempItems) - { - responseHT.Remove(tempItem); - } - } - - if (responseHT.Count > 0) - { - WXSDKManagerHandler.Instance.StartCoroutine(CheckAndCLear()); - } - - } - } - - -} diff --git a/Assets/WX-WASM-SDK/WXCallBackHandler.cs.meta b/Assets/WX-WASM-SDK/WXCallBackHandler.cs.meta deleted file mode 100644 index eb0b8b36..00000000 --- a/Assets/WX-WASM-SDK/WXCallBackHandler.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4cb49e6cf999a4e4689ca6be967b256f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXCanvas.cs b/Assets/WX-WASM-SDK/WXCanvas.cs deleted file mode 100644 index e09e1ca5..00000000 --- a/Assets/WX-WASM-SDK/WXCanvas.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Runtime.InteropServices; -using UnityEngine; -using LitJson; - -namespace WeChatWASM -{ - /// - /// 调用客户端的canvas - /// - public class WXCanvas - { - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXToTempFilePathSync(string conf); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXToTempFilePath(string conf, string s, string f, string c); - - /// - /// 同步的将当前 Canvas 保存为一个临时文件 - /// 华为机型分享有已知bug,推荐使用异步版本 - /// - /// canvas 生成的临时文件路径 (本地路径) - public static string ToTempFilePathSync(WXToTempFilePathSyncParam param = null) - { - return WXToTempFilePathSync(param == null ? "" : JsonUtility.ToJson(param)); - } - - /// - /// 异步的将当前 Canvas 保存为一个临时文件 - /// - public static void ToTempFilePath(WXToTempFilePathParam param = null) - { - WXToTempFilePath(JsonUtility.ToJson(param), WXCallBackHandler.Add(param.success), WXCallBackHandler.Add(param.fail), WXCallBackHandler.Add(param.complete)); - } - } -} diff --git a/Assets/WX-WASM-SDK/WXCanvas.cs.meta b/Assets/WX-WASM-SDK/WXCanvas.cs.meta deleted file mode 100644 index 9f4e150f..00000000 --- a/Assets/WX-WASM-SDK/WXCanvas.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 1dc1080c6b83dc449b5b2e62ecbb1359 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXCustomAd.cs b/Assets/WX-WASM-SDK/WXCustomAd.cs deleted file mode 100644 index 5c9f38d5..00000000 --- a/Assets/WX-WASM-SDK/WXCustomAd.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -namespace WeChatWASM -{ - - /// - /// 插屏广告组件广告,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.html - /// - public class WXCustomAd : WXBaseAd, IWXADCloseable - { - public WXAdCustomStyle style; - public WXCustomAd(string id, CustomStyle style) : base(id) - { - this.style = new WXAdCustomStyle(id,style); - } - public Action onCloseAction; - - public void OnCloseCallback() - { - onCloseAction?.Invoke(); - } - - - /// - /// 监听广告关闭事件 - /// - /// 广告关闭事件的回调函数 - public void OnClose(Action action) - { - onCloseAction += action; - } - - /// - /// 取消监听广告关闭事件 - /// - /// 广告关闭事件的回调函数 - public void OffClose(Action action) - { - onCloseAction -= action; - } - - /// - /// 隐藏原生模板广告。(某些模板广告无法隐藏) - /// - /// 成功回调 - /// 失败回调 - public void Hide(Action success = null, Action failed = null) - { - WXSDKManagerHandler.Instance.HideAd(instanceId, WXCallBackHandler.Add(success), WXCallBackHandler.Add(failed)); - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXCustomAd.cs.meta b/Assets/WX-WASM-SDK/WXCustomAd.cs.meta deleted file mode 100644 index f27f407b..00000000 --- a/Assets/WX-WASM-SDK/WXCustomAd.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d9fa5fc7758ad134b87622b8c620533b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXEnv.cs b/Assets/WX-WASM-SDK/WXEnv.cs deleted file mode 100644 index bd96e6e7..00000000 --- a/Assets/WX-WASM-SDK/WXEnv.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WeChatWASM -{ - public class WXEnv - { - #region C#调用JS桥接方法 -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXGetUserDataPath(); - - #endregion - - /// - /// 微信提供了一个用户文件目录给开发者,开发者对这个目录有完全自由的读写权限。通过 WX.env.USER_DATA_PATH 可以获取到这个目录的路径。 - /// - public string USER_DATA_PATH - { - get - { - return WXGetUserDataPath(); - } - - } - } -} diff --git a/Assets/WX-WASM-SDK/WXEnv.cs.meta b/Assets/WX-WASM-SDK/WXEnv.cs.meta deleted file mode 100644 index 7b67c16e..00000000 --- a/Assets/WX-WASM-SDK/WXEnv.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 90d62e2c67f3215409707130d97bccdb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXFileCacheClean.cs b/Assets/WX-WASM-SDK/WXFileCacheClean.cs deleted file mode 100644 index e399d5ef..00000000 --- a/Assets/WX-WASM-SDK/WXFileCacheClean.cs +++ /dev/null @@ -1,51 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using System; - -namespace WeChatWASM { - public class CleanFileCacheParams { - public string callbackId; - public ReleaseResult result; - } - public class FileCacheCommonParams { - public string callbackId; - public bool result; - } - public class WXFileCacheCleanTask { -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCleanFileCache(int fileSize); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCleanAllFileCache(); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXRemoveFile(string path); - - - public Action OnCleanFileCacheAction; - public Action OnCleanAllFileCacheAction; - public Action OnRemoveFileAction; - public static Dictionary Dict = new Dictionary(); - public WXFileCacheCleanTask(int fileSize, Action action = null) { - var id = WXCleanFileCache(fileSize); - Dict.Add(id, this); - OnCleanFileCacheAction+=action; - } - public WXFileCacheCleanTask(bool removeAll, Action action = null) { - var id = WXCleanAllFileCache(); - Dict.Add(id, this); - OnCleanAllFileCacheAction+=action; - } - public WXFileCacheCleanTask(string path, Action action = null) { - var id = WXRemoveFile(path); - Dict.Add(id, this); - OnRemoveFileAction+=action; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/WXFileCacheClean.cs.meta b/Assets/WX-WASM-SDK/WXFileCacheClean.cs.meta deleted file mode 100644 index 6a2f80e7..00000000 --- a/Assets/WX-WASM-SDK/WXFileCacheClean.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6fdcbaeeb3c174da187d45a8ee5e91cf -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXFileSystemManager.cs b/Assets/WX-WASM-SDK/WXFileSystemManager.cs deleted file mode 100644 index 338fe4a1..00000000 --- a/Assets/WX-WASM-SDK/WXFileSystemManager.cs +++ /dev/null @@ -1,361 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using UnityEngine; - -namespace WeChatWASM -{ - public class WXFileSystemManager - { - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXWriteFileSync(string filePath, string data, string encoding); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXWriteBinFileSync(string filePath, byte[] data, int dataLength, string encoding); - - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXWriteFile(string filePath, byte[] data, int dataLength, string encoding, string s, string f, string c); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXWriteStringFile(string filePath, string data, string encoding, string s, string f, string c); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXAppendFile(string filePath, byte[] data, int dataLength, string encoding, string s, string f, string c); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXAppendStringFile(string filePath, string data, string encoding, string s, string f, string c); - -#if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXReadFile(string filePath, string encoding, string callbackId); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern int WXReadBinFileSync(string filePath); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXReadFileSync(string filePath,string encoding); - - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXShareFileBuffer(byte[] data,string callbackId); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXAccessFileSync(string filePath); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXAccessFile(string filePath,string s,string f,string c); - - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXCopyFileSync(string srcPath, string destPath); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXCopyFile(string srcPath, string destPath, string s, string f, string c); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXUnlinkSync(string filePath); - - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXUnlink(string filePath, string s, string f, string c); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXMkdir(string dirPath, bool recursive, string s, string f, string c); - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXMkdirSync(string dirPath, bool recursive); - - - - /// - /// 请不要调用这个,这个是内部使用的回调方法 - /// - public static void HanldReadFileCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - var conf = ReadFileDict[res.callbackId]; - if (conf == null) - { - return; - } - if (res.errCode == 1) - { - var obj = new WXReadFileResponse() - { - errMsg = res.errMsg - }; - conf.fail?.Invoke(obj); - conf.complete?.Invoke(obj); - } - else if (string.IsNullOrEmpty(conf.encoding)) - { - var sharedBuffer = new byte[res.byteLength]; - WXShareFileBuffer(sharedBuffer, res.callbackId); - var obj = new WXReadFileResponse() - { - errMsg = res.errMsg, - binData = sharedBuffer, - }; - conf.success?.Invoke(obj); - conf.complete?.Invoke(obj); - } - else { - var obj = new WXReadFileResponse() - { - errMsg = res.errMsg, - stringData = res.data - }; - conf.fail?.Invoke(obj); - conf.complete?.Invoke(obj); - } - ReadFileDict.Remove(res.callbackId); - - } - - static Dictionary ReadFileDict = new Dictionary(); - - - /// - /// 同步写文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.writeFileSync.html - /// - /// 要写入的文件路径 (本地路径) - /// 要写入的文本 - /// 指定写入文件的字符编码 - /// 错误信息,如果成功的话返回ok - public string WriteFileSync(string filePath, string data, string encoding = "utf8") - { - return WXWriteFileSync(filePath, data, encoding); - } - - - /// - /// 同步写文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.writeFileSync.html - /// - /// 要写入的文件路径 (本地路径) - /// 要写入的二进制数据 - /// 指定写入文件的字符编码 - /// 错误信息,如果成功的话返回ok - public string WriteFileSync(string filePath, byte[] data, string encoding = "utf8") { - return WXWriteBinFileSync(filePath, data, data.Length, encoding); - } - - - /// - /// 将二进制写入文件, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.writeFile.html - /// - /// - public void WriteFile(WriteFileParam param) - { - WXWriteFile( - param.filePath, - param.data, - param.data.Length, - param.encoding, - WXLongCallBackHandler.Add(param.success), - WXLongCallBackHandler.Add(param.fail), - WXLongCallBackHandler.Add(param.complete) - ); - } - - /// - /// 将字符串写入文件, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.appendFile.html - /// - /// - public void WriteFile(WriteFileStringParam param) - { - WXWriteStringFile( - param.filePath, - param.data, - param.encoding, - WXLongCallBackHandler.Add(param.success), - WXLongCallBackHandler.Add(param.fail), - WXLongCallBackHandler.Add(param.complete) - ); - } - - /// - /// 在文件结尾追加二进制内容, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.appendFile.html - /// - /// - public void AppendFile(WriteFileParam param) - { - WXAppendFile( - param.filePath, - param.data, - param.data.Length, - param.encoding, - WXLongCallBackHandler.Add(param.success), - WXLongCallBackHandler.Add(param.fail), - WXLongCallBackHandler.Add(param.complete) - ); - } - - /// - /// 在文件结尾追加文本内容, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.appendFile.html - /// - /// - public void AppendFile(WriteFileStringParam param) - { - WXAppendStringFile( - param.filePath, - param.data, - param.encoding, - WXLongCallBackHandler.Add(param.success), - WXLongCallBackHandler.Add(param.fail), - WXLongCallBackHandler.Add(param.complete) - ); - } - - /// - /// 读取本地文件内容, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readFile.html - /// - /// - public void ReadFile(ReadFileParam param) { - var Rid = UnityEngine.Random.Range(0f, 10000000f).ToString(); - var id = param.filePath + Rid; - ReadFileDict.Add(param.filePath + Rid, param); - WXReadFile(param.filePath, param.encoding, id); - } - - - /// - /// 同步读取本地文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readFileSync.html - /// - /// 要读取的文件的路径 (本地路径) - /// 返回结果,失败为null - public byte[] ReadFileSync(string filePath) { - var length = WXReadBinFileSync(filePath); - if (length == 0) { - return null; - } - var sharedBuffer = new byte[length]; - WXShareFileBuffer(sharedBuffer, filePath); - return sharedBuffer; - } - - /// - /// 同步读取本地文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readFileSync.html - /// - /// 要读取的文件的路径 (本地路径) - /// 指定读取文件的字符编码,不能为空 - /// - public string ReadFileSync(string filePath,string encodeing) - { - return WXReadFileSync(filePath, encodeing); - } - - - /// - /// 同步判断文件/目录是否存在 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.accessSync.html - /// - /// 要判断是否存在的文件/目录路径 (本地路径) - /// 成功返回 "access:ok" 其他为失败,不可访问 - public string AccessSync(string path) - { - return WXAccessFileSync(path); - } - - /// - /// 判断文件/目录是否存在 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.access.html - /// - /// - public void Access(AccessParam param) - { - WXAccessFile(param.path, WXCallBackHandler.Add(param.success), WXCallBackHandler.Add(param.fail), WXCallBackHandler.Add(param.complete)); - } - - /// - /// 同步复制文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.copyFileSync.html - /// - /// 源文件路径,支持本地路径 - /// 目标文件路径,支持本地路径 - /// 成功返回 "copyFile:ok" 其他为失败 - public string CopyFileSync(string srcPath, string destPath) - { - return WXCopyFileSync(srcPath, destPath); - } - - /// - /// 复制文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.copyFile.html - /// - /// - public void CopyFile(CopyFileParam param) - { - WXCopyFile(param.srcPath, param.destPath, WXCallBackHandler.Add(param.success), WXCallBackHandler.Add(param.fail), WXCallBackHandler.Add(param.complete)); - } - - /// - /// 同步删除文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.unlinkSync.html - /// - /// 源文件路径,支持本地路径 - /// 成功返回 "unlink:ok" 其他为失败 - public string UnlinkSync(string filePath) - { - return WXUnlinkSync(filePath); - } - - /// - /// 删除文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.unlink.html - /// - /// - public void Unlink(UnlinkParam param) - { - WXUnlink(param.filePath, WXCallBackHandler.Add(param.success), WXCallBackHandler.Add(param.fail), WXCallBackHandler.Add(param.complete)); - } - - - /// - /// 创建目录, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.mkdir.html - /// - /// - public void Mkdir(MkdirParam param) { - WXMkdir(param.dirPath, param.recursive,WXCallBackHandler.Add(param.success), WXCallBackHandler.Add(param.fail), WXCallBackHandler.Add(param.complete)); - } - - /// - /// 同步创建目录,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.mkdirSync.html - /// - /// 创建的目录路径 (本地路径) - /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 - /// - public string MkdirSync(string dirPath,bool recursive) { - return WXMkdirSync(dirPath, recursive); - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXFileSystemManager.cs.meta b/Assets/WX-WASM-SDK/WXFileSystemManager.cs.meta deleted file mode 100644 index 464d2c47..00000000 --- a/Assets/WX-WASM-SDK/WXFileSystemManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4c400ca3528d3c04d85ac6842d4c5a7c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXGameClubButton.cs b/Assets/WX-WASM-SDK/WXGameClubButton.cs deleted file mode 100644 index 857d04fe..00000000 --- a/Assets/WX-WASM-SDK/WXGameClubButton.cs +++ /dev/null @@ -1,396 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using System; - -namespace WeChatWASM { - public class WXGameClubButton - { - #region C#调用JS桥接方法 -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubButtonDestroy(string id); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubButtonHide(string id); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubButtonSetProperty(string id, string key, string value); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubButtonShow(string id); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubButtonAddListener(string id, string key); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubButtonRemoveListener(string id, string key); - - #endregion - - public Hashtable ht = new Hashtable(); - public string instanceId; - public WXGameClubButtonStyle style; - public static Dictionary Dict = new Dictionary(); - private Action _onTap; - private GameClubButtonIcon _icon; - private GameClubButtonType _type; - private string _text; - private string _image; - - -#if UNITY_WEBGL && !UNITY_EDITOR - private static readonly bool isWebGL = true; -#else - private static readonly bool isWebGL = false; -#endif - - public WXGameClubButton(string id, GameClubButtonStyle style) - { - instanceId = id; - this.style = new WXGameClubButtonStyle(id, style); - Dict.Add(id, this); - } - - public GameClubButtonIcon icon - { - get - { - return _icon; - } - set - { - if (_type == GameClubButtonType.image) { - if (!isWebGL) { - ht["icon"] = value; - } else { - WXGameClubButtonSetProperty(instanceId, "icon", value.ToString()); - } - _icon = value; - } - } - } - - public GameClubButtonType type - { - get - { - return _type; - } - set - { - if (_type != value) { - if (!isWebGL) { - ht["type"] = value; - } else { - WXGameClubButtonSetProperty(instanceId, "type", value.ToString()); - } - _type = value; - } - } - } - - public string text - { - get - { - return _text; - } - set - { - if (_type == GameClubButtonType.text) { - if (!isWebGL) { - ht["text"] = value; - } else { - WXGameClubButtonSetProperty(instanceId, "text", value); - } - _text = value; - } - } - } - - public string image - { - get - { - return _image; - } - set - { - if (_type == GameClubButtonType.image) { - if (!isWebGL) { - ht["image"] = value; - } else { - WXGameClubButtonSetProperty(instanceId, "image", value); - } - _image = value; - } - } - } - - public WXGameClubButtonStyle styleObj - { - get - { - return style; - } - set - { - var props = value.GetType().GetProperties(); - var styleProps = style.GetType().GetProperties(); - // 遍历样式值,逐个设置 - foreach (var prop in props) - { - foreach (var styleProp in styleProps) - { - // styleObj是原始对象,不需要手动设置值 - if (styleProp.Name == prop.Name && styleProp.Name != "styleObj") { - styleProp.SetValue(style, prop.GetValue(value)); - } - } - } - } - } - - public void Destroy() - { - if (isWebGL) { - WXGameClubButtonDestroy(instanceId); - } else { - Debug.Log("游戏圈按钮destroy"); - } - Dict.Remove(instanceId); - } - public void Hide() - { - if (isWebGL) { - WXGameClubButtonHide(instanceId); - } else { - Debug.Log("游戏圈按钮hide"); - } - } - public void Show() - { - if (isWebGL) { - WXGameClubButtonShow(instanceId); - } else { - Debug.Log("游戏圈按钮show"); - } - } - public void OnTap(Action action) - { - if (_onTap == null) { - if (isWebGL) { - WXGameClubButtonAddListener(instanceId, "onTap"); - } - } - _onTap += action; - } - - public void OffTap(Action action = null) - { - if (action == null) { - _onTap = null; - } - else - { - _onTap -= action; - } - if (_onTap == null) { - if (isWebGL) { - WXGameClubButtonRemoveListener(instanceId, "offTap"); - } - } - } - public void _HandleCallBack(string key) - { - switch (key) { - case "onTap": - _onTap?.Invoke(); - break; - } - } - } - - public class WXGameClubButtonStyle - { - private GameClubButtonStyle style; - private string instanceId; - public WXGameClubButtonStyle(string id, GameClubButtonStyle style) - { - instanceId = id; - this.style = style; - } - - public GameClubButtonStyle styleObj - { - get - { - return style; - } - } - - public int left - { - get - { - return style.left; - } - set - { - style.left = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "left", value); - } - } - - public int top - { - get - { - return style.top; - } - set - { - style.top = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "top", value); - } - } - - public int width - { - get - { - return style.width; - } - set - { - style.width = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "width", value); - } - } - - public int height - { - get - { - return style.height; - } - set - { - style.height = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "height", value); - } - } - - public int borderWidth - { - get - { - return style.borderWidth; - } - set - { - style.borderWidth = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "borderWidth", value); - } - } - - public int borderRadius - { - get - { - return style.borderRadius; - } - set - { - style.borderRadius = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "borderRadius", value); - } - } - - public int fontSize - { - get - { - return style.fontSize; - } - set - { - style.fontSize = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "fontSize", value); - } - } - - public int lineHeight - { - get - { - return style.lineHeight; - } - set - { - style.lineHeight = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeInt(instanceId, "lineHeight", value); - } - } - - public string backgroundColor - { - get - { - return style.backgroundColor; - } - set - { - style.backgroundColor = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeStr(instanceId, "backgroundColor", value); - } - } - - public string borderColor - { - get - { - return style.borderColor; - } - set - { - style.borderColor = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeStr(instanceId, "borderColor", value); - } - } - - public string color - { - get - { - return style.color; - } - set - { - style.color = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeStr(instanceId, "color", value); - } - } - - public GameClubButtonTextAlign textAlign - { - get - { - return style.textAlign; - } - set - { - style.textAlign = value; - WXSDKManagerHandler.Instance.GameClubStyleChangeStr(instanceId, "textAlign", value.ToString()); - } - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/WXGameClubButton.cs.meta b/Assets/WX-WASM-SDK/WXGameClubButton.cs.meta deleted file mode 100644 index 23d241c6..00000000 --- a/Assets/WX-WASM-SDK/WXGameClubButton.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 69958d92fd2fe40ebb2312a416efa0c8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXGridAd.cs b/Assets/WX-WASM-SDK/WXGridAd.cs deleted file mode 100644 index 83e4d6fb..00000000 --- a/Assets/WX-WASM-SDK/WXGridAd.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -namespace WeChatWASM -{ - /// - /// Grid 广告 详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/grid-ad.html - /// - public class WXGridAd:WXBaseAd,IWXAdResizable - { - - public WXAdBaseStyle style; - - public Action onResizeAction; - - public WXGridAd(string id, Style style) : base(id) - { - instanceId = id; - this.style = new WXAdBaseStyle(id, style); - } - - public void OnResizeCallback(WXADResizeResponse res) - { - onResizeAction?.Invoke(res); - } - - /// - /// 监听 Grid 广告尺寸变化事件。 - /// - /// banner 广告尺寸变化事件的回调函数 - public void OnResize(Action action) - { - onResizeAction += action; - } - - /// - /// 取消监听 Grid 广告尺寸变化事件 - /// - /// banner 广告尺寸变化事件的回调函数 - public void OffResize(Action action) - { - onResizeAction -= action; - } - - /// - /// 隐藏 Grid 广告。 - /// - public void Hide() - { - WXSDKManagerHandler.Instance.HideAd(instanceId); - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXGridAd.cs.meta b/Assets/WX-WASM-SDK/WXGridAd.cs.meta deleted file mode 100644 index e306d351..00000000 --- a/Assets/WX-WASM-SDK/WXGridAd.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4b00073a03aa8e94da82f4661fbedf0c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXInnerAudioContext.cs b/Assets/WX-WASM-SDK/WXInnerAudioContext.cs deleted file mode 100644 index bd797aaf..00000000 --- a/Assets/WX-WASM-SDK/WXInnerAudioContext.cs +++ /dev/null @@ -1,950 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using System; - -namespace WeChatWASM -{ - /// - /// 音频类,详见 https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html - /// - public class WXInnerAudioContext - { - - public Hashtable ht = new Hashtable(); - - #region C#调用JS桥接方法 -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextSetBool(string id,string key, bool value); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextSetString(string id,string key, string value); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextSetFloat(string id,string key, float value); - - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern float WXInnerAudioContextGetFloat(string id, string key); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern bool WXInnerAudioContextGetBool(string id, string key); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextPlay(string id); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextPause(string id); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextStop(string id); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextSeek(string id, float position); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextDestroy(string id); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextAddListener(string id, string key); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXInnerAudioContextRemoveListener(string id, string key); - - - #endregion - - private bool _autoplay = false; - private bool _loop = false; - private string _src = ""; - private float _startTime = 0; - private float _volume = 1; - private float _oldVolume = 1; - private float _playbackRate = 1; - private bool _isPlaying = false; - private bool isWaiting = false; - private bool isWaitingPlay = false; - private bool isWaitingStop = false; - private bool isWaitingPause = false; - private Action _onCanplay; - private Action _onPlay; - private Action _onPause; - private Action _onStop; - private Action _onEnded; - private Action _onTimeUpdate; - private Action _onError; - private Action _onWaiting; - private Action _onSeeking; - private Action _onSeeked; - -#if UNITY_WEBGL && !UNITY_EDITOR - private static readonly bool isWebGLPlayer = true; -#else - private static readonly bool isWebGLPlayer = false; -#endif - - public static Dictionary Dict = new Dictionary(); - - public string instanceId; - public WXInnerAudioContext(string id, InnerAudioContextParam param) - { - instanceId = id; - _src = param.src; - _autoplay = param.autoplay; - _startTime = param.startTime; - _volume = param.volume; - _oldVolume = _volume; - _loop = param.loop; - _playbackRate = param.playbackRate; - Dict.Add(id, this); - - OnPlay(()=> { - _isPlaying = true; - }); - - OnEnded(()=> { - _isPlaying = false; - }); - - OnPause(()=> { - _isPlaying = false; - }); - - OnStop(()=> { - _isPlaying = false; - }); - -#if UNITY_EDITOR - _isPlaying = autoplay; -#endif - - } - - /// - /// 内部函数,请不要调用 - /// - /// - public void _HandleCallBack(string key) - { - switch (key){ - case "onCanplay": - _onCanplay?.Invoke(); - break; - case "onPlay": - _onPlay?.Invoke(); - break; - case "onPause": - _onPause?.Invoke(); - break; - case "onStop": - _onStop?.Invoke(); - break; - case "onEnded": - _onEnded?.Invoke(); - break; - case "onTimeUpdate": - _onTimeUpdate?.Invoke(); - break; - case "onError": - _onError?.Invoke(); - break; - case "onWaiting": - _onWaiting?.Invoke(); - break; - case "onSeeking": - _onSeeking?.Invoke(); - break; - case "onSeeked": - _onSeeked?.Invoke(); - break; - } - - } - - /// - /// 是否自动开始播放,默认为 false - /// - public bool autoplay - { - get - { - return _autoplay; - } - set - { - if (!isWebGLPlayer) - { - ht["autoplay"] = value; - } - else { - WXInnerAudioContextSetBool(instanceId, "autoplay", value); - } - - _autoplay = value; - } - - } - - /// - /// 音频资源的地址,用于直接播放。可以设置为网络地址,或者unity中的本地路径如 Assets/xx.wav,运行时会自动和配置的音频地址前缀做拼接得到最终线上地址 - /// - public string src - { - get - { - return _src; - } - set - { - if (!isWebGLPlayer) - { - ht["src"] = value; - } - else { - WXInnerAudioContextSetString(instanceId, "src", value); - } - - _src = value; - } - } - - /// - /// 开始播放的位置(单位:s),默认为 0 - /// - public float startTime - { - get - { - return _startTime; - } - set - { - if (!isWebGLPlayer) - { - ht["startTime"] = value; - } - else { - WXInnerAudioContextSetFloat(instanceId, "startTime", value); - } - _startTime = value; - } - } - - /// - /// 是否循环播放,默认为 false - /// - public bool loop - { - get - { - return _loop; - } - set - { - if (!isWebGLPlayer) - { - ht["loop"] = value; - } - else { - WXInnerAudioContextSetBool(instanceId, "loop", value); - } - - _loop = value; - } - - } - - /// - /// 音量。范围 0~1。默认为 1 - /// - public float volume - { - get - { - return _volume; - } - set - { - if (!isWebGLPlayer) - { - ht["volume"] = value; - } - else { - if (!isWaiting) { - isWaiting = true; - WXSDKManagerHandler.Instance.StartCoroutine(DoSetVolume()); - } - - } - _oldVolume = value; - _volume = value; - } - } - - IEnumerator DoSetVolume() - { - //这里unity音频音量设置太频繁,延迟0.5秒后再执行 - yield return new WaitForSeconds(0.5f); - WXInnerAudioContextSetFloat(instanceId, "volume", _volume); - isWaiting = false; - } - - /// - /// 静音,静音时将音量设置为 0,取消静音则恢复原来的音量 - /// - public bool mute - { - get - { - return _volume == 0; - } - set - { - if (!isWebGLPlayer) - { - ht["volume"] = value ? 0 : _oldVolume; - } - else - { - WXInnerAudioContextSetFloat(instanceId, "volume", value ? 0 : _oldVolume); - } - - _volume = value ? 0 : _oldVolume; - - } - } - - - /// - /// 播放速度。范围 0.5-2.0,默认为 1。(Android 需要 6 及以上版本) - /// - public float playbackRate - { - get - { - return _playbackRate; - } - set - { - if (!isWebGLPlayer) - { - ht["playbackRate"] = value; - } - else { - WXInnerAudioContextSetFloat(instanceId, "playbackRate", value); - } - - _playbackRate = value; - } - } - - /// - /// 当前音频的长度(单位 s)。只有在当前有合法的 src 时返回(只读) - /// - public float duration - { - get - { - if (!isWebGLPlayer) { - var v = ht["duration"]; - if (v == null) - { - v = 0f; - } - return (float)v; - } - return WXInnerAudioContextGetFloat(instanceId, "duration"); - } - } - - /// - /// 当前音频的播放位置(单位 s)。只有在当前有合法的 src 时返回,时间保留小数点后 6 位(只读) - /// - public float currentTime - { - get - { - if (!isWebGLPlayer) - { - var v = ht["currentTime"]; - if (v == null) - { - v = 0f; - } - return (float)v; - } - return WXInnerAudioContextGetFloat(instanceId, "currentTime"); - } - } - - /// - /// 当前音频的播放位置(单位 s)。只有在当前有合法的 src 时返回,时间保留小数点后 6 位(只读) - /// - public float buffered - { - get - { - if(!isWebGLPlayer) - { - var v = ht["buffered"]; - if (v == null) - { - v = 0f; - } - return (float)v; - } - return WXInnerAudioContextGetFloat(instanceId, "buffered"); - } - } - - /// - /// 当前是是否暂停或停止状态(只读) - /// - public bool paused - { - get - { - if (!isWebGLPlayer) { - var v = ht["paused"]; - if (v == null) - { - v = false; - } - return (bool)v; - } - - return WXInnerAudioContextGetBool(instanceId, "paused"); - } - } - - - public bool isPlaying - { - get - { - return _isPlaying; - } - } - - /// - /// 播放 - /// - public void Play() - { - if (isWebGLPlayer) - { - if (!isWaitingPlay) - { - isWaitingPlay = true; - WXSDKManagerHandler.Instance.StartCoroutine(DoPlay()); - } - return; - } - - - Debug.Log(_src + " 音频播放了,这里就不真的播放了。"); - ht["paused"] = false; - _HandleCallBack("onPlay"); - - } - - IEnumerator DoPlay() - { - //这里unity音频调用太频繁,延迟0.1秒后再执行 - yield return new WaitForSeconds(0.1f); - WXInnerAudioContextPlay(instanceId); - isWaitingPlay = false; - } - - /// - /// 暂停。暂停后的音频再播放会从暂停处开始播放 - /// - public void Pause() - { - if (isWebGLPlayer) - { - if (!isWaitingPause) - { - isWaitingPause = true; - WXSDKManagerHandler.Instance.StartCoroutine(DoPause()); - } - return; - } - Debug.Log(_src + " 音频暂停了"); - ht["paused"] = true; - _HandleCallBack("onPause"); - } - - IEnumerator DoPause() - { - //这里unity音频调用太频繁,延迟0.1秒后再执行 - yield return new WaitForSeconds(0.1f); - WXInnerAudioContextPause(instanceId); - isWaitingPause = false; - } - - /// - /// 停止。停止后的音频再播放会从头开始播放。 - /// - public void Stop() - { - if (isWebGLPlayer) - { - if (!isWaitingStop) - { - isWaitingStop = true; - WXSDKManagerHandler.Instance.StartCoroutine(DoStop()); - } - return; - } - Debug.Log(_src + " 音频停止了"); - ht["paused"] = false; - _HandleCallBack("onStop"); - - } - - IEnumerator DoStop() - { - //这里unity音频调用太频繁,延迟0.1秒后再执行 - yield return new WaitForSeconds(0.1f); - WXInnerAudioContextStop(instanceId); - isWaitingStop = false; - } - - /// - /// 跳转到指定位置 - /// - public void Seek(float position) - { - if (isWebGLPlayer) - { - WXInnerAudioContextSeek(instanceId, position); - return; - } - Debug.Log(_src + " 音频跳转播放"); - } - - /// - /// 销毁当前实例 - /// - public void Destroy() - { - if (isWebGLPlayer) - { - WXInnerAudioContextDestroy(instanceId); - } - else { - Debug.Log(_src + " 音频销毁!"); - } - Dict.Remove(instanceId); - } - - /// - /// 监听音频进入可以播放状态的事件。但不保证后面可以流畅播放 - /// - public void OnCanplay(Action action) - { - - if (_onCanplay == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextAddListener(instanceId, "onCanplay"); - } - - } - _onCanplay += action; - } - - /// - /// 监听音频进入可以播放状态的事件。但不保证后面可以流畅播放,action 为空表示移除全部事件监听 - /// - public void OffCanplay(Action action = null) - { - if (action == null) - { - _onCanplay = null; - } - else - { - _onCanplay -= action; - } - if (_onCanplay == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offCanplay"); - } - } - - } - - /// - /// 监听音频播放事件 - /// - public void OnPlay(Action action) - { - - if (_onPlay == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextAddListener(instanceId, "onPlay"); - } - } - _onPlay += action; - } - - /// - /// 取消监听音频播放事件,action 为空表示移除全部事件监听 - /// - public void OffPlay(Action action = null) - { - if (action == null) - { - _onPlay = null; - } - else - { - _onPlay -= action; - } - if (_onPlay == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offPlay"); - } - } - - } - - /// - /// 监听音频暂停事件 - /// - public void OnPause(Action action) - { - - if (_onPause == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextAddListener(instanceId, "onPause"); - } - } - _onPause += action; - } - - /// - /// 取消监听音频暂停事件,action 为空表示移除全部事件监听 - /// - public void OffPause(Action action = null) - { - if (action == null) - { - _onPause = null; - } - else - { - _onPause -= action; - } - if (_onPause == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offPause"); - } - } - } - - /// - /// 监听音频暂停事件 - /// - public void OnStop(Action action) - { - - if (_onStop == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextAddListener(instanceId, "onStop"); - } - - } - _onStop += action; - } - - /// - /// 取消监听音频暂停事件,action 为空表示移除全部事件监听 - /// - public void OffStop(Action action = null) - { - if (action == null) - { - _onStop = null; - } - else - { - _onStop -= action; - } - if (_onStop == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offStop"); - } - } - } - - /// - /// 监听音频自然播放至结束的事件 - /// - public void OnEnded(Action action) - { - - if (_onEnded == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextAddListener(instanceId, "onEnded"); - } - - } - _onEnded += action; - } - - /// - /// 取消监听音频自然播放至结束的事件,action 为空表示移除全部事件监听 - /// - public void OffEnded(Action action = null) - { - if (action == null) - { - _onEnded = null; - } - else - { - _onEnded -= action; - } - if (_onEnded == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offEnded"); - } - - } - } - - /// - /// 监听音频播放进度更新事件 - /// - public void OnTimeUpdate(Action action) - { - - if (_onTimeUpdate == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextAddListener(instanceId, "onTimeUpdate"); - } - - } - _onTimeUpdate += action; - } - - /// - /// 取消监听音频播放进度更新事件,action 为空表示移除全部事件监听 - /// - public void OffTimeUpdate(Action action = null) - { - if (action == null) - { - _onTimeUpdate = null; - } - else - { - _onTimeUpdate -= action; - } - if (_onTimeUpdate == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextRemoveListener(instanceId, "offTimeUpdate"); - } - - } - } - - /// - /// 监听音频播放错误事件 - /// - public void OnError(Action action) - { - - if (_onError == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextAddListener(instanceId, "onError"); - } - - } - _onError += action; - } - - /// - /// 取消监听音频播放错误事件,action 为空表示移除全部事件监听 - /// - public void OffError(Action action = null) - { - if (action == null) - { - _onError = null; - } - else - { - _onError -= action; - } - if (_onError == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextRemoveListener(instanceId, "offError"); - } - } - } - - /// - /// 监听音频加载中事件。当音频因为数据不足,需要停下来加载时会触发 - /// - public void OnWaiting(Action action) - { - - if (_onWaiting == null) - { - if (isWebGLPlayer) { - WXInnerAudioContextAddListener(instanceId, "onWaiting"); - } - - } - _onWaiting += action; - } - - /// - /// 取消监听音频加载中事件,action 为空表示移除全部事件监听 - /// - public void OffWaiting(Action action = null) - { - if (action == null) - { - _onWaiting = null; - } - else - { - _onWaiting -= action; - } - if (_onWaiting == null) - { - if (isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offWaiting"); - } - - } - } - - /// - /// 监听音频进行跳转操作的事件 - /// - public void OnSeeking(Action action) - { - - if (_onSeeking == null && isWebGLPlayer) - { - WXInnerAudioContextAddListener(instanceId, "onSeeking"); - } - _onSeeking += action; - } - - /// - /// 取消监听音频进行跳转操作的事件,action 为空表示移除全部事件监听 - /// - public void OffSeeking(Action action = null) - { - if (action == null) - { - _onSeeking = null; - } - else - { - _onSeeking -= action; - } - if (_onSeeking == null && isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offSeeking"); - } - } - - /// - /// 监听音频完成跳转操作的事件 - /// - public void OnSeeked(Action action) - { - - if (_onSeeked == null && isWebGLPlayer) - { - WXInnerAudioContextAddListener(instanceId, "onSeeked"); - } - _onSeeked += action; - } - - /// - /// 取消监听音频完成跳转操作的事件,action 为空表示移除全部事件监听 - /// - public void OffSeeked(Action action = null) - { - if (action == null) - { - _onSeeked = null; - } - else - { - _onSeeked -= action; - } - if (_onSeeked == null && isWebGLPlayer) - { - WXInnerAudioContextRemoveListener(instanceId, "offSeeked"); - } - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXInnerAudioContext.cs.meta b/Assets/WX-WASM-SDK/WXInnerAudioContext.cs.meta deleted file mode 100644 index c8dbc956..00000000 --- a/Assets/WX-WASM-SDK/WXInnerAudioContext.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e83617872f0f3a04292670d884951772 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXInterstitialAd.cs b/Assets/WX-WASM-SDK/WXInterstitialAd.cs deleted file mode 100644 index 2270e9a4..00000000 --- a/Assets/WX-WASM-SDK/WXInterstitialAd.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -namespace WeChatWASM -{ - //插屏广告组件广告,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/interstitialAd-ad.html - public class WXInterstitialAd : WXBaseAd, IWXADCloseable - { - public WXInterstitialAd(string id) : base(id) - { - - } - public Action onCloseAction; - - /// - /// 加载插屏广告 - /// - public void Load(Action success = null, Action failed = null) - { - WXSDKManagerHandler.Instance.ADLoad(instanceId, WXCallBackHandler.Add(success), WXCallBackHandler.Add(failed)); - } - - /// - /// 监听插屏广告关闭事件 - /// - /// 插屏广告关闭事件的回调函数 - public void OnClose(Action action) - { - onCloseAction += action; - } - - /// - /// 取消监听插屏广告关闭事件 - /// - /// 插屏广告关闭事件的回调函数 - public void OffClose(Action action) - { - onCloseAction -= action; - } - - public void OnCloseCallback() - { - onCloseAction?.Invoke(); - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/WXInterstitialAd.cs.meta b/Assets/WX-WASM-SDK/WXInterstitialAd.cs.meta deleted file mode 100644 index f7a775b9..00000000 --- a/Assets/WX-WASM-SDK/WXInterstitialAd.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 87078ec8a0a1af74a9cbffc2ff96ba4e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXLaunchProgress.cs b/Assets/WX-WASM-SDK/WXLaunchProgress.cs deleted file mode 100644 index 967968a8..00000000 --- a/Assets/WX-WASM-SDK/WXLaunchProgress.cs +++ /dev/null @@ -1,27 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using System; - -namespace WeChatWASM { - public class LaunchProgressParams { - public string callbackId; - public string res; - } - public class WXLaunchEventListener { -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXOnLaunchProgress(); - - public Action OnLaunchProgressAction; - public static Dictionary Dict = new Dictionary(); - - public WXLaunchEventListener(Action action) { - var id = WXOnLaunchProgress(); - Dict.Add(id, this); - OnLaunchProgressAction+=action; - } - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/WXLaunchProgress.cs.meta b/Assets/WX-WASM-SDK/WXLaunchProgress.cs.meta deleted file mode 100644 index 68f2fdf8..00000000 --- a/Assets/WX-WASM-SDK/WXLaunchProgress.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0ddd9cb5544e546fe95bda9b16ccbd89 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXLongCallBackHandler.cs b/Assets/WX-WASM-SDK/WXLongCallBackHandler.cs deleted file mode 100644 index 3e13c3f4..00000000 --- a/Assets/WX-WASM-SDK/WXLongCallBackHandler.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; - -namespace WeChatWASM -{ - - /// - /// 长时间才返回的用这个 - /// - class WXLongCallBackHandler - { - - //用于暂存回调 - private static readonly Hashtable responseHT = new Hashtable(); - - - //用于作为回调id的一部分 - private static int htCounter = 0; - - - private static int GenarateCallbackId() - { - if (htCounter > 10000000) - { - htCounter = 0; - } - htCounter++; - - return htCounter; - } - - - public static string Add(Action callback) where T : WXBaseResponse - { - if(callback == null) - { - return ""; - } - int id = GenarateCallbackId(); - TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); - var timestamp = Convert.ToInt64(ts.TotalSeconds); - var key = timestamp.ToString() + '-' + id; - responseHT.Add(key,callback); - return key; - } - - - public static void InvokeResponseCallback(string str) where T : WXBaseResponse - { - if (str != null) - { - T res = JsonUtility.FromJson(str); - - var id = res.callbackId; - - if (responseHT[id] != null) - { - var callback = (Action)responseHT[id]; - callback(res); - responseHT.Remove(id); - } - } - } - - - } - - -} diff --git a/Assets/WX-WASM-SDK/WXLongCallBackHandler.cs.meta b/Assets/WX-WASM-SDK/WXLongCallBackHandler.cs.meta deleted file mode 100644 index 99466848..00000000 --- a/Assets/WX-WASM-SDK/WXLongCallBackHandler.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5655c9241cf9544dc832cd5d9e1f72c1 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXModel.cs b/Assets/WX-WASM-SDK/WXModel.cs deleted file mode 100644 index 516aaf83..00000000 --- a/Assets/WX-WASM-SDK/WXModel.cs +++ /dev/null @@ -1,1257 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace WeChatWASM -{ - public class WXBaseResponse - { - public string callbackId; //回调id,调用者不需要关注 - public string errMsg; //失败示例 getUserInfo:fail auth deny; 成功示例 getUserInfo:ok - } - - public class WXBaseActionParam - { - public Action success; //接口调用成功的回调函数 - public Action fail; //接口调用失败的回调函数 - public Action complete; //接口调用结束的回调函数(调用成功、失败都会执行) - } - - - - public class WXTextResponse : WXBaseResponse - { - public int errCode; - } - - public class WXReadFileResponse : WXBaseResponse - { - /// - /// 如果返回二进制,则数据在这个字段 - /// - public byte[] binData; - /// - /// 如果返回的是字符串,则数据在这个字段 - /// - public string stringData; - } - - public class WXUserInfoResponse : WXBaseResponse - { - // 具体说明可以参考 https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/wx.getUserInfo.html - public int errCode; // 0为成功,非零为失败 - public string signature; //使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html - public string encryptedData; //包括敏感数据在内的完整用户信息的加密数据,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#%E5%8A%A0%E5%AF%86%E6%95%B0%E6%8D%AE%E8%A7%A3%E5%AF%86%E7%AE%97%E6%B3%95 - public string iv; //加密算法的初始向量,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#%E5%8A%A0%E5%AF%86%E6%95%B0%E6%8D%AE%E8%A7%A3%E5%AF%86%E7%AE%97%E6%B3%95 - public string cloudID; //敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见云调用直接获取开放数据 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud - public WXUserInfo userInfo; //用户信息对象,不包含 openid 等敏感信息 - public string userInfoRaw; //userinfo的序列化 - - } - - public class WXShareInfoResponse : WXBaseResponse - { - // 具体说明可以参考 https://developers.weixin.qq.com/minigame/dev/api/share/wx.getShareInfo.html - public string encryptedData; - public string iv; - public string cloudID; - } - - public class WXAuthPrivateMessageResponse : WXBaseResponse - { - - public string encryptedData; - public string iv; - public bool valid; - } - - public class WXADErrorResponse : WXBaseResponse - { - // 具体说明可以参考 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.onError.html - public int errCode; - } - public class WXADLoadResponse : WXBaseResponse - { - // 具体说明可以参考 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.onLoad.html - public int rewardValue; - public int shareValue; - } - - public class WXADResizeResponse : WXBaseResponse - { - // 具体说明可以参考 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.onResize.html - public int width; - public int height; - } - - public class WXRewardedVideoAdOnCloseResponse : WXBaseResponse - { - /// - /// 视频是否是在用户完整观看的情况下被关闭的,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/RewardedVideoAd.onClose.html - /// - public bool isEnded; - } - - public class RequestAdReportShareBehaviorParam - { - public int operation; // 1-曝光 2-点击 3-关闭 4-操作成功 5-操作失败 6-分享拉起 - public int currentShow; // 0-广告 1-分享,当 operation 为 1-5 时必填 - public int strategy; // 0-业务 1-微信策略 - public string inviteUser; // 当 operation 为 6 时必填,填写分享人的 openId - public string inviteUserAdunit; // 当 operation 为 6 时必填,填写分享人分享时的广告单元 - public int shareValue; // 分享推荐值,必填 - public int rewardValue; // 激励广告推荐值,必填 - } - - public class WXRewardedVideoAdReportShareBehaviorResponse : WXBaseResponse { - public string success; - public string message; - } - - /// - /// 小游戏回到前台的事件的回调函数里返回的数据,详见 https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html - /// - public class WXOnShowResponse - { - public string scene; - /// - /// JS版里的query对象序列化成的JSON字符串 - /// - public string queryRaw; - public string shareTicket; - public ReferrerInfo referrerInfo; - /// - /// 该字段没用 - /// - public string referrerInfoRaw; - } - - /// - /// 云函数回调 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html - /// - public class WXCloudCallFunctionResponse : WXBaseResponse { - /// - /// 后端返回的经过json序列化后的数据 - /// - public string result; - public string requestID; - } - - - public struct ReferrerInfo - { - public string appid; - /// - /// 对应JS版里的 extraData,这里序列化成JSON字符串 - /// - public string extraDataRaw; - } - - - public struct WXUserInfo - { - /// - /// 详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/UserInfo.html - /// - public string nickName; - public string avatarUrl; - public string country; - public string province; - public string city; - public string language; - public int gender; - } - - - public struct WXSafeArea - { - public int left; - public int right; - public int top; - public int bottom; - public int width; - public int height; - } - - public class WXAccountInfo : WXBaseResponse - { - public WXAccountInfoMiniProgram miniProgram; - public string miniProgramRaw; - public WXAccountInfoPlugin plugin; - public string pluginRaw; - } - - - public struct WXAccountInfoMiniProgram - { - public string appId; - public string envVersion; - } - - public struct WXAccountInfoPlugin - { - public string appId; - public string version; - } - - /// - /// 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.updateShareMenu.html - /// - public class WXUpdateShareMenuParam : WXBaseActionParam - { - - public bool withShareTicket; - public bool isUpdatableMessage; - public string activityId; - public string toDoActivityId; - public bool isPrivateMessage; - public TemplateInfo templateInfo; - /// - /// // 该字段不需要传 - /// - public string[] templateInfoRaw; - } - - - public class TemplateInfo - { - public TemplateInfoItem[] parameterList; - } - - public class TemplateInfoItem - { - public string name; - public string value; - } - - - public class WXShowShareMenuParam : WXBaseActionParam - { - // 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.showShareMenu.html - public bool withShareTicket; - public string[] menus; - } - - public class WXHideShareMenuParam : WXBaseActionParam - { - // 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.hideShareMenu.html - public string[] menus; - } - - public class WXShareAppMessageParam - { - // 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.shareAppMessage.html - public string title; - public string imageUrl; - public string query; - public string imageUrlId; - public bool toCurrentGroup; - public string path; - } - - public class WXShareTimelineParam - { - // 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.onShareTimeline.html - public string title; - public string imageUrl; - public string query; - public string path; - } - - public class WXAddToFavoritesParam - { - // 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.onAddToFavorites.html - public string title; - public string imageUrl; - public string query; - public bool disableForward; - } - - - public class WXGetShareInfoParam : WXBaseActionParam - { - // 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.getShareInfo.html - public string shareTicket; - public int timeout; - } - - public class WXAuthPrivateMessageParam : WXBaseActionParam - { - // 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/share/wx.authPrivateMessage.html - public string shareTicket; - } - - /// - /// 创建 banner 广告组件参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createBannerAd.html - /// - public class WXCreateBannerAdParam - { - public string adUnitId; - public int adIntervals; - public Style style; - public string styleRaw; //该字段不需要传 - } - - /// - /// 创建激励视频广告组件参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createRewardedVideoAd.html - /// - public class WXCreateRewardedVideoAdParam - { - public string adUnitId; - public bool multiton; - } - - /// - /// 创建插屏广告组件参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createInterstitialAd.html - /// - public class WXCreateInterstitialAdParam - { - public string adUnitId; - } - - /// - /// 创建格子广告参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createGridAd.html - /// - public class WXCreateGridAdParam - { - public string adUnitId; - public int adIntervals; - public string adTheme; - public int gridCount; - public Style style; - public string styleRaw; //该字段不需要传 - } - - /// - /// 创建原生模板广告参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createCustomAd.html - /// - public class WXCreateCustomAdParam - { - public string adUnitId; - public int adIntervals; - public CustomStyle style; - public string styleRaw; //该字段不需要传 - } - - public struct Style - { - public int left; - public int top; - public int width; - public int height; - } - - /// - /// 原生模板广告组件的样式 - /// - public struct CustomStyle - { - /// - /// 原生模板广告组件的左上角横坐标 - /// - public int left; - /// - /// 原生模板广告组件的左上角纵坐标 - /// - public int top; - /// - /// 原生模板广告组件是否固定屏幕位置(不跟随屏幕滚动), 相当于JS api里的 fixed - /// - public bool isFixed; - } - - /// - /// 将当前 Canvas 保存为一个临时文件的同步版本,详见 https://developers.weixin.qq.com/minigame/dev/api/render/canvas/Canvas.toTempFilePathSync.html - /// - public class WXToTempFilePathSyncParam - { - public int x; - public int y; - public int width; - public int height; - public int destWidth; - public int destHeight; - public string fileType = "png"; - public float quality = 1.0f; - } - - [Preserve] - public class ToTempFilePathParamSuccessCallbackResult : WXBaseResponse { - /// - /// canvas 生成的临时文件路径 (本地路径) - /// - public string tempFilePath; - } - - /// - /// 将当前 Canvas 保存为一个临时文件的异步版本,详见 https://developers.weixin.qq.com/minigame/dev/api/render/canvas/Canvas.toTempFilePath.html - /// - - public class WXToTempFilePathParam : WXToTempFilePathSyncParam - { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - - /// - /// 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/ui/keyboard/wx.updateKeyboard.html - /// - public class WXUpdateKeyboardParam : WXBaseActionParam - { - public string value; - } - - /// - /// 各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/ui/keyboard/wx.showKeyboard.html - /// - public class WXShowKeyboardParam : WXBaseActionParam - { - public string defaultValue; - public int maxLength; - public bool multiple; - public bool confirmHold; - public string confirmType; - - } - - /// - /// 对用户托管数据进行写数据操作。允许同时写多组 KV 数据。详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.setUserCloudStorage.html - /// - public class SetUserCloudStorageParam : WXBaseActionParam - { - public KVData[] KVDataList; - } - - - /// - /// 删除用户托管数据当中对应 key 的数据。详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.removeUserCloudStorage.html - /// - public class RemoveUserCloudStorageParam : WXBaseActionParam - { - - public string[] keyList; - } - - /// - /// https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.access.html - /// - public class AccessParam : WXBaseActionParam - { - public string path; - } - - /// - /// https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.unlink.html - /// - public class UnlinkParam : WXBaseActionParam - { - public string filePath; - } - - /// - /// https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.mkdir.html - /// - public class MkdirParam : WXBaseActionParam - { - /// - /// 创建的目录路径 (本地路径) - /// - public string dirPath; - /// - /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 - /// - public bool recursive = false; - } - - /// - /// https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.copyFile.html - /// - public class CopyFileParam : WXBaseActionParam - { - public string srcPath; - public string destPath; - } - - [Preserve] - public class TouchEvent - { - /// - /// 当前所有触摸点的列表 - /// - public Touch[] touches; - /// - /// 触发此次事件的触摸点列表,可以通过这个知道触发当前通知的事件的位置 - /// - public Touch[] changedTouches; - /// - /// 事件触发时的时间戳 - /// - public long timeStamp; - } - - - /// - /// 调用云函数 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html - /// - public class CallFunctionParam : WXBaseActionParam - { - public string name; - /// - /// 这里请将数据json序列化为字符串再赋值到data - /// - public string data; - public CallFunctionConf config; - } - - public class CallFunctionConf - { - public string env; - } - - /// - /// 云函数初始化 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html - /// - public class CallFunctionInitParam - { - /// - /// 必填,环境ID,指定接下来调用 API 时访问哪个环境的云资源 - /// - public string env; - /// - /// 是否在将用户访问记录到用户管理中,在控制台中可见 - /// - public bool traceUser; - } - - public class InnerAudioContextParam - { - /// - /// 音频资源的地址,用于直接播放。可以设置为网络地址,或者unity中的本地路径如 Assets/xx.wav,运行时会自动和配置的音频地址前缀做拼接得到最终线上地址 - /// - public string src = ""; - /// - /// 是否循环播放,默认为 false - /// - public bool loop = false; - /// - /// 开始播放的位置(单位:s),默认为 0 - /// - public float startTime = 0; - /// - /// 是否自动开始播放,默认为 false - /// - public bool autoplay = false; - /// - /// 音量。范围 0~1。默认为 1 - /// - public float volume = 1; - /// - /// 播放速度。范围 0.5-2.0,默认为 1。 - /// - public float playbackRate = 1; - /// - /// 下载音频,设置为true后,会完全下载后再触发OnCanplay,方便后续音频复用,避免延迟 - /// - public bool needDownload = false; - } - - /// - /// 发起米大师支付参数,详见 https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasPayment.html - /// - public class RequestMidasPaymentParam : WXBaseActionParam - { - /// - /// 支付的类型,不同的支付类型有各自额外要传的附加参数。 - /// - public string mode = ""; - /// - /// 环境配置 - /// - public int env = 0; - /// - /// 在米大师侧申请的应用 id - /// - public string offerId = ""; - /// - /// 币种 - /// - public string currencyType = ""; - /// - /// 申请接入时的平台,platform 与应用id有关 - /// - public string platform = ""; - /// - /// 购买数量。mode=game 时必填。购买数量。 - /// - public int buyQuantity = 0; - /// - /// 分区 ID - /// - public string zoneId = "1"; - } - - /// - /// 发起米大师朋友礼物索要参数,详见 https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasFriendPayment.html - /// - public class RequestMidasFriendPaymentParam : WXBaseActionParam - { - /// - /// 支付的类型,不同的支付类型有各自额外要传的附加参数。 - /// - public string mode = ""; - /// - /// 环境配置 - /// - public int env = 0; - /// - /// 在米大师侧申请的应用 id - /// - public string offerId = ""; - /// - /// 币种 - /// - public string currencyType = ""; - /// - /// 申请接入时的平台,platform 与应用id有关 - /// - public string platform = ""; - /// - /// 购买数量。mode=game 时必填。购买数量。 - /// - public int buyQuantity = 0; - /// - /// 分区 ID - /// - public string zoneId = "1"; - /// - /// 开发者业务订单号,每个订单号只能使用一次,重复使用会失败。要求32个字符内,只能是数字、大小写字母、符号 _-|*@ - /// - public string outTradeNo = ""; - /// - /// 随机字符串,长度应小于 128 - /// - public string nonceStr = ""; - /// - /// 生成这个随机字符串的 UNIX 时间戳(精确到秒) - /// - public int timeStamp; - /// - /// 签名 - /// - public string signature = ""; - - } - - /// - /// 网络状态变化事件的回调参数,详见 https://developers.weixin.qq.com/minigame/dev/api/device/network/wx.onNetworkStatusChange.html - /// - public class NetworkStatus { - /// - /// 当前是否有网络连接 - /// - public bool isConnected; - /// - /// 网络类型 - /// - public string networkType; - } - - public class GetNetworkTypeResponse : WXBaseResponse - { - /// - /// 网络类型 - /// - public string networkType; - /// - /// 信号强弱,单位 dbm - /// - public int signalStrength; - } - - public class GetNetworkTypeParam : WXBaseActionParam { - - } - - - public class SetKeepScreenOnParam : WXBaseActionParam - { - /// - /// 是否保持屏幕常亮 - /// - public bool keepScreenOn; - } - - public class WriteFileParam : WXBaseActionParam - { - /// - /// 要写入的文件路径 (本地路径) - /// - public string filePath; - /// - /// 要写入的二进制数据 - /// - public byte[] data; - /// - /// 指定写入文件的字符编码 - /// - public string encoding = "utf8"; - - } - - public class WriteFileStringParam : WXBaseActionParam - { - /// - /// 要写入的文件路径 (本地路径) - /// - public string filePath; - /// - /// 要写入的二进制数据 - /// - public string data; - /// - /// 指定写入文件的字符编码 - /// - public string encoding = "utf8"; - - } - - - - public class ReadFileParam : WXBaseActionParam - { - /// - /// 要读取的文件的路径 (本地路径) - /// - public string filePath; - /// - /// 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - /// - public string encoding; - } - - public class WXReadFileCallback : WXTextResponse - { - public string data; - public int byteLength; - } - - - public class CustomerServiceConversationParam : WXBaseActionParam - { - /// - /// 会话来源 - /// - public string sessionFrom; - /// - /// 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息 - /// - public bool showMessageCard; - /// - /// 会话内消息卡片标题 - /// - public string sendMessageTitle; - /// - /// 会话内消息卡片路径 - /// - public string sendMessagePath; - /// - /// 会话内消息卡片图片路径 - /// - public string sendMessageImg; - } - - - public class WXVideoCallback : WXTextResponse - { - /// - /// 当前的播放位置,单位为秒 - /// - public float position; - /// - /// 视频的总时长,单位为秒 - /// - public float duration; - /// - /// 当前的缓冲进度,缓冲进度区间为 (0~100],100表示缓冲完成 - /// - public int buffered; - } - - public class WXVideoProgress - { - /// - /// 视频的总时长,单位为秒 - /// - public float duration; - /// - /// 当前的缓冲进度,缓冲进度区间为 (0~100],100表示缓冲完成 - /// - public int buffered; - } - - public class WXVideoTimeUpdate - { - /// - /// 当前的播放位置,单位为秒 - /// - public float position; - /// - /// 视频的总时长,单位为秒 - /// - public float duration; - } - - - //创建视频,详见 https://developers.weixin.qq.com/minigame/dev/api/media/video/wx.createVideo.html - public class WXCreateVideoParam - { - /// - /// 视频的左上角横坐标 - /// - public int x=0; - /// - /// 视频的左上角纵坐标 - /// - public int y=0; - /// - /// 视频的宽度 - /// - public int width=300; - /// - /// 视频的高度 - /// - public int height=100; - /// - /// 视频的资源地址 - /// - public string src; - /// - /// 视频的封面 - /// - public string poster; - /// - /// 视频的初始播放位置,单位为 s 秒 - /// - public int initialTime; - /// - /// 视频的播放速率,有效值有 0.5、0.8、1.0、1.25、1.5 - /// - public float playbackRate=1.0f; - /// - /// 视频是否为直播 - /// - public bool live; - /// - /// 视频的缩放模式 - /// - public string objectFit= "contain"; - /// - /// 视频是否显示控件 - /// - public bool controls = true; - /// - /// 是否显示视频底部进度条 - /// - public bool showProgress = true; - /// - /// 是否显示控制栏的进度条 - /// - public bool showProgressInControlMode = true; - /// - /// 视频背景颜色 - /// - public string backgroundColor ="#000000"; - /// - /// 视频是否自动播放 - /// - public bool autoplay; - /// - /// 视频是否是否循环播放 - /// - public bool loop; - /// - /// 视频是否禁音播放 - /// - public bool muted; - /// - /// 视频是否遵循系统静音开关设置(仅iOS) - /// - public bool obeyMuteSwitch; - /// - /// 是否启用手势控制播放进度 - /// - public bool enableProgressGesture = true; - /// - /// 是否开启双击播放的手势 - /// - public bool enablePlayGesture; - /// - /// 是否显示视频中央的播放按钮 - /// - public bool showCenterPlayBtn = true; - /// - /// 视频是否显示在游戏画布之下 - /// - public bool underGameView; - } - - - public class WXClipboardParam : WXBaseActionParam - { - public string data; - } - - public class WXClipboardResponse : WXTextResponse - { - public string data; - } - - public enum WXToastIcon { - /// - /// 显示成功图标,此时 title 文本最多显示 7 个汉字长度 - /// - success, - /// - /// 显示失败图标,此时 title 文本最多显示 7 个汉字长度 - /// - error, - /// - /// 显示加载图标,此时 title 文本最多显示 7 个汉字长度 - /// - loading, - /// - /// 不显示图标,此时 title 文本最多可显示两行 - /// - none - } - - public class WXShowToastParam : WXBaseActionParam - { - /// - /// 提示的内容 - /// - public string title; - /// - /// 图标 - /// - public WXToastIcon icon = WXToastIcon.success; - /// - /// 提示的延迟时间 - /// - public int duration = 1500; - /// - /// 是否显示透明蒙层,防止触摸穿透 - /// - public bool mask = false; - - } - - public class WXModalResponse : WXTextResponse - { - /// - /// editable 为 true 时,用户输入的文本 - /// - public string content; - /// - /// 为 true 时,表示用户点击了确定按钮 - /// - public bool confirm; - /// - /// 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) - /// - public bool cancel; - } - - public class WXShowModalParam : WXBaseActionParam - { - /// - /// 提示的内容 - /// - public string title; - /// - /// 提示的内容 - /// - public string content; - /// - /// 是否显示取消按钮 - /// - public bool showCancel = true; - /// - /// 取消按钮的文字,最多 4 个字符 - /// - public string cancelText = "取消"; - /// - /// 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 - /// - public string cancelColor = "#000000"; - /// - /// 确认按钮的文字,最多 4 个字符 - /// - public string confirmText = "确定"; - /// - /// 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 - /// - public string confirmColor = "#576B95"; - /// - /// 是否显示输入框 - /// - public bool editable = false; - /// - /// 显示输入框时的提示文本 - /// - public string placeholderText; - } - - public class WXShowLoadingParam : WXBaseActionParam - { - /// - /// 提示的内容 - /// - public string title; - /// - /// 是否显示透明蒙层,防止触摸穿透 - /// - public bool mask = false; - - } - - public enum EnvVersion { - /// - /// 开发版 - /// - develop, - /// - /// 体验版 - /// - trial, - /// - /// 正式版 - /// - release - } - - /// - /// 跳转小程序参数,https://developers.weixin.qq.com/minigame/dev/api/navigate/wx.navigateToMiniProgram.html - /// - public class WXNavigateToMiniProgramParam : WXBaseActionParam - { - /// - /// 必填,要打开的小程序 appId - /// - public string appId; - /// - /// 打开的页面路径,如果为空则打开首页。 - /// - public string path; - /// - /// 需要传递给目标小程序的数据 - /// - public object extraData; - public string extraDataRaw; // 该字段不需要传值 - /// - /// 要打开的小程序版本,默认release - /// - public EnvVersion envVersion = EnvVersion.release; - /// - /// 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。 - /// - public string shortLink; - } - - public enum GameClubButtonType - { - /// - /// 可以设置背景色和文本的按钮 - /// - text, - /// - /// 只能设置背景贴图的按钮,背景贴图会直接拉伸到按钮的宽高 - /// - image - } - public enum GameClubButtonTextAlign - { - /// - /// 居左 - /// - left, - /// - /// 居中 - /// - center, - /// - /// 居右 - /// - right, - } - public struct GameClubButtonStyle - { - public int left; - public int top; - public int width; - public int height; - public string backgroundColor; - public string borderColor; - public int borderWidth; - public int borderRadius; - public string color; - public GameClubButtonTextAlign textAlign; - public int fontSize; - public int lineHeight; - } - public enum GameClubButtonIcon - { - green, - white, - dark, - light, - } - /// - /// 创建游戏圈参数,详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/game-club/wx.createGameClubButton.html - /// - public class WXCreateGameClubButtonParam - { - /// - /// 必填,按钮类型 - /// - public GameClubButtonType type; - /// - /// 按钮上的文本,仅当 type 为 text 时有效 - /// - public string text; - /// - /// 按钮的背景图片,仅当 type 为 image 时有效 - /// - public string image; - /// - /// 必填,按钮的样式 - /// - public GameClubButtonStyle style; - public string styleRaw; - /// - /// 必填,游戏圈按钮的图标,仅当 object.type 参数为 image 时有效。 - /// - public GameClubButtonIcon icon; - } - - public class WXRequestSubscribeSystemMessageResponse : WXTextResponse - { - /// - /// 系统订阅消息类型,值为"accept"、"reject"、"ban","accept", "" 表示用户同意订阅该类型对应的模板消息,"reject"表示用户拒绝订阅该类型对应的模板消息,"ban"表示已被后台封禁, ""表示没有调用该类型请求。例如 { errMsg: "requestSubscribeSystemMessage:ok", SYS_MSG_TYPE_INTERACTIVE: "accept" } 表示用户同意订阅'SYS_MSG_TYPE_INTERACTIVE'这条消息 - /// - public string SYS_MSG_TYPE_INTERACTIVE; - public string SYS_MSG_TYPE_RANK; - } - - /// - /// state 值包括'accept'、'reject'、'ban'、'filter'。'accept'表示用户同意订阅该条id对应的模板消息,'reject'表示用户拒绝订阅该条id对应的模板消息,'ban'表示已被后台封禁,'filter'表示该模板因为模板标题同名被后台过滤。例如 { TemplateId: "zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE", state : "accept"} 表示用户同意订阅zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE这条消息 - /// - public class WXSubscribeMessageItem { - public string TemplateId; - public string state; - } - - public class WXRequestSubscribeMessageResponse : WXTextResponse - { - /// - /// 跟官网返回格式不一样,以这里为准 - /// - public WXSubscribeMessageItem[] resItems; - } - - public class WXRequestSubscribeSystemMessageParam : WXBaseActionParam - { - public string[] msgTypeList; - - } - /// - /// 清理文件缓存的结果 - /// - public enum ReleaseResult { - /// - /// 无需清理,空间足够 - /// - noNeedRelease = 1, - /// - /// 超过最大存储容量,不清理 - /// - exceedMax, - /// - /// 清理成功 - /// - releaseSuccess, - } - /// - /// 启动数据 - /// - public class LaunchEvent - { - public LaunchEventType type; - /// - /// 当前阶段耗时 - /// - public int costTimeMs; - /// - /// 自插件启动后总运行时间 - /// - public int runTimeMs; - /// - /// 是否需要下载资源包 - /// - public bool needDownloadDataPackage; - /// - /// 首包资源是否作为小游戏代码分包下载 - /// - public bool loadDataPackageFromSubpackage; - /// - /// 当前阶段完成时是否处于前台 - /// - public bool isVisible; - /// - /// 是否开启了代码分包 - /// - public bool useCodeSplit; - /// - /// 是否iOS高性能模式 - /// - public bool isHighPerformance; - } - /// - /// 启动阶段类型定义 - /// - public enum LaunchEventType { - /// - /// 插件启动 - /// - launchPlugin, - /// - /// 下载wasm代码 - /// - loadWasm, - /// - /// 编译wasm - /// - compileWasm, - /// - /// 下载首包资源 - /// - loadAssets, - /// - /// 读取首包资源 - /// - readAssets = 5, - /// - /// 引擎初始化(callmain) - /// - prepareGame, - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/WXModel.cs.meta b/Assets/WX-WASM-SDK/WXModel.cs.meta deleted file mode 100644 index dd60501c..00000000 --- a/Assets/WX-WASM-SDK/WXModel.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5484a07007432af43a563a8879ef4625 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXModels.cs b/Assets/WX-WASM-SDK/WXModels.cs deleted file mode 100644 index ba003cff..00000000 --- a/Assets/WX-WASM-SDK/WXModels.cs +++ /dev/null @@ -1,5613 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine.Scripting; -namespace WeChatWASM -{ - [Preserve] - public class WXJSCallback - { - public string callbackId; - public string type; - public string res; - } - - [Preserve] - public class AccountInfo { - /// - /// 小程序帐号信息 - /// - public MiniProgram miniProgram; - /// - /// 插件帐号信息(仅在插件中调用时包含这一项) - /// - public Plugin plugin; - } - [Preserve] - public class MiniProgram { - /// - /// 小程序 appId - /// - public string appId; - /// - /// 需要基础库: `2.10.0` - /// 小程序版本 - /// 可选值: - /// - 'develop': 开发版; - /// - 'trial': 体验版; - /// - 'release': 正式版; - /// - public string envVersion; - /// - /// 需要基础库: `2.10.2` - /// 线上小程序版本号 - /// - public string version; - } - [Preserve] - public class Plugin { - /// - /// 插件 appId - /// - public string appId; - /// - /// 插件版本号 - /// - public string version; - } - [Preserve] - public class GetBatteryInfoSyncResult { - /// - /// 是否正在充电中 - /// - public bool isCharging; - /// - /// 设备电量,范围 1 - 100 - /// - public double level; - } - [Preserve] - public class EnterOptionsGame { - /// - /// 启动小游戏的 query 参数 - /// - public Dictionary query; - /// - /// 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) - /// - public EnterOptionsGameReferrerInfo referrerInfo; - /// - /// 启动小游戏的[场景值](https://developers.weixin.qq.com/minigame/dev/guide/framework/scene.html) - /// - public double scene; - /// - /// 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 - /// 可选值: - /// - 1: 微信联系人单聊; - /// - 2: 企业微信联系人单聊; - /// - 3: 普通微信群聊; - /// - 4: 企业微信互通群聊; - /// - public double chatType; - /// - /// shareTicket,详见[获取更多转发信息](#) - /// - public string shareTicket; - } - [Preserve] - public class EnterOptionsGameReferrerInfo { - /// - /// 来源小程序、公众号或 App 的 appId - /// - public string appId; - /// - /// 来源小程序传过来的数据,scene=1037或1038时支持 - /// - public Dictionary extraData; - /// - /// 从小游戏直播间里的挂件入口打开小游戏时,开发者可从启动参数中获取当前直播的直播间Id和直播者openId* - /// - public GameLiveInfo gameLiveInfo; - } - [Preserve] - public class GameLiveInfo { - /// - /// 直播者 openId - /// - public string streamerOpenId; - /// - /// 直播间 id - /// - public string feedId; - } - [Preserve] - public class LaunchOptionsGame { - /// - /// 启动小游戏的 query 参数 - /// - public Dictionary query; - /// - /// 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) - /// - public EnterOptionsGameReferrerInfo referrerInfo; - /// - /// 启动小游戏的[场景值](https://developers.weixin.qq.com/minigame/dev/devtools/interface/scene.html) - /// - public double scene; - /// - /// 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 - /// 可选值: - /// - 1: 微信联系人单聊; - /// - 2: 企业微信联系人单聊; - /// - 3: 普通微信群聊; - /// - 4: 企业微信互通群聊; - /// - public double chatType; - /// - /// shareTicket,详见[获取更多转发信息](#) - /// - public string shareTicket; - } - [Preserve] - public class ClientRect { - /// - /// 下边界坐标,单位:px - /// - public double bottom; - /// - /// 高度,单位:px - /// - public double height; - /// - /// 左边界坐标,单位:px - /// - public double left; - /// - /// 右边界坐标,单位:px - /// - public double right; - /// - /// 上边界坐标,单位:px - /// - public double top; - /// - /// 宽度,单位:px - /// - public double width; - } - [Preserve] - public class GetStorageInfoSyncOption { - /// - /// 当前占用的空间大小, 单位 KB - /// - public double currentSize; - /// - /// 当前 storage 中所有的 key - /// - public string[] keys; - /// - /// 限制的空间大小,单位 KB - /// - public double limitSize; - } - [Preserve] - public class SystemInfo { - /// - /// 需要基础库: `1.1.0` - /// 客户端基础库版本 - /// - public string SDKVersion; - /// - /// 需要基础库: `2.6.0` - /// 允许微信使用相册的开关(仅 iOS 有效) - /// - public bool albumAuthorized; - /// - /// 需要基础库: `1.8.0` - /// 设备性能等级(仅 Android)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) - /// - public double benchmarkLevel; - /// - /// 需要基础库: `2.6.0` - /// 蓝牙的系统开关 - /// - public bool bluetoothEnabled; - /// - /// 需要基础库: `1.5.0` - /// 设备品牌 - /// - public string brand; - /// - /// 需要基础库: `2.6.0` - /// 允许微信使用摄像头的开关 - /// - public bool cameraAuthorized; - /// - /// 设备方向 - /// 可选值: - /// - 'portrait': 竖屏; - /// - 'landscape': 横屏; - /// - public string deviceOrientation; - /// - /// 需要基础库: `2.15.0` - /// 是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。 - /// - public bool enableDebug; - /// - /// 需要基础库: `1.5.0` - /// 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 - /// - public double fontSizeSetting; - /// - /// 需要基础库: `2.12.3` - /// 当前小程序运行的宿主环境 - /// - public Host host; - /// - /// 微信设置的语言 - /// - public string language; - /// - /// 需要基础库: `2.6.0` - /// 允许微信使用定位的开关 - /// - public bool locationAuthorized; - /// - /// 需要基础库: `2.6.0` - /// 地理位置的系统开关 - /// - public bool locationEnabled; - /// - /// `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 - /// - public bool locationReducedAccuracy; - /// - /// 需要基础库: `2.6.0` - /// 允许微信使用麦克风的开关 - /// - public bool microphoneAuthorized; - /// - /// 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 - /// - public string model; - /// - /// 需要基础库: `2.6.0` - /// 允许微信通知带有提醒的开关(仅 iOS 有效) - /// - public bool notificationAlertAuthorized; - /// - /// 需要基础库: `2.6.0` - /// 允许微信通知的开关 - /// - public bool notificationAuthorized; - /// - /// 需要基础库: `2.6.0` - /// 允许微信通知带有标记的开关(仅 iOS 有效) - /// - public bool notificationBadgeAuthorized; - /// - /// 需要基础库: `2.6.0` - /// 允许微信通知带有声音的开关(仅 iOS 有效) - /// - public bool notificationSoundAuthorized; - /// - /// 需要基础库: `2.19.3` - /// 允许微信使用日历的开关 - /// - public bool phoneCalendarAuthorized; - /// - /// 设备像素比 - /// - public double pixelRatio; - /// - /// 客户端平台 - /// - public string platform; - /// - /// 需要基础库: `2.7.0` - /// 在竖屏正方向下的安全区域 - /// - public SafeArea safeArea; - /// - /// 需要基础库: `1.1.0` - /// 屏幕高度,单位px - /// - public double screenHeight; - /// - /// 需要基础库: `1.1.0` - /// 屏幕宽度,单位px - /// - public double screenWidth; - /// - /// 需要基础库: `1.9.0` - /// 状态栏的高度,单位px - /// - public double statusBarHeight; - /// - /// 操作系统及版本 - /// - public string system; - /// - /// 微信版本号 - /// - public string version; - /// - /// 需要基础库: `2.6.0` - /// Wi-Fi 的系统开关 - /// - public bool wifiEnabled; - /// - /// 可使用窗口高度,单位px - /// - public double windowHeight; - /// - /// 可使用窗口宽度,单位px - /// - public double windowWidth; - /// - /// 需要基础库: `2.11.0` - /// 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) - /// 可选值: - /// - 'dark': 深色主题; - /// - 'light': 浅色主题; - /// - public string theme; - } - [Preserve] - public class Host { - /// - /// 宿主 app 对应的 appId - /// - public string appId; - } - [Preserve] - public class SafeArea { - /// - /// 安全区域右下角纵坐标 - /// - public double bottom; - /// - /// 安全区域的高度,单位逻辑像素 - /// - public double height; - /// - /// 安全区域左上角横坐标 - /// - public double left; - /// - /// 安全区域右下角横坐标 - /// - public double right; - /// - /// 安全区域左上角纵坐标 - /// - public double top; - /// - /// 安全区域的宽度,单位逻辑像素 - /// - public double width; - } - [Preserve] - public class OnCheckForUpdateCallbackResult { - /// - /// 是否有新版本 - /// - public bool hasUpdate; - } - [Preserve] - public class GeneralCallbackResult { - /// - /// 错误信息 - /// - public string errMsg; - } - [Preserve] - public class SetMessageToFriendQueryOption { - /// - /// 需要传递的代表场景的数字,需要在 0 - 50 之间 - /// - public double shareMessageToFriendScene; - } - [Preserve] - public class GetTextLineHeightOption { - /// - /// 字体名称 - /// - public string fontFamily; - /// - /// 文本的内容 - /// - public string text; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 字号 - /// - public double fontSize; - /// - /// 字体样式 - /// 可选值: - /// - 'normal': 正常; - /// - 'italic': 斜体; - /// - public string fontStyle; - /// - /// 字重 - /// 可选值: - /// - 'normal': 正常; - /// - 'bold': 粗体; - /// - public string fontWeight; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class AddCardOption { - /// - /// 需要添加的卡券列表 - /// - public AddCardRequestInfo[] cardList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class AddCardRequestInfo { - /// - /// 卡券的扩展参数。需将 CardExt 对象 JSON 序列化为**字符串**传入 - /// - public string cardExt; - /// - /// 卡券 ID - /// - public string cardId; - } - [Preserve] - public class AddCardSuccessCallbackResult { - /// - /// 卡券添加结果列表 - /// - public AddCardResponseInfo[] cardList; - - public string errMsg; - } - [Preserve] - public class AddCardResponseInfo { - /// - /// 卡券的扩展参数,结构请参考下文 - /// - public string cardExt; - /// - /// 用户领取到卡券的 ID - /// - public string cardId; - /// - /// 加密 code,为用户领取到卡券的code加密后的字符串,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) - /// - public string code; - /// - /// 是否成功 - /// - public bool isSuccess; - } - [Preserve] - public class AuthPrivateMessageOption { - /// - /// shareTicket。可以从 wx.onShow 中获取。详情 [shareTicket](#) - /// - public string shareTicket; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class AuthPrivateMessageSuccessCallbackResult { - /// - /// 经过加密的activityId,解密后可得到原始的activityId。若解密后得到的activityId可以与开发者后台的活动id对应上则验证通过,否则表明valid字段不可靠(被篡改) 详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) - /// - public string encryptedData; - /// - /// 错误信息 - /// - public string errMsg; - /// - /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - /// - public string iv; - /// - /// 验证是否通过 - /// - public bool valid; - } - [Preserve] - public class AuthorizeOption { - /// - /// 需要获取权限的 scope,详见 [scope 列表](https://developers.weixin.qq.com/minigame/dev/guide/framework/authorize.html#scope-列表) - /// - public string scope; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CheckHandoffEnabledOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CheckHandoffEnabledSuccessCallbackResult { - /// - /// 错误码,0未知,1用户取消,2电脑未登录,3电脑版本过低,4暂未支持 - /// - public double errCode; - /// - /// 是否可以进行接力 - /// - public bool isEnabled; - - public string errMsg; - } - [Preserve] - public class CheckIsUserAdvisedToRestOption { - /// - /// 今天已经玩游戏的时间,单位:秒 - /// - public double todayPlayedTime; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CheckIsUserAdvisedToRestSuccessCallbackResult { - /// - /// 是否建议用户休息 - /// - public bool result; - - public string errMsg; - } - [Preserve] - public class CheckSessionOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ChooseImageOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 最多可以选择的图片张数 - /// - public double count; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 所选的图片的尺寸 - /// 可选值: - /// - 'original': 原图; - /// - 'compressed': 压缩图; - /// - public Array sizeType; - /// - /// 选择图片的来源 - /// 可选值: - /// - 'album': 从相册选图; - /// - 'camera': 使用相机; - /// - public Array sourceType; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ChooseImageSuccessCallbackResult { - /// - /// 图片的本地临时文件路径列表 (本地路径) - /// - public string[] tempFilePaths; - /// - /// 需要基础库: `1.2.0` - /// 图片的本地临时文件列表 - /// - public ImageFile[] tempFiles; - - public string errMsg; - } - [Preserve] - public class ImageFile { - /// - /// 本地临时文件路径 (本地路径) - /// - public string path; - /// - /// 本地临时文件大小,单位 B - /// - public double size; - } - [Preserve] - public class CloseBLEConnectionOption { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class BluetoothError { - /// - /// 错误信息 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | 0 | ok | 正常 | - /// | -1 | already connect | 已连接 | - /// | 10000 | not init | 未初始化蓝牙适配器 | - /// | 10001 | not available | 当前蓝牙适配器不可用 | - /// | 10002 | no device | 没有找到指定设备 | - /// | 10003 | connection fail | 连接失败 | - /// | 10004 | no service | 没有找到指定服务 | - /// | 10005 | no characteristic | 没有找到指定特征 | - /// | 10006 | no connection | 当前连接已断开 | - /// | 10007 | property not support | 当前特征不支持此操作 | - /// | 10008 | system error | 其余所有系统上报的异常 | - /// | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | - /// | 10012 | operate time out | 连接超时 | - /// | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | - /// - public string errMsg; - /// - /// 错误码 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | 0 | ok | 正常 | - /// | -1 | already connect | 已连接 | - /// | 10000 | not init | 未初始化蓝牙适配器 | - /// | 10001 | not available | 当前蓝牙适配器不可用 | - /// | 10002 | no device | 没有找到指定设备 | - /// | 10003 | connection fail | 连接失败 | - /// | 10004 | no service | 没有找到指定服务 | - /// | 10005 | no characteristic | 没有找到指定特征 | - /// | 10006 | no connection | 当前连接已断开 | - /// | 10007 | property not support | 当前特征不支持此操作 | - /// | 10008 | system error | 其余所有系统上报的异常 | - /// | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | - /// | 10012 | operate time out | 连接超时 | - /// | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | - /// - public double errCode; - } - [Preserve] - public class CloseBluetoothAdapterOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CloseSocketOption { - /// - /// 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 - /// - public double code; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 - /// - public string reason; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CreateBLEConnectionOption { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 超时时间,单位 ms,不填表示不会超时 - /// - public double timeout; - } - [Preserve] - public class CreateBLEPeripheralServerOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CreateBLEPeripheralServerSuccessCallbackResult { - /// - /// [BLEPeripheralServer](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.html) - /// 外围设备的服务端。 - /// - public BLEPeripheralServer server; - - public string errMsg; - } - [Preserve] - public class BLEPeripheralServer { - /// - /// [BLEPeripheralServer.addService(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.addService.html) - /// 需要基础库: `2.10.3` - /// 添加服务。 - /// - public void addService(AddServiceOption option){} - /// - /// [BLEPeripheralServer.offCharacteristicReadRequest(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicReadRequest.html) - /// 需要基础库: `2.10.3` - /// 取消监听已连接的设备请求读当前外围设备的特征值事件 - /// - public void offCharacteristicReadRequest(Action callback){} - /// - /// [BLEPeripheralServer.offCharacteristicSubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicSubscribed.html) - /// 需要基础库: `2.13.0` - /// 取消监听特征订阅事件 - /// - public void offCharacteristicSubscribed(Action callback){} - /// - /// [BLEPeripheralServer.offCharacteristicUnsubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicUnsubscribed.html) - /// 需要基础库: `2.13.0` - /// 取消监听取消特征订阅事件 - /// - public void offCharacteristicUnsubscribed(Action callback){} - /// - /// [BLEPeripheralServer.offCharacteristicWriteRequest(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicWriteRequest.html) - /// 需要基础库: `2.10.3` - /// 取消监听已连接的设备请求写当前外围设备的特征值事件 - /// - public void offCharacteristicWriteRequest(Action callback){} - /// - /// [BLEPeripheralServer.onCharacteristicReadRequest(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicReadRequest.html) - /// 需要基础库: `2.10.3` - /// 监听已连接的设备请求读当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 - /// - public void onCharacteristicReadRequest(Action callback){} - /// - /// [BLEPeripheralServer.onCharacteristicSubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicSubscribed.html) - /// 需要基础库: `2.13.0` - /// 监听特征订阅事件,仅 iOS 支持。 - /// - public void onCharacteristicSubscribed(Action callback){} - /// - /// [BLEPeripheralServer.onCharacteristicUnsubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicUnsubscribed.html) - /// 需要基础库: `2.13.0` - /// 监听取消特征订阅事件,仅 iOS 支持。 - /// - public void onCharacteristicUnsubscribed(Action callback){} - /// - /// [BLEPeripheralServer.onCharacteristicWriteRequest(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicWriteRequest.html) - /// 需要基础库: `2.10.3` - /// 监听已连接的设备请求写当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 - /// - public void onCharacteristicWriteRequest(Action callback){} - /// - /// [BLEPeripheralServer.removeService(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.removeService.html) - /// 需要基础库: `2.10.3` - /// 移除服务。 - /// - public void removeService(RemoveServiceOption option){} - /// - /// [BLEPeripheralServer.startAdvertising(Object Object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.startAdvertising.html) - /// 需要基础库: `2.10.3` - /// 开始广播本地创建的外围设备。 - /// **注意** - /// - Android 8.0.9 开始,支持直接使用 16/32/128 位 UUID; - /// - Android 8.0.9 以下版本只支持 128 位 UUID,使用 16/32 位的 UUID 时需要进行补位(系统会自动识别是否属于预分配区间),可以参考[蓝牙指南](#); - /// - iOS 必须直接使用 16 位的 UUID,不能补位到 128 位,否则系统组包时仍会按照 128 位传输。iOS 暂不支持 32 位 UUID。 - /// - iOS 同时只能发起一个广播,安卓支持同时发起多个广播。 - /// - 传 beacon 参数时,不能同时传入 deviceName,serviceUuids,manufacturerData 参数。 - /// - public void startAdvertising(StartAdvertisingObject Object){} - /// - /// [BLEPeripheralServer.stopAdvertising(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.stopAdvertising.html) - /// 需要基础库: `2.10.3` - /// 停止广播。 - /// - public void stopAdvertising(StopAdvertisingOption option){} - /// - /// [BLEPeripheralServer.writeCharacteristicValue(Object Object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) - /// 需要基础库: `2.10.3` - /// 往指定特征写入二进制数据值,并通知已连接的主机,从机的特征值已发生变化,该接口会处理是走回包还是走订阅。 - /// - public void writeCharacteristicValue(WriteCharacteristicValueObject Object){} - } - [Preserve] - public class AddServiceOption { - /// - /// 描述service的Object - /// - public BLEPeripheralService service; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class BLEPeripheralService { - /// - /// characteristics列表 - /// - public Characteristic[] characteristics; - /// - /// 蓝牙服务的 UUID - /// - public string uuid; - } - [Preserve] - public class Characteristic { - /// - /// characteristic 的 UUID - /// - public string uuid; - /// - /// 描述符数据 - /// - public Descriptor[] descriptors; - /// - /// 特征权限 - /// - public CharacteristicPermission permission; - /// - /// 特征支持的操作 - /// - public CharacteristicProperties properties; - /// - /// 特征对应的二进制值 - /// - public byte[] value; - } - [Preserve] - public class Descriptor { - /// - /// Descriptor 的 UUID - /// - public string uuid; - /// - /// 描述符的权限 - /// - public DescriptorPermission permission; - /// - /// 描述符数据 - /// - public byte[] value; - } - [Preserve] - public class DescriptorPermission { - /// - /// 读 - /// - public bool read; - /// - /// 写 - /// - public bool write; - } - [Preserve] - public class CharacteristicPermission { - /// - /// 加密读请求 - /// - public bool readEncryptionRequired; - /// - /// 可读 - /// - public bool readable; - /// - /// 加密写请求 - /// - public bool writeEncryptionRequired; - /// - /// 可写 - /// - public bool writeable; - } - [Preserve] - public class CharacteristicProperties { - /// - /// 回包 - /// - public bool indicate; - /// - /// 订阅 - /// - public bool notify; - /// - /// 读 - /// - public bool read; - /// - /// 写 - /// - public bool write; - /// - /// 无回复写 - /// - public bool writeNoResponse; - } - [Preserve] - public class OnCharacteristicReadRequestCallbackResult { - /// - /// 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 - /// - public double callbackId; - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - } - [Preserve] - public class OnCharacteristicSubscribedCallbackResult { - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - } - [Preserve] - public class OnCharacteristicWriteRequestCallbackResult { - /// - /// 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 - /// - public double callbackId; - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - /// - /// 请求写入特征的二进制数据值 - /// - public byte[] value; - } - [Preserve] - public class RemoveServiceOption { - /// - /// service 的 UUID - /// - public string serviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartAdvertisingObject { - /// - /// 广播自定义参数 - /// - public AdvertiseReqObj advertiseRequest; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 广播功率 - /// 可选值: - /// - 'low': 功率低; - /// - 'medium': 功率适中; - /// - 'high': 功率高; - /// - public string powerLevel; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class AdvertiseReqObj { - /// - /// 需要基础库: `2.20.1` - /// 以 beacon 设备形式广播的参数。 - /// - public BeaconInfoObj beacon; - /// - /// 当前设备是否可连接 - /// - public bool connectable; - /// - /// 广播中 deviceName 字段,默认为空 - /// - public string deviceName; - /// - /// 广播的制造商信息。仅安卓支持,iOS 因系统限制无法定制。 - /// - public ManufacturerData[] manufacturerData; - /// - /// 要广播的服务 UUID 列表。使用 16/32 位 UUID 时请参考注意事项。 - /// - public string[] serviceUuids; - } - [Preserve] - public class BeaconInfoObj { - /// - /// Beacon 设备的主 ID - /// - public double major; - /// - /// Beacon 设备的次 ID - /// - public double minor; - /// - /// Beacon 设备广播的 UUID - /// - public string uuid; - /// - /// 用于判断距离设备 1 米时 RSSI 大小的参考值 - /// - public double measuredPower; - } - [Preserve] - public class ManufacturerData { - /// - /// 制造商ID,0x 开头的十六进制 - /// - public string manufacturerId; - /// - /// 制造商信息 - /// - public byte[] manufacturerSpecificData; - } - [Preserve] - public class StopAdvertisingOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class WriteCharacteristicValueObject { - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 是否需要通知主机 value 已更新 - /// - public bool needNotify; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - /// - /// characteristic 对应的二进制值 - /// - public byte[] value; - /// - /// 可选,处理回包时使用 - /// - public double callbackId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ExitMiniProgramOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ExitVoIPChatOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class FaceDetectOption { - /// - /// 图像像素点数据,每四项表示一个像素点的 RGBA - /// - public byte[] frameBuffer; - /// - /// 图像高度 - /// - public double height; - /// - /// 图像宽度 - /// - public double width; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 是否返回当前图像的人脸角度信息 - /// - public bool enableAngle; - /// - /// 是否返回当前图像的人脸的置信度(可表示器官遮挡情况) - /// - public bool enableConf; - /// - /// 是否返回多张人脸的信息 - /// - public bool enableMultiFace; - /// - /// 是否返回当前图像的人脸(106 个点) - /// - public bool enablePoint; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class FaceDetectSuccessCallbackResult { - /// - /// 人脸角度信息,取值范围 [-1, 1],数值越接近 0 表示越正对摄像头 - /// - public FaceAngel angleArray; - /// - /// 人脸置信度,取值范围 [0, 1],数值越大置信度越高(遮挡越少) - /// - public FaceConf confArray; - /// - /// 脸部正方框数值,对象包含 height, weight, originX, originY 四个属性 - /// - public Dictionary detectRect; - /// - /// 多人模式(enableMultiFace)下的人脸信息,每个对象包含上述其它属性 - /// - public Dictionary faceInfo; - /// - /// 人脸 106 个点位置数组,数组每个对象包含 x 和 y - /// - public Dictionary pointArray; - /// - /// 脸部中心点横坐标,检测不到人脸则为 -1 - /// - public double x; - /// - /// 脸部中心点纵坐标,检测不到人脸则为 -1 - /// - public double y; - - public string errMsg; - } - [Preserve] - public class FaceAngel { - /// - /// 仰俯角(点头) - /// - public double pitch; - /// - /// 翻滚角(左右倾) - /// - public double roll; - /// - /// 偏航角(摇头) - /// - public double yaw; - } - [Preserve] - public class FaceConf { - /// - /// 整体可信度 - /// - public double global; - /// - /// 左眼可信度 - /// - public double leftEye; - /// - /// 嘴巴可信度 - /// - public double mouth; - /// - /// 鼻子可信度 - /// - public double nose; - /// - /// 右眼可信度 - /// - public double rightEye; - } - [Preserve] - public class GetAvailableAudioSourcesOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetAvailableAudioSourcesSuccessCallbackResult { - /// - /// 支持的音频输入源列表,可在 [RecorderManager.start()](https://developers.weixin.qq.com/minigame/dev/api/media/recorder/RecorderManager.start.html) 接口中使用。返回值定义参考 https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource - /// 可选值: - /// - 'auto': 自动设置,默认使用手机麦克风,插上耳麦后自动切换使用耳机麦克风,所有平台适用; - /// - 'buildInMic': 手机麦克风,仅限 iOS; - /// - 'headsetMic': 耳机麦克风,仅限 iOS; - /// - 'mic': 麦克风(没插耳麦时是手机麦克风,插耳麦时是耳机麦克风),仅限 Android; - /// - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; - /// - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; - /// - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; - /// - public Array audioSources; - - public string errMsg; - } - [Preserve] - public class GetBLEDeviceCharacteristicsOption { - /// - /// 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 - /// - public string deviceId; - /// - /// 蓝牙服务 UUID。需要先调用 [wx.getBLEDeviceServices](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.getBLEDeviceServices.html) 获取 - /// - public string serviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetBLEDeviceCharacteristicsSuccessCallbackResult { - /// - /// 设备特征列表 - /// - public BLECharacteristic[] characteristics; - - public string errMsg; - } - [Preserve] - public class BLECharacteristic { - /// - /// 该特征支持的操作类型 - /// - public BLECharacteristicProperties properties; - /// - /// 蓝牙设备特征的 UUID - /// - public string uuid; - } - [Preserve] - public class BLECharacteristicProperties { - /// - /// 该特征是否支持 indicate 操作 - /// - public bool indicate; - /// - /// 该特征是否支持 notify 操作 - /// - public bool notify; - /// - /// 该特征是否支持 read 操作 - /// - public bool read; - /// - /// 该特征是否支持 write 操作 - /// - public bool write; - } - [Preserve] - public class GetBLEDeviceRSSIOption { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetBLEDeviceRSSISuccessCallbackResult { - /// - /// 信号强度,单位 dBm - /// - public double RSSI; - - public string errMsg; - } - [Preserve] - public class GetBLEDeviceServicesOption { - /// - /// 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 - /// - public string deviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetBLEDeviceServicesSuccessCallbackResult { - /// - /// 设备服务列表 - /// - public BLEService[] services; - - public string errMsg; - } - [Preserve] - public class BLEService { - /// - /// 该服务是否为主服务 - /// - public bool isPrimary; - /// - /// 蓝牙设备服务的 UUID - /// - public string uuid; - } - [Preserve] - public class GetBLEMTUOption { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 写模式 (iOS 特有参数) - /// 可选值: - /// - 'write': 有回复写; - /// - 'writeNoResponse': 无回复写; - /// - public string writeType; - } - [Preserve] - public class GetBLEMTUSuccessCallbackResult { - /// - /// 最大传输单元 - /// - public double mtu; - - public string errMsg; - } - [Preserve] - public class GetBatteryInfoOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetBatteryInfoSuccessCallbackResult { - /// - /// 是否正在充电中 - /// - public bool isCharging; - /// - /// 设备电量,范围 1 - 100 - /// - public double level; - - public string errMsg; - } - [Preserve] - public class GetBeaconsOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class BeaconError { - /// - /// 错误信息 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | 0 | ok | 正常 | - /// | 11000 | unsupport | 系统或设备不支持 | - /// | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | - /// | 11002 | location service unavailable | 位置服务不可用 | - /// | 11003 | already start | 已经开始搜索 | - /// | 11004 | not startBeaconDiscovery | 还未开始搜索 | - /// | 11005 | system error | 系统错误 | - /// | 11006 | invalid data | 参数不正确 | - /// - public string errMsg; - /// - /// 错误码 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | 0 | ok | 正常 | - /// | 11000 | unsupport | 系统或设备不支持 | - /// | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | - /// | 11002 | location service unavailable | 位置服务不可用 | - /// | 11003 | already start | 已经开始搜索 | - /// | 11004 | not startBeaconDiscovery | 还未开始搜索 | - /// | 11005 | system error | 系统错误 | - /// | 11006 | invalid data | 参数不正确 | - /// - public double errCode; - } - [Preserve] - public class GetBeaconsSuccessCallbackResult { - /// - /// Beacon 设备列表 - /// - public BeaconInfo[] beacons; - - public string errMsg; - } - [Preserve] - public class BeaconInfo { - /// - /// Beacon 设备的距离,单位 m。iOS 上,proximity 为 0 时,accuracy 为 -1。 - /// - public double accuracy; - /// - /// Beacon 设备的主 ID - /// - public double major; - /// - /// Beacon 设备的次 ID - /// - public double minor; - /// - /// 表示设备距离的枚举值(仅iOS) - /// 可选值: - /// - 0: 信号太弱不足以计算距离,或非 iOS 设备; - /// - 1: 十分近; - /// - 2: 比较近; - /// - 3: 远; - /// - public double proximity; - /// - /// 表示设备的信号强度,单位 dBm - /// - public double rssi; - /// - /// Beacon 设备广播的 UUID - /// - public string uuid; - } - [Preserve] - public class GetBluetoothAdapterStateOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetBluetoothAdapterStateSuccessCallbackResult { - /// - /// 蓝牙适配器是否可用 - /// - public bool available; - /// - /// 是否正在搜索设备 - /// - public bool discovering; - - public string errMsg; - } - [Preserve] - public class GetBluetoothDevicesOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetBluetoothDevicesSuccessCallbackResult { - /// - /// UUID 对应的已连接设备列表 - /// - public BlueToothDevice[] devices; - - public string errMsg; - } - [Preserve] - public class BlueToothDevice { - /// - /// 当前蓝牙设备的信号强度,单位 dBm - /// - public double RSSI; - /// - /// 当前蓝牙设备的广播数据段中的 ManufacturerData 数据段。 - /// - public byte[] advertisData; - /// - /// 当前蓝牙设备的广播数据段中的 ServiceUUIDs 数据段 - /// - public string[] advertisServiceUUIDs; - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 当前蓝牙设备的广播数据段中的 LocalName 数据段 - /// - public string localName; - /// - /// 蓝牙设备名称,某些设备可能没有 - /// - public string name; - /// - /// 当前蓝牙设备的广播数据段中的 ServiceData 数据段 - /// - public Dictionary serviceData; - } - [Preserve] - public class GetChannelsLiveInfoOption { - /// - /// 视频号 id,以“sph”开头的id,可在视频号助手获取 - /// - public string finderUserName; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetChannelsLiveInfoSuccessCallbackResult { - /// - /// 直播主题 - /// - public string description; - /// - /// 直播 feedId - /// - public string feedId; - /// - /// 视频号头像 - /// - public string headUrl; - /// - /// 视频号昵称 - /// - public string nickname; - /// - /// 直播 nonceId - /// - public string nonceId; - /// - /// 直播状态,2直播中,3直播结束 - /// - public double status; - - public string errMsg; - } - [Preserve] - public class GetChannelsLiveNoticeInfoOption { - /// - /// 视频号 id,以“sph”开头的id,可在视频号助手获取 - /// - public string finderUserName; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetChannelsLiveNoticeInfoSuccessCallbackResult { - /// - /// 直播封面 - /// - public string headUrl; - /// - /// 视频号昵称 - /// - public string nickname; - /// - /// 预告 id - /// - public string noticeId; - /// - /// 是否可预约 - /// - public bool reservable; - /// - /// 开始时间 - /// - public string startTime; - /// - /// 预告状态:0可用 1取消 2已用 - /// - public double status; - - public string errMsg; - } - [Preserve] - public class GetClipboardDataOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetClipboardDataSuccessCallbackOption { - /// - /// 剪贴板的内容 - /// - public string data; - } - [Preserve] - public class GetConnectedBluetoothDevicesOption { - /// - /// 蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID) - /// - public string[] services; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetConnectedBluetoothDevicesSuccessCallbackResult { - /// - /// 搜索到的设备列表 - /// - public BluetoothDeviceInfo[] devices; - - public string errMsg; - } - [Preserve] - public class BluetoothDeviceInfo { - /// - /// 用于区分设备的 id - /// - public string deviceId; - /// - /// 蓝牙设备名称,某些设备可能没有 - /// - public string name; - } - [Preserve] - public class GetExtConfigOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetExtConfigSuccessCallbackResult { - /// - /// 第三方平台自定义的数据 - /// - public Dictionary extConfig; - - public string errMsg; - } - [Preserve] - public class WxGetFileInfoOption { - /// - /// 本地文件路径 (本地路径) - /// - public string filePath; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 计算文件摘要的算法 - /// 可选值: - /// - 'md5': md5 算法; - /// - 'sha1': sha1 算法; - /// - public string digestAlgorithm; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class WxGetFileInfoSuccessCallbackResult { - /// - /// 按照传入的 digestAlgorithm 计算得出的的文件摘要 - /// - public string digest; - /// - /// 文件大小,以字节为单位 - /// - public double size; - - public string errMsg; - } - [Preserve] - public class GetFriendCloudStorageOption { - /// - /// 要拉取的 key 列表 - /// - public string[] keyList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetFriendCloudStorageSuccessCallbackResult { - /// - /// 同玩好友的托管数据 - /// - public UserGameData[] data; - - public string errMsg; - } - [Preserve] - public class UserGameData { - /// - /// 用户的托管 KV 数据列表 - /// - public KVData[] KVDataList; - /// - /// 用户的微信头像 url - /// - public string avatarUrl; - /// - /// 用户的微信昵称 - /// - public string nickname; - /// - /// 用户的 openid - /// - public string openid; - } - [Preserve] - public class KVData { - /// - /// 数据的 key - /// - public string key; - /// - /// 数据的 value - /// - public string value; - } - [Preserve] - public class GetGroupCloudStorageOption { - /// - /// 要拉取的 key 列表 - /// - public string[] keyList; - /// - /// 群分享对应的 shareTicket - /// - public string shareTicket; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetGroupCloudStorageSuccessCallbackResult { - /// - /// 群同玩成员的托管数据 - /// - public UserGameData[] data; - - public string errMsg; - } - [Preserve] - public class GetGroupEnterInfoOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetGroupEnterInfoSuccessCallbackResult { - /// - /// 需要基础库: `2.7.0` - /// 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - /// - public string cloudID; - /// - /// 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - /// - public string encryptedData; - /// - /// 错误信息 - /// - public string errMsg; - /// - /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - /// - public string iv; - } - [Preserve] - public class GetGroupInfoOption { - /// - /// 群 openGId,可通过 `wx.getShareInfo` 获取 - /// - public string openGId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetGroupInfoSuccessCallbackResult { - /// - /// 群名称 - /// - public string name; - - public string errMsg; - } - [Preserve] - public class GetLocalIPAddressOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetLocalIPAddressSuccessCallbackResult { - /// - /// 错误信息 - /// - public string errMsg; - /// - /// 本机局域网IP地址 - /// - public string localip; - } - [Preserve] - public class GetLocationOption { - /// - /// 需要基础库: `1.6.0` - /// 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 - /// - public bool altitude; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.9.0` - /// 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 - /// - public double highAccuracyExpireTime; - /// - /// 需要基础库: `2.9.0` - /// 开启高精度定位 - /// - public bool isHighAccuracy; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 - /// - public string type; - } - [Preserve] - public class GetLocationSuccessCallbackResult { - /// - /// 位置的精确度,反应与真实位置之间的接近程度,可以理解成10即与真实位置相差10m,越小越精确 - /// - public double accuracy; - /// - /// 需要基础库: `1.2.0` - /// 高度,单位 m - /// - public double altitude; - /// - /// 需要基础库: `1.2.0` - /// 水平精度,单位 m - /// - public double horizontalAccuracy; - /// - /// 纬度,范围为 -90~90,负数表示南纬 - /// - public double latitude; - /// - /// 经度,范围为 -180~180,负数表示西经 - /// - public double longitude; - /// - /// 速度,单位 m/s - /// - public double speed; - /// - /// 需要基础库: `1.2.0` - /// 垂直精度,单位 m(Android 无法获取,返回 0) - /// - public double verticalAccuracy; - - public string errMsg; - } - [Preserve] - public class GetNetworkTypeOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetNetworkTypeSuccessCallbackResult { - /// - /// 网络类型 - /// 可选值: - /// - 'wifi': wifi 网络; - /// - '2g': 2g 网络; - /// - '3g': 3g 网络; - /// - '4g': 4g 网络; - /// - '5g': 5g 网络; - /// - 'unknown': Android 下不常见的网络类型; - /// - 'none': 无网络; - /// - public string networkType; - /// - /// 信号强弱,单位 dbm - /// - public double signalStrength; - - public string errMsg; - } - [Preserve] - public class GetPotentialFriendListOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetPotentialFriendListSuccessCallbackResult { - /// - /// 可能对游戏感兴趣的未注册好友名单 - /// - public FriendInfo[] list; - - public string errMsg; - } - [Preserve] - public class FriendInfo { - /// - /// 用户的微信头像 url - /// - public string avatarUrl; - /// - /// 用户的微信昵称 - /// - public string nickname; - /// - /// 用户 openid - /// - public string openid; - } - [Preserve] - public class GetScreenBrightnessOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetScreenBrightnessSuccessCallbackOption { - /// - /// 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮 - /// - public double value; - } - [Preserve] - public class GetSettingOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 需要基础库: `2.10.1` - /// 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - /// - public bool withSubscriptions; - } - [Preserve] - public class GetSettingSuccessCallbackResult { - /// - /// [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) - /// 用户授权结果 - /// - public AuthSetting authSetting; - /// - /// [SubscriptionsSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/SubscriptionsSetting.html) - /// 需要基础库: `2.10.1` - /// 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 - /// - public SubscriptionsSetting subscriptionsSetting; - /// - /// [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) - /// 在插件中调用时,当前宿主小程序的用户授权结果 - /// - public AuthSetting miniprogramAuthSetting; - - public string errMsg; - } - [Preserve] - public class AuthSetting: Dictionary{ - /// - /// 是否授权使用你的微信朋友信息,对应开放数据域内的 [wx.getFriendCloudStorage](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getFriendCloudStorage.html) 、[wx.getGroupCloudStorage](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getGroupCloudStorage.html) 、[wx.getGroupInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getGroupInfo.html) 、[wx.getPotentialFriendList](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getPotentialFriendList.html) 、[wx.getUserCloudStorageKeys](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getUserCloudStorageKeys.html) 、[wx.getUserInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/OpenDataContext-wx.getUserInfo.html) 、[GameServerManager.getFriendsStateData](https://developers.weixin.qq.com/minigame/dev/api/game-server-manager/GameServerManager.getFriendsStateData.html) 接口,以及主域内的 [wx.getUserInteractiveStorage](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getUserInteractiveStorage.html) 接口。 - /// - /// scope.WxFriendInteraction - /// - /// 是否授权用户信息,对应接口 [wx.getUserInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/wx.getUserInfo.html) - /// - /// scope.userInfo - /// - /// 是否授权地理位置,对应接口 [wx.getLocation](https://developers.weixin.qq.com/minigame/dev/api/location/wx.getLocation.html) - /// - /// scope.userLocation - /// - /// 是否授权微信运动步数,对应接口 [wx.getWeRunData](https://developers.weixin.qq.com/minigame/dev/api/open-api/werun/wx.getWeRunData.html) - /// - /// scope.werun - /// - /// 是否授权保存到相册,对应接口 [wx.saveImageToPhotosAlbum](https://developers.weixin.qq.com/minigame/dev/api/media/image/wx.saveImageToPhotosAlbum.html) - /// - /// scope.writePhotosAlbum - } - [Preserve] - public class SubscriptionsSetting { - /// - /// 订阅消息总开关,true为开启,false为关闭 - /// - public bool mainSwitch; - /// - /// 每一项订阅消息的订阅状态。itemSettings对象的键为**一次性订阅消息的模板id**或**系统订阅消息的类型**,值为'accept'、'reject'、'ban'中的其中一种。'accept'表示用户同意订阅这条消息,'reject'表示用户拒绝订阅这条消息,'ban'表示已被后台封禁。一次性订阅消息使用方法详见 [wx.requestSubscribeMessage](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeMessage.html),永久订阅消息(仅小游戏可用)使用方法详见[wx.requestSubscribeSystemMessage](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeSystemMessage.html) - /// ## 注意事项 - /// - itemSettings 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - /// - public Dictionary itemSettings; - } - [Preserve] - public class GetShareInfoOption { - /// - /// shareTicket - /// - public string shareTicket; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 需要基础库: `1.9.90` - /// 超时时间,单位 ms - /// - public double timeout; - } - [Preserve] - public class GetStorageInfoOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetStorageInfoSuccessCallbackOption { - /// - /// 当前占用的空间大小, 单位 KB - /// - public double currentSize; - /// - /// 当前 storage 中所有的 key - /// - public string[] keys; - /// - /// 限制的空间大小,单位 KB - /// - public double limitSize; - } - [Preserve] - public class GetSystemInfoOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetSystemInfoAsyncOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetUserCloudStorageOption { - /// - /// 要获取的 key 列表 - /// - public string[] keyList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetUserCloudStorageSuccessCallbackResult { - /// - /// 用户托管的 KV 数据列表 - /// - public KVData[] KVDataList; - - public string errMsg; - } - [Preserve] - public class GetUserCloudStorageKeysOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetUserCloudStorageKeysSuccessCallbackResult { - /// - /// 用户托管数据当中所有的 key 数组 - /// - public string[] keys; - - public string errMsg; - } - [Preserve] - public class GetUserInfoOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 显示用户信息的语言 - /// 可选值: - /// - 'en': 英文; - /// - 'zh_CN': 简体中文; - /// - 'zh_TW': 繁体中文; - /// - public string lang; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 是否带上登录态信息。当 withCredentials 为 true 时,要求此前有调用过 wx.login 且登录态尚未过期,此时返回的数据会包含 encryptedData, iv 等敏感信息;当 withCredentials 为 false 时,不要求有登录态,返回的数据不包含 encryptedData, iv 等敏感信息。 - /// - public bool withCredentials; - } - [Preserve] - public class GetUserInfoSuccessCallbackResult { - /// - /// 需要基础库: `2.7.0` - /// 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - /// - public string cloudID; - /// - /// 包括敏感数据在内的完整用户信息的加密数据,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - /// - public string encryptedData; - /// - /// 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - /// - public string iv; - /// - /// 不包括敏感信息的原始数据字符串,用于计算签名 - /// - public string rawData; - /// - /// 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - /// - public string signature; - /// - /// [UserInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/UserInfo.html) - /// 用户信息对象,不包含 openid 等敏感信息 - /// - public UserInfo userInfo; - - public string errMsg; - } - [Preserve] - public class UserInfo { - /// - /// 用户头像图片的 URL。URL 最后一个数值代表正方形头像大小(有 0、46、64、96、132 数值可选,0 代表 640x640 的正方形头像,46 表示 46x46 的正方形头像,剩余数值以此类推。默认132),用户没有头像时该项为空。若用户更换头像,原有头像 URL 将失效。 - /// - public string avatarUrl; - /// - /// 用户所在城市。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - /// - public string city; - /// - /// 用户所在国家。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - /// - public string country; - /// - /// 用户性别。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - /// 可选值: - /// - 0: 未知; - /// - 1: 男性; - /// - 2: 女性; - /// - public double gender; - /// - /// 显示 country,province,city 所用的语言。强制返回 “zh_CN”,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - /// 可选值: - /// - 'en': 英文; - /// - 'zh_CN': 简体中文; - /// - 'zh_TW': 繁体中文; - /// - public string language; - /// - /// 用户昵称 - /// - public string nickName; - /// - /// 用户所在省份。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - /// - public string province; - } - [Preserve] - public class GetUserInteractiveStorageOption { - /// - /// 要获取的 key 列表 - /// - public string[] keyList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetUserInteractiveStorageFailCallbackResult { - /// - /// 错误码 - /// 可选值: - /// - -17008: 非法的 key; - /// - public double errCode; - /// - /// 错误信息 - /// - public string errMsg; - } - [Preserve] - public class GetUserInteractiveStorageSuccessCallbackResult { - /// - /// 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - /// - public string cloudID; - /// - /// 加密数据,包含互动型托管数据的值。解密后的结果为一个 `KVDataList`,每一项为一个 `KVData`。 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - /// - public string encryptedData; - - public string errMsg; - /// - /// 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - /// - public string iv; - } - [Preserve] - public class GetWeRunDataOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetWeRunDataSuccessCallbackResult { - /// - /// 需要基础库: `2.7.0` - /// 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - /// - public string cloudID; - /// - /// 包括敏感数据在内的完整用户信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html)。解密后得到的数据结构见后文 - /// - public string encryptedData; - /// - /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - /// - public string iv; - - public string errMsg; - } - [Preserve] - public class HideKeyboardOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class HideLoadingOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class HideShareMenuOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.11.3` - /// 本接口为 Beta 版本,暂只在 Android 平台支持。需要隐藏的转发按钮名称列表,默认['shareAppMessage', 'shareTimeline']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 - /// - public string[] menus; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class HideToastOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class InitFaceDetectOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class IsBluetoothDevicePairedOption { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class JoinVoIPChatOption { - /// - /// 小游戏内此房间/群聊的 ID。同一时刻传入相同 groupId 的用户会进入到同个实时语音房间。 - /// - public string groupId; - /// - /// 验证所需的随机字符串 - /// - public string nonceStr; - /// - /// 签名,用于验证小游戏的身份 - /// - public string signature; - /// - /// 验证所需的时间戳 - /// - public long timeStamp; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 静音设置 - /// - public MuteConfig muteConfig; - /// - /// 房间类型 - /// 可选值: - /// - 'voice': 音频房间,用于语音通话; - /// - 'video': 视频房间,结合 [voip-room](#) 组件可显示成员画面; - /// - public string roomType; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class JoinVoIPChatError { - /// - /// 错误信息 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | -1 | 当前已在房间内 | | - /// | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | - /// | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | - /// | -1000 | 系统错误 | | - /// - public string errMsg; - /// - /// 错误码 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | -1 | 当前已在房间内 | | - /// | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | - /// | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | - /// | -1000 | 系统错误 | | - /// - public double errCode; - } - [Preserve] - public class MuteConfig { - /// - /// 是否静音耳机 - /// - public bool muteEarphone; - /// - /// 是否静音麦克风 - /// - public bool muteMicrophone; - } - [Preserve] - public class JoinVoIPChatSuccessCallbackResult { - /// - /// 错误码 - /// - public double errCode; - /// - /// 调用结果 - /// - public string errMsg; - /// - /// 在此通话中的成员 openId 名单 - /// - public string[] openIdList; - } - [Preserve] - public class LoginOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 需要基础库: `1.9.90` - /// 超时时间,单位ms - /// - public double timeout; - } - [Preserve] - public class LoginSuccessCallbackResult { - /// - /// 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 [auth.code2Session](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/login/auth.code2Session.html),使用 code 换取 openid、unionid、session_key 等信息 - /// - public string code; - - public string errMsg; - } - [Preserve] - public class MakeBluetoothPairOption { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// pin 码,Base64 格式。 - /// - public string pin; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 超时时间,单位 ms - /// - public double timeout; - } - [Preserve] - public class ModifyFriendInteractiveStorageOption { - /// - /// 需要修改的数据的 key,目前可以为 '1' - '50' - /// - public string key; - /// - /// 需要修改的数值,目前只能为 1 - /// - public double opNum; - /// - /// 修改类型 - /// 可选值: - /// - 'add': 加; - /// - public string operation; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.9.0` - /// 分享图片地址,详见 wx.shareMessageToFriend 同名参数(需要配置模板规则) - /// - public string imageUrl; - /// - /// 需要基础库: `2.9.0` - /// 分享图片 ID,详见 wx.shareMessageToFriend 同名参数(需要配置模板规则) - /// - public string imageUrlId; - /// - /// 需要基础库: `2.9.0` - /// 是否静默修改(不弹框)。当进入场景是好友 [定向分享](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.shareMessageToFriend.html) 的卡片时有效,代表分享反馈操作,此时 `toUser` 默认为原分享者的 openId - /// - public bool quiet; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 需要基础库: `2.9.0` - /// 分享标题,如果设置了这个值,则在交互成功后自动询问用户是否分享给好友(需要配置模板规则) - /// - public string title; - /// - /// 目标好友的 openId - /// - public string toUser; - } - [Preserve] - public class ModifyFriendInteractiveStorageFailCallbackResult { - /// - /// 错误码 - /// 可选值: - /// - -17006: 非好友关系; - /// - -17007: 非法的 toUser openId; - /// - -17008: 非法的 key; - /// - -17009: 非法的 operation; - /// - -17010: 非法的操作数; - /// - -17011: JSServer 校验写操作失败; - /// - public double errCode; - /// - /// 错误信息 - /// - public string errMsg; - } - [Preserve] - public class NavigateToMiniProgramOption { - /// - /// 要打开的小程序 appId - /// - public string appId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 - /// 可选值: - /// - 'develop': 开发版; - /// - 'trial': 体验版; - /// - 'release': 正式版; - /// - public string envVersion; - /// - /// 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据数据。 - /// - public Dictionary extraData; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 打开的页面路径,如果为空则打开首页。path 中 ? 后面的部分会成为 query,在小程序的 `App.onLaunch`、`App.onShow` 和 `Page.onLoad` 的回调函数或小游戏的 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html) 回调函数、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到 query 数据。对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar"。 - /// - public string path; - /// - /// 需要基础库: `2.18.1` - /// 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。 - /// - public string shortLink; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class NotifyBLECharacteristicValueChangeOption { - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - /// - /// 是否启用 notify - /// - public bool state; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 需要基础库: `2.4.0` - /// 设置特征订阅类型,有效值有 `notification` 和 `indication` - /// - public string type; - } - [Preserve] - public class OnAccelerometerChangeCallbackResult { - /// - /// X 轴 - /// - public double x; - /// - /// Y 轴 - /// - public double y; - /// - /// Z 轴 - /// - public double z; - } - [Preserve] - public class OnAddToFavoritesCallbackResult { - /// - /// 禁止收藏后长按转发,默认 false - /// - public bool disableForward; - /// - /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 - /// - public string imageUrl; - /// - /// 查询字符串,必须是 key1=val1&key2=val2 的格式。从收藏进入后,可通过 wx.getLaunchOptionsSync() 或 wx.onShow() 获取启动参数中的 query。 - /// - public string query; - /// - /// 收藏标题,不传则默认使用当前小游戏的昵称。 - /// - public string title; - } - [Preserve] - public class OnBLECharacteristicValueChangeCallbackResult { - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - /// - /// 特征最新的值 - /// - public byte[] value; - } - [Preserve] - public class OnBLEConnectionStateChangeCallbackResult { - /// - /// 是否处于已连接状态 - /// - public bool connected; - /// - /// 蓝牙设备 id - /// - public string deviceId; - } - [Preserve] - public class OnBLEMTUChangeCallbackResult { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 最大传输单元 - /// - public double mtu; - } - [Preserve] - public class OnBLEPeripheralConnectionStateChangedCallbackResult { - /// - /// 连接目前状态 - /// - public bool connected; - /// - /// 连接状态变化的设备 id - /// - public string deviceId; - /// - /// server 的 UUID - /// - public string serverId; - } - [Preserve] - public class OnBeaconServiceChangeCallbackResult { - /// - /// 服务目前是否可用 - /// - public bool available; - /// - /// 目前是否处于搜索状态 - /// - public bool discovering; - } - [Preserve] - public class OnBeaconUpdateCallbackResult { - /// - /// 当前搜寻到的所有 Beacon 设备列表 - /// - public BeaconInfo[] beacons; - } - [Preserve] - public class OnBluetoothAdapterStateChangeCallbackResult { - /// - /// 蓝牙适配器是否可用 - /// - public bool available; - /// - /// 蓝牙适配器是否处于搜索状态 - /// - public bool discovering; - } - [Preserve] - public class OnBluetoothDeviceFoundCallbackResult { - /// - /// 新搜索到的设备列表 - /// - public BlueToothDevice[] devices; - } - [Preserve] - public class OnCompassChangeCallbackResult { - /// - /// 需要基础库: `2.4.0` - /// 精度 - /// - public double accuracy; - /// - /// 面对的方向度数 - /// - public double direction; - } - [Preserve] - public class OnCopyUrlCallbackResult { - /// - /// 用短链打开小程序时当前页面携带的查询字符串。小程序中使用时,应在进入页面时调用 `wx.onCopyUrl` 自定义 `query`,退出页面时调用 `wx.offCopyUrl`,防止影响其它页面。 - /// - public string query; - } - [Preserve] - public class OnDeviceMotionChangeCallbackResult { - /// - /// 当 手机坐标 X/Y 和 地球 X/Y 重合时,绕着 Z 轴转动的夹角为 alpha,范围值为 [0, 2*PI)。逆时针转动为正。 - /// - public double alpha; - /// - /// 当手机坐标 Y/Z 和地球 Y/Z 重合时,绕着 X 轴转动的夹角为 beta。范围值为 [-1*PI, PI) 。顶部朝着地球表面转动为正。也有可能朝着用户为正。 - /// - public double beta; - /// - /// 当手机 X/Z 和地球 X/Z 重合时,绕着 Y 轴转动的夹角为 gamma。范围值为 [-1*PI/2, PI/2)。右边朝着地球表面转动为正。 - /// - public double gamma; - } - [Preserve] - public class OnDeviceOrientationChangeCallbackResult { - /// - /// 表示切换后的屏幕是横屏还是竖屏 - /// 可选值: - /// - 'portrait': 竖屏; - /// - 'landscape': 横屏正方向,以 HOME 键在屏幕右侧为正方向; - /// - 'landscapeReverse': 横屏反方向,以 HOME 键在屏幕左侧为反方向; - /// - public string value; - } - [Preserve] - public class WxOnErrorCallbackResult { - /// - /// 错误 - /// - public string message; - /// - /// 错误调用堆栈 - /// - public string stack; - } - [Preserve] - public class OnGyroscopeChangeCallbackResult { - /// - /// x 轴的角速度 - /// - public double x; - /// - /// y 轴的角速度 - /// - public double y; - /// - /// z 轴的角速度 - /// - public double z; - } - [Preserve] - public class OnHandoffCallbackResult { - /// - /// 需要传递给接力客户端的 query - /// - public string query; - } - [Preserve] - public class OnKeyDownCallbackResult { - /// - /// 同 Web 规范 KeyEvent code 属性 - /// - public string code; - /// - /// 同 Web 规范 KeyEvent key 属性 - /// - public string key; - /// - /// 事件触发时的时间戳 - /// - public long timeStamp; - } - [Preserve] - public class OnKeyboardInputCallbackResult { - /// - /// 键盘输入的当前值 - /// - public string value; - } - [Preserve] - public class OnKeyboardHeightChangeCallbackResult { - /// - /// 键盘高度 - /// - public double height; - } - [Preserve] - public class OnMemoryWarningCallbackResult { - /// - /// 内存告警等级,只有 Android 才有,对应系统宏定义 - /// 可选值: - /// - 5: TRIM_MEMORY_RUNNING_MODERATE; - /// - 10: TRIM_MEMORY_RUNNING_LOW; - /// - 15: TRIM_MEMORY_RUNNING_CRITICAL; - /// - public double level; - } - [Preserve] - public class OnNetworkStatusChangeCallbackResult { - /// - /// 当前是否有网络连接 - /// - public bool isConnected; - /// - /// 网络类型 - /// 可选值: - /// - 'wifi': wifi 网络; - /// - '2g': 2g 网络; - /// - '3g': 3g 网络; - /// - '4g': 4g 网络; - /// - 'unknown': Android 下不常见的网络类型; - /// - 'none': 无网络; - /// - public string networkType; - } - [Preserve] - public class OnNetworkWeakChangeCallbackResult { - /// - /// 当前网络类型 - /// - public string networkType; - /// - /// 当前是否处于弱网状态 - /// - public bool weakNet; - } - [Preserve] - public class OnShareMessageToFriendCallbackResult { - /// - /// 错误信息 - /// - public string errMsg; - /// - /// 是否成功 - /// - public bool success; - } - [Preserve] - public class OnShareTimelineCallbackResult { - /// - /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。(该图片用于分享到朋友圈的卡片以及从朋友圈转发到会话消息的卡片展示) - /// - public string imageUrl; - /// - /// 需要基础库: `2.14.3` - /// 朋友圈预览图链接,不传则默认使用当前游戏画面截图 - /// - public string imagePreviewUrl; - /// - /// 需要基础库: `2.14.3` - /// 审核通过的朋友圈预览图图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) - /// - public string imagePreviewUrlId; - /// - /// 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) - /// - public string imageUrlId; - /// - /// 需要基础库: `2.12.2` - /// 独立分包路径。详见 [小游戏独立分包指南](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/independent-sub-packages.html) - /// - public string path; - /// - /// 查询字符串,必须是 key1=val1&key2=val2 的格式。从这条转发消息进入后,可通过 wx.getLaunchOptionsSync() 或 wx.onShow() 获取启动参数中的 query。不传则默认使用当前页面query。 - /// - public string query; - /// - /// 转发标题,不传则默认使用当前小游戏的昵称。 - /// - public string title; - } - [Preserve] - public class OnShowCallbackResult { - /// - /// 查询参数 - /// - public Dictionary query; - /// - /// 当场景为由从另一个小程序或公众号或App打开时,返回此字段 - /// - public ResultReferrerInfo referrerInfo; - /// - /// 场景值 - /// - public double scene; - /// - /// shareTicket - /// - public string shareTicket; - } - [Preserve] - public class ResultReferrerInfo { - /// - /// 来源小程序或公众号或App的 appId - /// - public string appId; - /// - /// 来源小程序传过来的数据,scene=1037或1038时支持 - /// - public Dictionary extraData; - } - [Preserve] - public class SocketTaskOnCloseCallbackResult { - /// - /// 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 - /// - public double code; - /// - /// 一个可读的字符串,表示连接被关闭的原因。 - /// - public string reason; - } - [Preserve] - public class SocketTaskOnMessageCallbackResult { - /// - /// 服务器返回的消息 - /// - public string data; - } - [Preserve] - public class OnSocketOpenCallbackResult { - /// - /// 需要基础库: `2.0.0` - /// 连接成功的 HTTP 响应 Header - /// - public Dictionary header; - } - [Preserve] - public class OnTouchStartCallbackResult { - /// - /// 触发此次事件的触摸点列表 - /// - public Touch[] changedTouches; - /// - /// 事件触发时的时间戳 - /// - public long timeStamp; - /// - /// 当前所有触摸点的列表 - /// - public Touch[] touches; - } - [Preserve] - public class Touch { - /// - /// 触点相对于可见视区左边沿的 X 坐标。 - /// - public float clientX; - /// - /// 触点相对于可见视区上边沿的 Y 坐标。 - /// - public float clientY; - /// - /// 手指挤压触摸平面的压力大小, 从0.0(没有压力)到1.0(最大压力)的浮点数(仅在支持 force touch 的设备返回) - /// - public double force; - /// - /// Touch 对象的唯一标识符,只读属性。一次触摸动作(我们值的是手指的触摸)在平面上移动的整个过程中, 该标识符不变。可以根据它来判断跟踪的是否是同一次触摸过程。 - /// - public int identifier; - /// - /// 触点相对于页面左边沿的 X 坐标。 - /// - public float pageX; - /// - /// 触点相对于页面上边沿的 Y 坐标。 - /// - public float pageY; - } - [Preserve] - public class OnUnhandledRejectionCallbackResult { - /// - /// 拒绝原因,一般是一个 Error 对象 - /// - public string reason; - } - [Preserve] - public class OnVoIPChatInterruptedCallbackResult { - /// - /// 错误码 - /// - public double errCode; - /// - /// 调用结果(错误原因) - /// - public string errMsg; - } - [Preserve] - public class OnVoIPChatMembersChangedCallbackResult { - /// - /// 错误码 - /// - public double errCode; - /// - /// 调用结果 - /// - public string errMsg; - /// - /// 还在实时语音通话中的成员 openId 名单 - /// - public string[] openIdList; - } - [Preserve] - public class OnVoIPChatSpeakersChangedCallbackResult { - /// - /// 错误码 - /// - public double errCode; - /// - /// 调用结果(错误原因) - /// - public string errMsg; - /// - /// 还在实时语音通话中的成员 openId 名单 - /// - public string[] openIdList; - } - [Preserve] - public class OnVoIPChatStateChangedCallbackResult { - /// - /// 事件码 - /// - public double code; - /// - /// 附加信息 - /// - public Dictionary data; - /// - /// 错误码 - /// - public double errCode; - /// - /// 调用结果 - /// - public string errMsg; - } - [Preserve] - public class OnWindowResizeCallbackResult { - /// - /// 变化后的窗口高度,单位 px - /// - public double windowHeight; - /// - /// 变化后的窗口宽度,单位 px - /// - public double windowWidth; - } - [Preserve] - public class OpenBluetoothAdapterOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.10.0` - /// 蓝牙模式,可作为主/从设备,仅 iOS 需要。 - /// 可选值: - /// - 'central': 主机模式; - /// - 'peripheral': 从机(外围设备)模式; - /// - public string mode; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenCardOption { - /// - /// 需要打开的卡券列表 - /// - public OpenCardRequestInfo[] cardList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenCardRequestInfo { - /// - /// 卡券 ID - /// - public string cardId; - /// - /// 由 [wx.addCard](https://developers.weixin.qq.com/minigame/dev/api/open-api/card/wx.addCard.html) 的返回对象中的加密 code 通过解密后得到,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) - /// - public string code; - } - [Preserve] - public class OpenChannelsActivityOption { - /// - /// 视频 feedId - /// - public string feedId; - /// - /// 视频号 id,以“sph”开头的id,可在视频号助手获取 - /// - public string finderUserName; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenChannelsEventOption { - /// - /// 活动 id - /// - public string eventId; - /// - /// 视频号 id,以“sph”开头的id,可在视频号助手获取 - /// - public string finderUserName; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenChannelsLiveOption { - /// - /// 视频号 id,以“sph”开头的id,可在视频号助手获取 - /// - public string finderUserName; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 直播 feedId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) - /// - public string feedId; - /// - /// 直播 nonceId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) - /// - public string nonceId; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenChannelsUserProfileOption { - /// - /// 视频号 id - /// - public string finderUserName; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenCustomerServiceConversationOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 会话内消息卡片图片路径 - /// - public string sendMessageImg; - /// - /// 会话内消息卡片路径 - /// - public string sendMessagePath; - /// - /// 会话内消息卡片标题 - /// - public string sendMessageTitle; - /// - /// 会话来源 - /// - public string sessionFrom; - /// - /// 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息 - /// - public bool showMessageCard; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenSettingOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 需要基础库: `2.10.3` - /// 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - /// - public bool withSubscriptions; - } - [Preserve] - public class OpenSettingSuccessCallbackResult { - /// - /// [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) - /// 用户授权结果 - /// - public AuthSetting authSetting; - /// - /// [SubscriptionsSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/SubscriptionsSetting.html) - /// 需要基础库: `2.10.3` - /// 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 - /// - public SubscriptionsSetting subscriptionsSetting; - - public string errMsg; - } - [Preserve] - public class PreviewImageOption { - /// - /// 需要预览的图片链接列表。[2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持云文件ID。 - /// - public string[] urls; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 当前显示图片的链接 - /// - public string current; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.13.0` - /// `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; - /// - public string referrerPolicy; - /// - /// 需要基础库: `2.13.0` - /// 是否显示长按菜单。 - /// 支持识别的码:小程序码 - /// 仅小程序支持识别的码:微信个人码、微信群码、企业微信个人码、 企业微信群码与企业微信互通群码; - /// - public bool showmenu; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class PreviewMediaOption { - /// - /// 需要预览的资源列表 - /// - public MediaSource[] sources; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 当前显示的资源序号 - /// - public double current; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.13.0` - /// `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; - /// - public string referrerPolicy; - /// - /// 需要基础库: `2.13.0` - /// 是否显示长按菜单。 - /// 支持识别的码:小程序码 - /// 仅小程序支持识别的码:微信个人码、微信群码、企业微信个人码、 企业微信群码与企业微信互通群码; - /// - public bool showmenu; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class MediaSource { - /// - /// 图片或视频的地址 - /// - public string url; - /// - /// 视频的封面图片 - /// - public string poster; - /// - /// 资源的类型,默认为图片 - /// 可选值: - /// - 'image': 图片; - /// - 'video': 视频; - /// - public string type; - } - [Preserve] - public class ReadBLECharacteristicValueOption { - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class RemoveStorageOption { - /// - /// 本地缓存中指定的 key - /// - public string key; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class RemoveUserCloudStorageOption { - /// - /// 要删除掉 key 列表 - /// - public string[] keyList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ReportUserBehaviorBranchAnalyticsOption { - /// - /// 分支ID,在「小程序管理后台」获取 - /// - public string branchId; - /// - /// 事件类型,1:曝光; 2:点击 - /// - public double eventType; - /// - /// 自定义维度,基础库 v2.14.0 开始支持可选 - /// - public string branchDim; - } - [Preserve] - public class RequestMidasFriendPaymentOption { - /// - /// 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyQuantity限制说明)。 - /// - public double buyQuantity; - /// - /// 币种 - /// 可选值: - /// - 'CNY': 人民币; - /// - public string currencyType; - /// - /// 环境配置 - /// 可选值: - /// - 0: 米大师正式环境; - /// - 1: 米大师沙箱环境; - /// - public double env; - /// - /// 支付的类型,不同的支付类型有各自额外要传的附加参数 - /// 可选值: - /// - 'game': 购买游戏币; - /// - public string mode; - /// - /// 随机字符串,长度应小于 128 - /// - public string nonceStr; - /// - /// 在米大师侧申请的应用 id - /// - public string offerId; - /// - /// 开发者业务订单号,每个订单号只能使用一次,重复使用会失败。要求32个字符内,只能是数字、大小写字母、符号 `_-|*@` - /// - public string outTradeNo; - /// - /// 申请接入时的平台,platform 与应用id有关。 - /// 可选值: - /// - 'android': Android平台; - /// - public string platform; - /// - /// 签名 - /// - public string signature; - /// - /// 生成这个随机字符串的 UNIX 时间戳(精确到秒) - /// - public long timeStamp; - /// - /// 分区 ID - /// - public string zoneId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class MidasFriendPaymentError { - /// - /// 错误信息 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | 1000 | | mode错误 | - /// | -15005 | | 索要权限被封禁(索要功能不可用) | - /// | -10073011 | | 参数错误(具体错误见errMsg) | - /// | -10073003 | | outTradeNo业务单号重复 | - /// | -10073012 | | 索要单已支付 | - /// | -10073013 | | 索要单已超时 | - /// | -10073014 | | 签名错误 | - /// | -10073015 | | 索要功能不可用 | - /// - public string errMsg; - /// - /// 错误码 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | 1000 | | mode错误 | - /// | -15005 | | 索要权限被封禁(索要功能不可用) | - /// | -10073011 | | 参数错误(具体错误见errMsg) | - /// | -10073003 | | outTradeNo业务单号重复 | - /// | -10073012 | | 索要单已支付 | - /// | -10073013 | | 索要单已超时 | - /// | -10073014 | | 签名错误 | - /// | -10073015 | | 索要功能不可用 | - /// - public double errCode; - } - [Preserve] - public class RequestMidasFriendPaymentSuccessCallbackResult { - /// - /// 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - /// - public string cloudID; - /// - /// 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - /// - public string encryptedData; - /// - /// 错误信息 - /// - public string errMsg; - /// - /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - /// - public string iv; - } - [Preserve] - public class RequestMidasPaymentOption { - /// - /// 币种 - /// 可选值: - /// - 'CNY': 人民币; - /// - public string currencyType; - /// - /// 支付的类型,不同的支付类型有各自额外要传的附加参数。 - /// 可选值: - /// - 'game': 购买游戏币; - /// - public string mode; - /// - /// 在米大师侧申请的应用 id - /// - public string offerId; - /// - /// 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyquantity-限制说明)。 - /// - public double buyQuantity; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 环境配置 - /// 可选值: - /// - 0: 米大师正式环境; - /// - 1: 米大师沙箱环境; - /// - public double env; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 申请接入时的平台,platform 与应用id有关。 - /// 可选值: - /// - 'android': android; - /// - public string platform; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 分区 ID - /// - public string zoneId; - } - [Preserve] - public class MidasPaymentError { - /// - /// 错误信息 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | -1 | | 系统失败 | - /// | -2 | | 支付取消 | - /// | -15001 | | 虚拟支付接口错误码,缺少参数 | - /// | -15002 | | 虚拟支付接口错误码,参数不合法 | - /// | -15003 | | 虚拟支付接口错误码,订单重复 | - /// | -15004 | | 虚拟支付接口错误码,后台错误 | - /// | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | - /// | -15006 | | 虚拟支付接口错误码,货币类型不支持 | - /// | -15007 | | 虚拟支付接口错误码,订单已支付 | - /// | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | - /// | 1 | | 虚拟支付接口错误码,用户取消支付 | - /// | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | - /// | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | - /// | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | - /// | 5 | | 虚拟支付接口错误码,操作系统错误 | - /// | 6 | | 虚拟支付接口错误码,其他错误 | - /// | 1000 | | 参数错误 | - /// | 1003 | | 米大师Portal错误 | - /// - public string errMsg; - /// - /// 错误码 - /// | 错误码 | 错误信息 | 说明 | - /// | - | - | - | - /// | -1 | | 系统失败 | - /// | -2 | | 支付取消 | - /// | -15001 | | 虚拟支付接口错误码,缺少参数 | - /// | -15002 | | 虚拟支付接口错误码,参数不合法 | - /// | -15003 | | 虚拟支付接口错误码,订单重复 | - /// | -15004 | | 虚拟支付接口错误码,后台错误 | - /// | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | - /// | -15006 | | 虚拟支付接口错误码,货币类型不支持 | - /// | -15007 | | 虚拟支付接口错误码,订单已支付 | - /// | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | - /// | 1 | | 虚拟支付接口错误码,用户取消支付 | - /// | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | - /// | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | - /// | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | - /// | 5 | | 虚拟支付接口错误码,操作系统错误 | - /// | 6 | | 虚拟支付接口错误码,其他错误 | - /// | 1000 | | 参数错误 | - /// | 1003 | | 米大师Portal错误 | - /// - public double errCode; - } - [Preserve] - public class RequestSubscribeMessageOption { - /// - /// 需要订阅的消息模板的id的集合,一次调用最多可订阅3条消息(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置。每个tmplId对应的模板标题需要不相同,否则会被过滤。 - /// - public string[] tmplIds; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class RequestSubscribeMessageFailCallbackResult { - /// - /// 接口调用失败错误码 - /// - public double errCode; - /// - /// 接口调用失败错误信息 - /// - public string errMsg; - } - [Preserve] - public class RequestSubscribeMessageSuccessCallbackResult: Dictionary{ - /// - /// [TEMPLATE_ID]是动态的键,即模板id,值包括'accept'、'reject'、'ban'、'filter'。'accept'表示用户同意订阅该条id对应的模板消息,'reject'表示用户拒绝订阅该条id对应的模板消息,'ban'表示已被后台封禁,'filter'表示该模板因为模板标题同名被后台过滤。例如 { errMsg: "requestSubscribeMessage:ok", zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: "accept"} 表示用户同意订阅zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE这条消息 - /// - /// - /// 接口调用成功时errMsg值为'requestSubscribeMessage:ok' - /// - public string errMsg; - } - [Preserve] - public class RequestSubscribeSystemMessageOption { - /// - /// 系统订阅消息类型列表,一次调用最多可订阅3种类型的消息,目前支持两种类型,"SYS_MSG_TYPE_INTERACTIVE"(好友互动提醒)、"SYS_MSG_TYPE_RANK"(排行榜超越提醒) - /// - public string[] msgTypeList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class RequestSubscribeSystemMessageSuccessCallbackResult: Dictionary{ - /// - /// [MSG_TYPE]是动态的键,即系统订阅消息类型,值为'accept'、'reject'、'ban','accept'表示用户同意订阅该类型对应的模板消息,'reject'表示用户拒绝订阅该类型对应的模板消息,'ban'表示已被后台封禁。例如 { errMsg: "requestSubscribeSystemMessage:ok", SYS_MSG_TYPE_INTERACTIVE: "accept" } 表示用户同意订阅'SYS_MSG_TYPE_INTERACTIVE'这条消息 - /// - /// - /// 接口调用成功时errMsg值为'requestSubscribeSystemMessage:ok' - /// - public string errMsg; - } - [Preserve] - public class ReserveChannelsLiveOption { - /// - /// 预告 id,通过 getChannelsLiveNoticeInfo 接口获取 - /// - public string noticeId; - } - [Preserve] - public class SaveFileToDiskOption { - /// - /// 待保存文件路径 - /// - public string filePath; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SaveImageToPhotosAlbumOption { - /// - /// 图片文件路径,可以是临时文件路径或永久文件路径 (本地路径) ,不支持网络路径 - /// - public string filePath; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ScanCodeOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `1.2.0` - /// 是否只能从相机扫码,不允许从相册选择图片 - /// - public bool onlyFromCamera; - /// - /// 需要基础库: `1.7.0` - /// 扫码类型 - /// 可选值: - /// - 'barCode': 一维码; - /// - 'qrCode': 二维码; - /// - 'datamatrix': Data Matrix 码; - /// - 'pdf417': PDF417 条码; - /// - public Array scanType; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ScanCodeSuccessCallbackResult { - /// - /// 所扫码的字符集 - /// - public string charSet; - /// - /// 当所扫的码为当前小程序二维码时,会返回此字段,内容为二维码携带的 path - /// - public string path; - /// - /// 原始数据,base64编码 - /// - public string rawData; - /// - /// 所扫码的内容 - /// - public string result; - /// - /// 所扫码的类型 - /// 可选值: - /// - 'QR_CODE': 二维码; - /// - 'AZTEC': 一维码; - /// - 'CODABAR': 一维码; - /// - 'CODE_39': 一维码; - /// - 'CODE_93': 一维码; - /// - 'CODE_128': 一维码; - /// - 'DATA_MATRIX': 二维码; - /// - 'EAN_8': 一维码; - /// - 'EAN_13': 一维码; - /// - 'ITF': 一维码; - /// - 'MAXICODE': 一维码; - /// - 'PDF_417': 二维码; - /// - 'RSS_14': 一维码; - /// - 'RSS_EXPANDED': 一维码; - /// - 'UPC_A': 一维码; - /// - 'UPC_E': 一维码; - /// - 'UPC_EAN_EXTENSION': 一维码; - /// - 'WX_CODE': 二维码; - /// - 'CODE_25': 一维码; - /// - public string scanType; - - public string errMsg; - } - [Preserve] - public class SendSocketMessageOption { - /// - /// 需要发送的内容 - /// - public string data; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetBLEMTUOption { - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 最大传输单元。设置范围为 (22,512) 区间内,单位 bytes - /// - public double mtu; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetBLEMTUFailCallbackResult { - /// - /// 最终协商的 MTU 值。如果协商失败则无此参数。安卓客户端 8.0.9 开始支持。 - /// - public double mtu; - } - [Preserve] - public class SetBLEMTUSuccessCallbackResult { - /// - /// 最终协商的 MTU 值,与传入参数一致。安卓客户端 8.0.9 开始支持。 - /// - public double mtu; - - public string errMsg; - } - [Preserve] - public class SetClipboardDataOption { - /// - /// 剪贴板的内容 - /// - public string data; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetEnableDebugOption { - /// - /// 是否打开调试 - /// - public bool enableDebug; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetInnerAudioOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 是否与其他音频混播,设置为 true 之后,不会终止其他应用或微信内的音乐 - /// - public bool mixWithOther; - /// - /// (仅在 iOS 生效)是否遵循静音开关,设置为 false 之后,即使是在静音模式下,也能播放声音 - /// - public bool obeyMuteSwitch; - /// - /// true 代表用扬声器播放,false 代表听筒播放,默认值为 true。 - /// - public bool speakerOn; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetKeepScreenOnOption { - /// - /// 是否保持屏幕常亮 - /// - public bool keepScreenOn; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetMenuStyleOption { - /// - /// 样式风格 - /// 可选值: - /// - 'light': 浅色; - /// - 'dark': 深色; - /// - public string style; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetScreenBrightnessOption { - /// - /// 屏幕亮度值,范围 0 ~ 1。0 最暗,1 最亮 - /// - public double value; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetStatusBarStyleOption { - /// - /// 样式风格 - /// 可选值: - /// - 'white': 白色; - /// - 'black': 浅色; - /// - public string style; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class SetUserCloudStorageOption { - /// - /// 要修改的 KV 数据列表 - /// - public KVData[] KVDataList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ShareAppMessageOption { - /// - /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 - /// - public string imageUrl; - /// - /// 需要基础库: `2.4.3` - /// 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) - /// - public string imageUrlId; - /// - /// 需要基础库: `2.12.2` - /// 独立分包路径。详见 [小游戏独立分包指南](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/independent-sub-packages.html) - /// - public string path; - /// - /// 查询字符串,从这条转发消息进入后,可通过 wx.getLaunchOptionsSync() 或 wx.onShow() 获取启动参数中的 query。必须是 key1=val1&key2=val2 的格式。 - /// - public string query; - /// - /// 转发标题,不传则默认使用当前小游戏的昵称。 - /// - public string title; - /// - /// 需要基础库: `2.12.2` - /// 是否转发到当前群。该参数只对从群工具栏打开的场景下生效,默认转发到当前群,填入false时可转发到其他会话。 - /// - public bool toCurrentGroup; - } - [Preserve] - public class ShareMessageToFriendOption { - /// - /// 发送对象的 openId - /// - public string openId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 - /// - public string imageUrl; - /// - /// 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) - /// - public string imageUrlId; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 转发标题,不传则默认使用当前小游戏的昵称。 - /// - public string title; - } - [Preserve] - public class ShowActionSheetOption { - /// - /// 按钮的文字数组,数组长度最大为 6 - /// - public string[] itemList; - /// - /// 需要基础库: `2.14.0` - /// 警示文案 - /// - public string alertText; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 按钮的文字颜色 - /// - public string itemColor; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ShowActionSheetSuccessCallbackResult { - /// - /// 用户点击的按钮序号,从上到下的顺序,从0开始 - /// - public double tapIndex; - - public string errMsg; - } - [Preserve] - public class ShowKeyboardOption { - /// - /// 当点击完成时键盘是否收起 - /// - public bool confirmHold; - /// - /// 键盘右下角 confirm 按钮的类型,只影响按钮的文本内容 - /// 可选值: - /// - 'done': 完成; - /// - 'next': 下一个; - /// - 'search': 搜索; - /// - 'go': 前往; - /// - 'send': 发送; - /// - public string confirmType; - /// - /// 键盘输入框显示的默认值 - /// - public string defaultValue; - /// - /// 键盘中文本的最大长度 - /// - public double maxLength; - /// - /// 是否为多行输入 - /// - public bool multiple; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ShowLoadingOption { - /// - /// 提示的内容 - /// - public string title; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 是否显示透明蒙层,防止触摸穿透 - /// - public bool mask; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ShowModalOption { - /// - /// 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 - /// - public string cancelColor; - /// - /// 取消按钮的文字,最多 4 个字符 - /// - public string cancelText; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 - /// - public string confirmColor; - /// - /// 确认按钮的文字,最多 4 个字符 - /// - public string confirmText; - /// - /// 提示的内容 - /// - public string content; - /// - /// 需要基础库: `2.17.1` - /// 是否显示输入框 - /// - public bool editable; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.17.1` - /// 显示输入框时的提示文本 - /// - public string placeholderText; - /// - /// 是否显示取消按钮 - /// - public bool showCancel; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 提示的标题 - /// - public string title; - } - [Preserve] - public class ShowModalSuccessCallbackResult { - /// - /// 需要基础库: `1.1.0` - /// 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) - /// - public bool cancel; - /// - /// 为 true 时,表示用户点击了确定按钮 - /// - public bool confirm; - /// - /// editable 为 true 时,用户输入的文本 - /// - public string content; - - public string errMsg; - } - [Preserve] - public class ShowShareImageMenuOption { - /// - /// 要分享的图片地址,必须为本地路径或临时路径 - /// - public string path; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class ShowShareMenuOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.11.3` - /// 本接口为 Beta 版本,暂只在 Android 平台支持。需要显示的转发按钮名称列表,默认['shareAppMessage']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 - /// - public string[] menus; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 是否使用带 shareTicket 的转发[详情](#) - /// - public bool withShareTicket; - } - [Preserve] - public class ShowToastOption { - /// - /// 提示的内容 - /// - public string title; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 提示的延迟时间 - /// - public double duration; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 图标 - /// 可选值: - /// - 'success': 显示成功图标,此时 title 文本最多显示 7 个汉字长度; - /// - 'error': 显示失败图标,此时 title 文本最多显示 7 个汉字长度; - /// - 'loading': 显示加载图标,此时 title 文本最多显示 7 个汉字长度; - /// - 'none': 不显示图标,此时 title 文本最多可显示两行,[1.9.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)及以上版本支持; - /// - public string icon; - /// - /// 需要基础库: `1.1.0` - /// 自定义图标的本地路径,image 的优先级高于 icon - /// - public string image; - /// - /// 是否显示透明蒙层,防止触摸穿透 - /// - public bool mask; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartAccelerometerOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.1.0` - /// 监听加速度数据回调函数的执行频率 - /// 可选值: - /// - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; - /// - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; - /// - 'normal': 普通的回调频率,在 200ms/次 左右; - /// - public string interval; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartBeaconDiscoveryOption { - /// - /// Beacon 设备广播的 UUID 列表 - /// - public string[] uuids; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 是否校验蓝牙开关,仅在 iOS 下有效。iOS 11 起,控制面板里关掉蓝牙,还是能继续使用 Beacon 服务。 - /// - public bool ignoreBluetoothAvailable; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartBluetoothDevicesDiscoveryOption { - /// - /// 是否允许重复上报同一设备。如果允许重复上报,则 [wx.onBlueToothDeviceFound](#) 方法会多次上报同一设备,但是 RSSI 值会有不同。 - /// - public bool allowDuplicatesKey; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 上报设备的间隔,单位 ms。0 表示找到新设备立即上报,其他数值根据传入的间隔上报。 - /// - public double interval; - /// - /// 扫描模式,越高扫描越快,也越耗电。仅安卓微信客户端 7.0.12 及以上支持。 - /// 可选值: - /// - 'low': 低; - /// - 'medium': 中; - /// - 'high': 高; - /// - public string powerLevel; - /// - /// 要搜索的蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID)。某些蓝牙设备会广播自己的主 service 的 UUID。如果设置此参数,则只搜索广播包有对应 UUID 的主服务的蓝牙设备。建议通过该参数过滤掉周边不需要处理的其他蓝牙设备。 - /// - public string[] services; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartCompassOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartDeviceMotionListeningOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 监听设备方向的变化回调函数的执行频率 - /// 可选值: - /// - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; - /// - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; - /// - 'normal': 普通的回调频率,在 200ms/次 左右; - /// - public string interval; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartGyroscopeOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 监听陀螺仪数据回调函数的执行频率 - /// 可选值: - /// - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; - /// - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; - /// - 'normal': 普通的回调频率,在 200ms/次 左右; - /// - public string interval; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StopAccelerometerOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StopBeaconDiscoveryOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StopBluetoothDevicesDiscoveryOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StopCompassOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StopDeviceMotionListeningOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StopFaceDetectOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StopGyroscopeOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class UpdateKeyboardOption { - /// - /// 键盘输入框的当前值 - /// - public string value; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class UpdateShareMenuOption { - /// - /// 需要基础库: `2.4.0` - /// 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取 - /// - public string activityId; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 需要基础库: `2.13.0` - /// 是否是私密消息。详见 [小程序私密消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/private-message.html) - /// - public bool isPrivateMessage; - /// - /// 需要基础库: `2.4.0` - /// 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/updatable-message.html) - /// - public bool isUpdatableMessage; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - /// - /// 需要基础库: `2.4.0` - /// 动态消息的模板信息 - /// - public UpdatableMessageFrontEndTemplateInfo templateInfo; - /// - /// 需要基础库: `2.11.0` - /// 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取。详见[群待办消息](#) - /// - public string toDoActivityId; - /// - /// 是否使用带 shareTicket 的转发[详情](#) - /// - public bool withShareTicket; - } - [Preserve] - public class UpdatableMessageFrontEndTemplateInfo { - /// - /// 参数列表 - /// - public UpdatableMessageFrontEndParameter[] parameterList; - } - [Preserve] - public class UpdatableMessageFrontEndParameter { - /// - /// 参数名 - /// - public string name; - /// - /// 参数值 - /// - public string value; - } - [Preserve] - public class UpdateVoIPChatMuteConfigOption { - /// - /// 静音设置 - /// - public MuteConfig muteConfig; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class UpdateWeChatAppOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class VibrateLongOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class VibrateShortOption { - /// - /// 需要基础库: `2.13.0` - /// 震动强度类型,有效值为:heavy、medium、light - /// - public string type; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class WriteBLECharacteristicValueOption { - /// - /// 蓝牙特征的 UUID - /// - public string characteristicId; - /// - /// 蓝牙设备 id - /// - public string deviceId; - /// - /// 蓝牙特征对应服务的 UUID - /// - public string serviceId; - /// - /// 蓝牙设备特征对应的二进制值 - /// - public byte[] value; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class StartGameLiveOption { - /// - /// 自定义query - /// - public string query; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CheckGameLiveEnabledOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class CheckGameLiveEnabledSuccessCallbackOption { - /// - /// 错误信息 - /// - public string errMsg; - /// - /// 用户是否有直播权限 - /// - public bool isEnabled; - } - [Preserve] - public class OnGameLiveStateChangeCallbackResult { - /// - /// 当前直播状态 - /// state 合法值: - /// menuClick 用户点击右上角直播按钮 - /// start 开始直播 - /// end 直播结束 - /// - public string state; - /// - /// 当前直播id,只在 state 是 start 时会返回 (基础库v2.19.2开始支持) - /// - public string feedId; - } - [Preserve] - public class OnGameLiveStateChangeCallbackResponse { - /// - /// 开发者可通过 wx.onGameLiveStateChange 设置观众从直播间打开小游戏的 query 比如:'a=1&b=2' - /// - public string query; - } - [Preserve] - public class GameLiveState { - /// - /// 是否正在直播 - /// - public bool isLive; - } - [Preserve] - public class GetUserCurrentGameliveInfoOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetUserCurrentGameliveInfoSuccessCallbackOption { - /// - /// 最近几场直播的 feedId 列表 - /// - public string[] feedIdList; - } - [Preserve] - public class GetUserRecentGameLiveInfoOption { - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class GetUserGameLiveDetailsSuccessCallbackOption { - /// - /// 包括敏感数据在内的完整转发信息的加密数据,详细见加密数据解密算法 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html - /// - public string encryptedData; - /// - /// 加密算法的初始向量,详细见加密数据解密算法 - /// - public string iv; - /// - /// 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见云调用直接获取开放数据 - /// - public string cloudID; - /// - /// 最近几场直播的 feedId 列表 - /// - public string[] feedIdList; - /// - /// 错误信息 - /// - public string errMsg; - } - [Preserve] - public class GetUserGameLiveDetailsOption { - /// - /// 要查询的直播的id - /// - public string[] feedIdList; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - [Preserve] - public class OpenChannelsLiveCollectionOption { - /// - /// 支持填写最多4个openid,该用户的直播间将在直播专区置顶显示;可不填 - /// - public string[] openIds; - /// - /// 接口调用结束的回调函数(调用成功、失败都会执行) - /// - public Action complete; - /// - /// 接口调用失败的回调函数 - /// - public Action fail; - /// - /// 接口调用成功的回调函数 - /// - public Action success; - } - - [Preserve] - public class UpdateManager{ - private string instanceId; - public UpdateManager(string id) - { - instanceId = id; - } - /// - /// [UpdateManager.applyUpdate()](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.applyUpdate.html) - /// 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 `onUpdateReady` 回调)调用。 - /// **示例代码** - /// [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - /// - public void ApplyUpdate(){ - WXSDKManagerHandler.Instance.ApplyUpdate(instanceId); - } - /// - /// [UpdateManager.onCheckForUpdate(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.onCheckForUpdate.html) - /// 监听向微信后台请求检查更新结果事件。微信在小程序冷启动时自动检查更新,不需由开发者主动触发。 - /// **示例代码** - /// [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - /// - public void OnCheckForUpdate(Action callback){ - WXSDKManagerHandler.Instance.OnCheckForUpdate(instanceId, callback); - } - /// - /// [UpdateManager.onUpdateFailed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.onUpdateFailed.html) - /// 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调 - /// **示例代码** - /// [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - /// - public void OnUpdateFailed(Action callback){ - WXSDKManagerHandler.Instance.OnUpdateFailed(instanceId, callback); - } - /// - /// [UpdateManager.onUpdateReady(function callback)](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.onUpdateReady.html) - /// 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调 - /// **示例代码** - /// [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - /// - public void OnUpdateReady(Action callback){ - WXSDKManagerHandler.Instance.OnUpdateReady(instanceId, callback); - } - } - - -} diff --git a/Assets/WX-WASM-SDK/WXModels.cs.meta b/Assets/WX-WASM-SDK/WXModels.cs.meta deleted file mode 100644 index 5247b5e3..00000000 --- a/Assets/WX-WASM-SDK/WXModels.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2c831c1cdac0e49c2ae5896ae50de7b6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXOpenDataContext.cs b/Assets/WX-WASM-SDK/WXOpenDataContext.cs deleted file mode 100644 index 8d593bd0..00000000 --- a/Assets/WX-WASM-SDK/WXOpenDataContext.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -namespace WeChatWASM -{ - public class WXOpenDataContext - { - /// - /// 向开放数据域发送消息 - /// - /// 要发送的消息 - public void PostMessage(string msg) - { - WXSDKManagerHandler.Instance.OpenDataContextPostMessage(msg); - } - } -} diff --git a/Assets/WX-WASM-SDK/WXOpenDataContext.cs.meta b/Assets/WX-WASM-SDK/WXOpenDataContext.cs.meta deleted file mode 100644 index 58ca8cbb..00000000 --- a/Assets/WX-WASM-SDK/WXOpenDataContext.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c2ae68ef0c37ccd4e9100010de2b3d77 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXProfileStatsScript.cs b/Assets/WX-WASM-SDK/WXProfileStatsScript.cs deleted file mode 100644 index 8100d0ec..00000000 --- a/Assets/WX-WASM-SDK/WXProfileStatsScript.cs +++ /dev/null @@ -1,236 +0,0 @@ -using System.Text; -using Unity.Profiling; -using UnityEngine; -using UnityEngine.Profiling; -using System.Runtime.InteropServices; - -public class WXProfileStatsScript : MonoBehaviour -{ - string statsText; -#if UNITY_2021_2_OR_NEWER - //private ProfilerRecorder m_totalUsedMemoryRecorder; - //private ProfilerRecorder m_totalReservedMemoryRecorder; - //private ProfilerRecorder m_gcUsedMemoryRecorder; - //private ProfilerRecorder m_gcReservedMemoryRecorder; - //private ProfilerRecorder m_gfxUsedMemoryRecorder; - //private ProfilerRecorder m_gfxReservedMemoryRecorder; - - //private ProfilerRecorder m_systemUsedMemoryRecorder; - //private ProfilerRecorder m_textureCountRecorder; - //private ProfilerRecorder m_textureMemoryRecorder; - //private ProfilerRecorder m_meshCountRecorder; - //private ProfilerRecorder m_meshMemoryRecorder; - //private ProfilerRecorder m_materialCountRecorder; - //private ProfilerRecorder m_materialMemoryRecorder; - //private ProfilerRecorder m_animationClipCountRecorder; - //private ProfilerRecorder m_animationClipMemoryRecorder; - - //private ProfilerRecorder m_assetCountRecorder; - //private ProfilerRecorder m_gameObjectsInScenesRecorder; - //private ProfilerRecorder m_totalObjectsInScenesRecorder; - //private ProfilerRecorder m_totalUnityObjectCountRecorder; - //private ProfilerRecorder m_gcAllocationInFrameCountRecorder; - //private ProfilerRecorder m_gcAllocatedInFrameRecorder; - - - ProfilerRecorder m_setPassCallsRecorder; - ProfilerRecorder m_drawCallsRecorder; - ProfilerRecorder m_verticesRecorder; -#endif - private int m_fpsCount; - private float m_fpsDeltaTime; - private int fps; - private GUIStyle m_bgStyle; - private bool m_isShow = false; - System.Collections.Generic.Dictionary profValues = new System.Collections.Generic.Dictionary(); - - - private void Awake() - { - m_bgStyle = new GUIStyle(); - m_bgStyle.normal.background = Texture2D.whiteTexture; - } - - void OnEnable() - { - -#if UNITY_2021_2_OR_NEWER - //m_totalUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Total Used Memory"); - //m_totalReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Total Reserved Memory"); - //m_gcUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Used Memory"); - //m_gcReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Reserved Memory"); - //m_gfxUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Gfx Used Memory"); - //m_gfxReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Gfx Reserved Memory"); - //m_systemUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "System Used Memory"); - //m_textureCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Texture Count"); - //m_textureMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Texture Memory"); - //m_meshCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Mesh Count"); - //m_meshMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Mesh Memory"); - //m_materialCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Material Count"); - //m_materialMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Material Memory"); - //m_animationClipCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "AnimationClip Count"); - //m_animationClipMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "AnimationClip Memory"); - //m_assetCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Asset Count"); - //m_gameObjectsInScenesRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GameObject Count"); - //m_totalObjectsInScenesRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Scene Object Count"); - //m_totalUnityObjectCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Object Count"); - //m_gcAllocationInFrameCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Allocation In Frame Count"); - //m_gcAllocatedInFrameRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Allocated In Frame"); - m_setPassCallsRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "SetPass Calls Count"); - m_drawCallsRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Draw Calls Count"); - m_verticesRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Vertices Count"); -#endif - - } - - void OnDisable() - { -#if UNITY_2021_2_OR_NEWER - //m_totalUsedMemoryRecorder.Dispose(); - //m_totalReservedMemoryRecorder.Dispose(); - //m_gcUsedMemoryRecorder.Dispose(); - //m_gcReservedMemoryRecorder.Dispose(); - //m_gfxUsedMemoryRecorder.Dispose(); - //m_gfxReservedMemoryRecorder.Dispose(); - //m_systemUsedMemoryRecorder.Dispose(); - //m_textureCountRecorder.Dispose(); - //m_textureMemoryRecorder.Dispose(); - //m_meshCountRecorder.Dispose(); - //m_meshMemoryRecorder.Dispose(); - //m_materialCountRecorder.Dispose(); - //m_materialMemoryRecorder.Dispose(); - //m_animationClipCountRecorder.Dispose(); - //m_animationClipMemoryRecorder.Dispose(); - //m_assetCountRecorder.Dispose(); - //m_gameObjectsInScenesRecorder.Dispose(); - //m_totalObjectsInScenesRecorder.Dispose(); - //m_totalUnityObjectCountRecorder.Dispose(); - //m_gcAllocationInFrameCountRecorder.Dispose(); - //m_gcAllocatedInFrameRecorder.Dispose(); - m_setPassCallsRecorder.Dispose(); - m_drawCallsRecorder.Dispose(); - m_verticesRecorder.Dispose(); - -#endif - } - - class ProfValue - { - public long current; - public long max = 0; - public long min = 9999; - // public int avrage; - }; - private ProfValue UpdateValue(string key, long value, StringBuilder sb) - { - ProfValue profValue = null; - if (!profValues.TryGetValue(key, out profValue)) - { - profValue = new ProfValue(); - profValues.Add(key, profValue); - } - profValue.current = value; - profValue.max = value > profValue.max ? value : profValue.max; - profValue.min = value < profValue.min ? value : profValue.min; - sb.AppendLine($"{key}:[{profValue.current}, {profValue.min}, {profValue.max}]"); - return profValue; - } - - void Update() - { - UpdateFps(); - const uint toMB = 1024 * 1024; - var sb = new StringBuilder(500); - sb.AppendLine($"-------------FPS---------------"); - //var key = "targetFrameRate"; - UpdateValue("targetFrameRate", Application.targetFrameRate, sb); - UpdateValue("FPS", fps, sb); - - sb.AppendLine($"-------------Profiler------------"); - - UpdateValue("MonoHeapReserved", Profiler.GetMonoHeapSizeLong() / toMB, sb); - UpdateValue("MonoHeapUsed", Profiler.GetMonoUsedSizeLong() / toMB, sb); - // UpdateValue("Graphics", Profiler.GetAllocatedMemoryForGraphicsDriver() / toMB, sb); - - // UpdateValue("TempAllocator", Profiler.GetTempAllocatorSize() / toMB, sb); - UpdateValue("NativeReserved", Profiler.GetTotalReservedMemoryLong() / toMB, sb); - UpdateValue("NativeUnused", Profiler.GetTotalUnusedReservedMemoryLong() / toMB, sb); - UpdateValue("NativeAllocated", Profiler.GetTotalAllocatedMemoryLong() / toMB, sb); - - -#if UNITY_2021_2_OR_NEWER - sb.AppendLine("-------------Render------------"); - UpdateValue("SetPass Calls", m_setPassCallsRecorder.LastValue, sb); - UpdateValue("Draw Calls", m_drawCallsRecorder.LastValue, sb); - UpdateValue("Vertices", m_verticesRecorder.LastValue, sb); -#endif - sb.AppendLine("-------------WebAssembly----------"); - UpdateValue("TotalHeapMemory", WeChatWASM.WX.GetTotalMemorySize() / toMB, sb); - UpdateValue("DynamicMemory", WeChatWASM.WX.GetDynamicMemorySize() / toMB, sb); - UpdateValue("UsedHeapMemory", WeChatWASM.WX.GetUsedMemorySize() / toMB, sb); - UpdateValue("UnAllocatedMemory", WeChatWASM.WX.GetUnAllocatedMemorySize() / toMB, sb); - - - -#if UNITY_2021_2_OR_NEWER - //sb.AppendLine("-------------MemoryRecorder-----"); - //UpdateValue("Total Used Memory", m_totalUsedMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("Total Reserved Memory", m_totalReservedMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("GC Used Memory", m_gcUsedMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("GC Reserved Memory", m_gcReservedMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("Gfx Used Memory", m_gfxUsedMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("Gfx Reserved Memory", m_gfxReservedMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("System Used Memory", m_systemUsedMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("Texture Count", m_textureCountRecorder.LastValue, sb); - //UpdateValue("Texture Memory", m_textureMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("Mesh Count", m_meshCountRecorder.LastValue, sb); - //UpdateValue("Mesh Memory", m_meshMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("Material Count", m_materialCountRecorder.LastValue, sb); - //UpdateValue("Material Memory", m_materialMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("AnimationClip Count", m_animationClipCountRecorder.LastValue, sb); - //UpdateValue("AnimationClip Memory", m_animationClipMemoryRecorder.LastValue / toMB, sb); - //UpdateValue("Asset Count", m_assetCountRecorder.LastValue, sb); - //UpdateValue("GameObject Count", m_gameObjectsInScenesRecorder.LastValue, sb); - //UpdateValue("Scene Object Count", m_totalObjectsInScenesRecorder.LastValue, sb); - //UpdateValue("Object Count", m_totalUnityObjectCountRecorder.LastValue, sb); - //UpdateValue("GC Allocation In Frame Count", m_gcAllocationInFrameCountRecorder.LastValue, sb); - //UpdateValue("GC Allocated In Frame", m_gcAllocatedInFrameRecorder.LastValue / toMB, sb); -#endif - statsText = sb.ToString(); - - } - - void UpdateFps() - { - m_fpsCount++; - m_fpsDeltaTime += Time.deltaTime; - - if (m_fpsCount % 60 == 0) - { - m_fpsCount = 1; - fps = (int)Mathf.Ceil(60.0f / m_fpsDeltaTime); - m_fpsDeltaTime = 0; - } - } - - void OnGUI() - { - - GUI.backgroundColor = new Color(0, 0, 0, 0.5f); -#if UNITY_EDITOR - GUI.skin.button.fontSize = 10; - GUI.skin.label.fontSize = 10; -#else - GUI.skin.button.fontSize = 30; - GUI.skin.label.fontSize = 30; -#endif - if (GUILayout.Button("Performence Stats", GUILayout.ExpandWidth(false))){ - m_isShow = !m_isShow; - } - GUILayout.BeginVertical(m_bgStyle); - if (m_isShow){ - GUILayout.Label(statsText); - } - GUILayout.EndVertical(); - } -} diff --git a/Assets/WX-WASM-SDK/WXProfileStatsScript.cs.meta b/Assets/WX-WASM-SDK/WXProfileStatsScript.cs.meta deleted file mode 100644 index 9e5b92d6..00000000 --- a/Assets/WX-WASM-SDK/WXProfileStatsScript.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 008ab16b429998940b6fd4e5e0049629 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXRewardedVideoAd.cs b/Assets/WX-WASM-SDK/WXRewardedVideoAd.cs deleted file mode 100644 index f15e04f7..00000000 --- a/Assets/WX-WASM-SDK/WXRewardedVideoAd.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using UnityEngine; - -namespace WeChatWASM -{ - /// - /// 激励视频广告,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/rewarded-video-ad.html - /// - public class WXRewardedVideoAd : WXBaseAd, IWXAdVideoCloseable - { - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WXRewardedVideoAdReportShareBehavior(string id, string conf); - - public WXRewardedVideoAd(string id) : base(id) - { - - } - - public void OnCloseCallback(WXRewardedVideoAdOnCloseResponse res) - { - onCloseAction?.Invoke(res); - } - - - public Action onCloseAction; - /// - /// 加载激励视频广告 - /// - public void Load(Action success = null, Action failed = null) - { - WXSDKManagerHandler.Instance.ADLoad(instanceId, WXCallBackHandler.Add(success), WXCallBackHandler.Add(failed)); - } - - /// - /// 监听用户点击 关闭广告 按钮的事件。 - /// - /// 用户点击 关闭广告 按钮的事件的回调函数 - public void OnClose(Action action) - { - onCloseAction += action; - } - - /// - /// 取消监听用户点击 关闭广告 按钮的事件 - /// - /// 用户点击 关闭广告 按钮的事件的回调函数 - public void OffClose(Action action) - { - onCloseAction -= action; - } - - /// - /// 上报行为 - /// 需要基础库: `2.24.5` - /// - public WXRewardedVideoAdReportShareBehaviorResponse ReportShareBehavior(RequestAdReportShareBehaviorParam param) - { - var res = WXRewardedVideoAdReportShareBehavior(instanceId, JsonUtility.ToJson(param)); - return JsonUtility.FromJson(res); - } - } -} - diff --git a/Assets/WX-WASM-SDK/WXRewardedVideoAd.cs.meta b/Assets/WX-WASM-SDK/WXRewardedVideoAd.cs.meta deleted file mode 100644 index 8c1455e0..00000000 --- a/Assets/WX-WASM-SDK/WXRewardedVideoAd.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b39af91b1fd933e46b255bddc3e2cdb5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXSDKManagerHandler.cs b/Assets/WX-WASM-SDK/WXSDKManagerHandler.cs deleted file mode 100644 index a24b1de4..00000000 --- a/Assets/WX-WASM-SDK/WXSDKManagerHandler.cs +++ /dev/null @@ -1,11061 +0,0 @@ -using UnityEngine; -using System.Runtime.InteropServices; -using System; -using LitJson; -using System.Collections.Generic; -using UnityEngine.Scripting; -using AOT; - -namespace WeChatWASM -{ - public class WXSDKManagerHandler : MonoBehaviour - { - - #region Instance - - private static WXSDKManagerHandler instance = null; - - - public static WXSDKManagerHandler Instance - { - get - { - if (instance == null) - { - if (!Application.isPlaying) - { - Debug.LogError("不支持在非播放模式下调用WX接口"); - return null; - } - instance = new GameObject(typeof(WXSDKManagerHandler).Name).AddComponent(); - DontDestroyOnLoad(instance.gameObject); - #if UNITY_UI_FAIRYGUI || UNITY_UI_UGUI || UNITY_UI_NGUI - UnityDumper monkeyInstance = new GameObject("monkeyInstance").AddComponent(typeof(UnityDumper)) as UnityDumper; - DontDestroyOnLoad(monkeyInstance.gameObject); - SetUnityUIType("unity_ui"); - #else - SetUnityUIType("unity_no_ui"); - #endif - } - return instance; - } - } - - private static WXEnv env = null; - - public static WXEnv Env - { - get - { - if (env == null) - { - env = new WXEnv(); - } - return env; - } - } - - private static Cloud _cloud = null; - - public static Cloud cloud - { - get - { - if (_cloud == null) - { - _cloud = new Cloud(); - } - return _cloud; - } - } - - - protected void OnDestroy() - { - if (instance != null) - instance = null; - } - - #endregion - - - - - #region C#调用JS桥接方法 - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXInitializeSDK(string s); -#else - private void WXInitializeSDK(string s) - { - initCallback(200); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXStorageSetIntSync(string key, int value); -#else - void WXStorageSetIntSync(string key, int value) - { - UnityEngine.PlayerPrefs.SetInt(key, value); - } -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern int WXStorageGetIntSync(string key, int defaultValue); -#else - int WXStorageGetIntSync(string key, int defaultValue) - { - return UnityEngine.PlayerPrefs.GetInt(key,defaultValue); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXStorageSetStringSync(string key, string value); -#else - void WXStorageSetStringSync(string key, string value) - { - UnityEngine.PlayerPrefs.SetString(key, value); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern string WXStorageGetStringSync(string key, string defaultValue); -#else - string WXStorageGetStringSync(string key, string defaultValue) - { - return UnityEngine.PlayerPrefs.GetString(key, defaultValue); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXStorageSetFloatSync(string key, float value); -#else - void WXStorageSetFloatSync(string key, float value) - { - UnityEngine.PlayerPrefs.SetFloat(key, value); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern float WXStorageGetFloatSync(string key, float defaultValue); -#else - float WXStorageGetFloatSync(string key, float defaultValue) - { - return UnityEngine.PlayerPrefs.GetFloat(key, defaultValue); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXStorageDeleteAllSync(); -#else - void WXStorageDeleteAllSync() - { - UnityEngine.PlayerPrefs.DeleteAll(); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXStorageDeleteKeySync(string key); -#else - void WXStorageDeleteKeySync(string key) - { - UnityEngine.PlayerPrefs.DeleteKey(key); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern bool WXStorageHasKeySync(string key); -#else - bool WXStorageHasKeySync(string key) - { - return UnityEngine.PlayerPrefs.HasKey(key); - } -#endif - - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateUserInfoButton(int x, int y, int width, int height, string lang, bool withCredentials); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXOnShareAppMessage(string conf, bool isPromise); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXOnShareAppMessageResolve(string conf); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateBannerAd(string conf); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateRewardedVideoAd(string conf); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateInterstitialAd(string conf); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateGridAd(string conf); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateCustomAd(string conf); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXADStyleChange(string id, string key, int value); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXShowAd(string id, string succ, string fail); -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXShowAd2(string id, string branchId, string branchDim, string succ, string fail); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXHideAd(string id, string succ, string fail); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern int WXADGetStyleValue(string id, string key); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern int WXADDestroy(string id); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern int WXADLoad(string id, string succ, string fail); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateFixedBottomMiddleBannerAd(string adUnitId, int adIntervals, int height); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXDataContextPostMessage(string msg); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXShowOpenData(IntPtr id, int x, int y, int width, int height); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXHideOpenData(); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXReportGameStart(); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXSetGameStage(int stageType); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXReportGameStageCostTime(int costTime, string extJsonStr); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXReportGameStageError(int errorType, string errStr, string extJsonStr); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXWriteLog(string str); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXWriteWarn(string str); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXHideLoadingPage(); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXPreloadConcurrent(int count); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXReportUserBehaviorBranchAnalytics(string branchId, string branchDim, int eventType); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateInnerAudioContext(string src, bool loop, float startTime, bool autoplay, float volume, float playbackRate, bool needDownload); - - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXPreDownloadAudios(string paths, int num); -#else - private static void WXPreDownloadAudios(string paths, int num) - { - var action = PreDownloadAudiosAction[num]; - action.Invoke(0); - } -#endif - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateVideo(string conf); - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern string WXCreateGameClubButton(string conf); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubStyleChangeInt(string id, string key, int value); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXGameClubStyleChangeStr(string id, string key, string value); - - - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void SetUnityUIType(string paths); -#else - private static void SetUnityUIType(string paths) { } -#endif - #endregion - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern uint WXGetTotalMemorySize(); - - [DllImport("__Internal")] - private static extern uint WXGetTotalStackSize(); - - [DllImport("__Internal")] - private static extern uint WXGetStaticMemorySize(); - - [DllImport("__Internal")] - private static extern uint WXGetDynamicMemorySize(); - - [DllImport("__Internal")] - private static extern uint WXGetUsedMemorySize(); - - [DllImport("__Internal")] - private static extern uint WXGetUnAllocatedMemorySize(); - - [DllImport("__Internal")] - private static extern void WXLogManagerDebug(string str); - - [DllImport("__Internal")] - private static extern void WXLogManagerInfo(string str); - - [DllImport("__Internal")] - private static extern void WXLogManagerLog(string str); - - [DllImport("__Internal")] - private static extern void WXLogManagerWarn(string str); - - [Preserve] - [DllImport("__Internal")] - private static extern void WXPointer_stringify_adaptor(); - - -#else - private static uint WXGetTotalMemorySize() { return 0; } - private static uint WXGetTotalStackSize() { return 0; } - private static uint WXGetStaticMemorySize() { return 0; } - private static uint WXGetDynamicMemorySize() { return 0; } - private static uint WXGetUsedMemorySize() { return 0; } - private static uint WXGetUnAllocatedMemorySize() { return 0; } - - private static void WXLogManagerDebug(string str) { - Debug.Log(str); - } - - private static void WXLogManagerInfo(string str) - { - Debug.Log(str); - } - - private static void WXLogManagerLog(string str) - { - Debug.Log(str); - } - - private static void WXLogManagerWarn(string str) - { - Debug.LogWarning(str); - } - -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern bool WXIsCloudTest(); -#else - private static bool WXIsCloudTest() { return false; } -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXUncaughtException(); -#else - private static void WXUncaughtException() {; } -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern int WXCreateUDPSocket(string ip, int remotePort, int bindPort); -#else - private int WXCreateUDPSocket(string ip, int remotePort, int bindPort) - { - throw new NotImplementedException(); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXCloseUDPSocket(int socketId); -#else - private void WXCloseUDPSocket(int socketId) - { - throw new NotImplementedException(); - } -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXSendUDPSocket(int socketId, byte[] buffer, int offset, int length); -#else - private void WXSendUDPSocket(int socketId, byte[] buffer, int offset, int length) - { - throw new NotImplementedException(); - } -#endif - - -#if UNITY_WEBGL && !UNITY_EDITOR - - public delegate void OnMessageCallback(int instanceId, IntPtr msgPtr, int msgSize); - public delegate void OnErrorCallback(int instanceId, IntPtr errorPtr); - public delegate void OnCloseCallback(int instanceId, IntPtr reasonPtr); - [DllImport("__Internal")] - public static extern void WXUDPSocketSetOnMessage(OnMessageCallback callback); - [DllImport("__Internal")] - public static extern void WXUDPSocketSetOnClose(OnCloseCallback callback); - [DllImport("__Internal")] - public static extern void WXUDPSocketSetOnError(OnErrorCallback callback); - - [MonoPInvokeCallback(typeof(OnMessageCallback))] - public static void DelegateOnMessageEvent(int instanceId, IntPtr msgPtr, int msgSize) - { - - var bytes = new byte[msgSize]; - Marshal.Copy(msgPtr, bytes, 0, msgSize); - UDPSocketManager.Instance.OnMessage(instanceId, bytes); - } - [MonoPInvokeCallback(typeof(OnCloseCallback))] - public static void DelegateOnCloseEvent(int instanceId, IntPtr reasonPtr) - { - string reason = Marshal.PtrToStringAuto(reasonPtr); - UDPSocketManager.Instance.OnClose(instanceId, reason); - } - [MonoPInvokeCallback(typeof(OnErrorCallback))] - public static void DelegateOnErrorEvent(int instanceId, IntPtr errorPtr) - { - string errorMsg = Marshal.PtrToStringAuto(errorPtr); - UDPSocketManager.Instance.OnError(instanceId, errorMsg); - } - -#endif - - - - #region JS回调 - - public void Inited(int code) - { - initCallback(code); - } - - public void TextResponseCallback(string msg) - { - WXCallBackHandler.InvokeResponseCallback(msg); - } - - public void TextResponseLongCallback(string msg) - { - WXLongCallBackHandler.InvokeResponseCallback(msg); - } - - - public void CloudCallFunctionResponseCallback(string msg) - { - WXCallBackHandler.InvokeResponseCallback(msg); - } - - - public void UserInfoButtonOnTapCallback(string msg) - { - WXCallBackHandler.InvokeUserInfoButtonCallback(msg); - } - - public void OnShareAppMessageCallback() - { - onShareAppMessageCallback?.Invoke((WXShareAppMessageParam param) => - { - if (param == null) - { - param = new WXShareAppMessageParam(); - } - WXOnShareAppMessageResolve(JsonUtility.ToJson(param)); - }); - - } - - - public void ADOnErrorCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - if (WXBaseAd.Dict.ContainsKey(res.callbackId)) - { - WXBaseAd.Dict[res.callbackId].onErrorAction?.Invoke(res); - } - } - - public void ADOnLoadCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - if (WXBaseAd.Dict.ContainsKey(res.callbackId)) - { - WXBaseAd.Dict[res.callbackId].onLoadActon?.Invoke(res); - } - } - - - public void ADOnResizeCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - - if (WXBaseAd.Dict.ContainsKey(res.callbackId)) - { - var ad = (IWXAdResizable)WXBaseAd.Dict[res.callbackId]; - ad.OnResizeCallback(res); - } - } - - public void ADOnVideoCloseCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - - - if (WXBaseAd.Dict.ContainsKey(res.callbackId)) - { - var ad = (IWXAdVideoCloseable)WXBaseAd.Dict[res.callbackId]; - ad.OnCloseCallback(res); - } - } - - public void ADOnCloseCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - - - if (WXBaseAd.Dict.ContainsKey(res.callbackId)) - { - var ad = (IWXADCloseable)WXBaseAd.Dict[res.callbackId]; - ad.OnCloseCallback(); - } - } - - - public void ADLoadErrorCallback(string msg) - { - WXCallBackHandler.InvokeResponseCallback(msg); - } - - - public void OnGameClubButtonCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - - if (WXGameClubButton.Dict.ContainsKey(res.callbackId)) { - var gameClubButton = WXGameClubButton.Dict[res.callbackId]; - gameClubButton._HandleCallBack(res.errMsg); - } - - } - - public void OnAudioCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - - if (WXInnerAudioContext.Dict.ContainsKey(res.callbackId)) { - var audio = WXInnerAudioContext.Dict[res.callbackId]; - audio._HandleCallBack(res.errMsg); - } - - } - - public void WXPreDownloadAudiosCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - int.TryParse(res.callbackId, out int id); - if (PreDownloadAudiosAction.ContainsKey(id)) { - var action = PreDownloadAudiosAction[id]; - action.Invoke(res.errMsg == "0" ? 0 : 1); - } - - } - - public void OnVideoCallback(string msg) - { - var res = JsonUtility.FromJson(msg); - if (WXVideo._Dict.ContainsKey(res.callbackId)) { - var video = WXVideo._Dict[res.callbackId]; - video._HandleCallBack(res); - } - - } - - public void ReadFileCallback(string msg) - { - WXFileSystemManager.HanldReadFileCallback(msg); - } - - public void ToTempFilePathCallback(string msg) - { - WXCallBackHandler.InvokeResponseCallback(msg); - } - - -#endregion - - - - #region 初始化SDK - public void InitSDK(Action callback) - { - - initCallback = callback; - - WXInitializeSDK(Application.unityVersion); - -#if UNITY_WEBGL && !UNITY_EDITOR - WXUDPSocketSetOnMessage(DelegateOnMessageEvent); - WXUDPSocketSetOnClose(DelegateOnCloseEvent); - WXUDPSocketSetOnError(DelegateOnErrorEvent); -#endif - } - - - private Action initCallback; - - - -#endregion - - - - -#region 本地存储 - // 更多关于存储的隔离策略和清理策略说明可以查看这里 https://developers.weixin.qq.com/minigame/dev/guide/base-ability/storage.html - - /* - * @description 同步设置int型数据存储, - * @param key 键名 - * @param value 数值 - */ - public void StorageSetIntSync(string key, int value) - { - WXStorageSetIntSync(key, value); - } - - - /* - * @description 同步获取之前设置过的int型数据, - * @param key 键名 - * @param defaultValue 默认值 - * @returns 异常的和空时候会返回默认值 - */ - public int StorageGetIntSync(string key, int defaultValue) - { - return WXStorageGetIntSync(key, defaultValue); - } - - - - /* - * @description 同步设置string型数据存储, - * @param key 键名 - * @param value 数值 - */ - public void StorageSetStringSync(string key, string value) - { - WXStorageSetStringSync(key, value); - } - - - /* - * @description 同步获取之前设置过的string型数据, - * @param key 键名 - * @param defaultValue 默认值 - * @returns 异常的和空时候会返回默认值 - */ - public string StorageGetStringSync(string key, string defaultValue) - { - return WXStorageGetStringSync(key, defaultValue); - } - - - /* - * @description 同步设置float型数据存储, - * @param key 键名 - * @param value 数值 - */ - public void StorageSetFloatSync(string key, float value) - { - WXStorageSetFloatSync(key, value); - } - - - /* - * @description 同步获取之前设置过的float型数据, - * @param key 键名 - * @param defaultValue 默认值 - * @returns 异常的和空时候会返回默认值 - */ - public float StorageGetFloatSync(string key, float defaultValue) - { - return WXStorageGetFloatSync(key, defaultValue); - } - - /* - * @description 同步删除所有数据 - */ - public void StorageDeleteAllSync() - { - WXStorageDeleteAllSync(); - } - - - - /* - * @description 同步删除对应一个key的数据 - * @param key 键名 - */ - public void StorageDeleteKeySync(string key) - { - WXStorageDeleteKeySync(key); - } - - - public bool StorageHasKeySync(string key) - { - return WXStorageHasKeySync(key); - } - -#endregion - - - -#region 用户信息 - - - public WXUserInfoButton CreateUserInfoButton(int x, int y, int width, int height, string lang, bool withCredentials) - { - string id = WXCreateUserInfoButton(x, y, width, height, lang, withCredentials); - - var button = new WXUserInfoButton(id); - - WXUserInfoButton.Dict.Add(id, button); - - return button; - - } - - -#endregion - - - -#region 分享转发 - - private Action> onShareAppMessageCallback; - - public void OnShareAppMessage(WXShareAppMessageParam defaultParam, Action> action) - { - if (defaultParam == null) - { - defaultParam = new WXShareAppMessageParam(); - } - WXOnShareAppMessage(JsonUtility.ToJson(defaultParam), action != null); - onShareAppMessageCallback = action; - } - -#endregion - - -#region 广告 - - public WXBannerAd CreateBannerAd(WXCreateBannerAdParam param) - { - if (param == null) - { - param = new WXCreateBannerAdParam(); - } - param.styleRaw = JsonUtility.ToJson(param.style); - - string id = WXCreateBannerAd(JsonUtility.ToJson(param)); - - return new WXBannerAd(id, param.style); - } - - public WXBannerAd CreateFixedBottomMiddleBannerAd(string adUnitId, int adIntervals, int height) - { - string id = WXCreateFixedBottomMiddleBannerAd(adUnitId, adIntervals, height); - - return new WXBannerAd(id, new Style() - { - height = height - }); - - } - - - public WXRewardedVideoAd CreateRewardedVideoAd(WXCreateRewardedVideoAdParam param) - { - if (param == null) - { - param = new WXCreateRewardedVideoAdParam(); - } - - string id = WXCreateRewardedVideoAd(JsonUtility.ToJson(param)); - - return new WXRewardedVideoAd(id); - } - - public WXInterstitialAd CreateInterstitialAd(WXCreateInterstitialAdParam param) - { - - if (param == null) - { - param = new WXCreateInterstitialAdParam(); - } - string id = WXCreateInterstitialAd(JsonUtility.ToJson(param)); - - return new WXInterstitialAd(id); - } - - public WXGridAd CreateGridAd(WXCreateGridAdParam param) - { - if (param == null) - { - param = new WXCreateGridAdParam(); - } - param.styleRaw = JsonUtility.ToJson(param.style); - - string id = WXCreateGridAd(JsonUtility.ToJson(param)); - - return new WXGridAd(id, param.style); - } - - public WXCustomAd CreateCustomAd(WXCreateCustomAdParam param) - { - if (param == null) - { - param = new WXCreateCustomAdParam(); - } - param.styleRaw = JsonUtility.ToJson(param.style); - - string id = WXCreateCustomAd(JsonUtility.ToJson(param)); - - return new WXCustomAd(id, param.style); - } - - public void ADStyleChange(string id, string key, int value) - { - WXADStyleChange(id, key, value); - } - - public void ShowAd(string id, string succ, string fail) - { - WXShowAd(id, succ, fail); - } - - internal int CreateUDPSocket(string ip, int remotePort, int bindPort) - { - return WXCreateUDPSocket(ip, remotePort, bindPort); - } - - internal void CloseUDPSocket(int socketId) - { - WXCloseUDPSocket(socketId); - } - - internal void SendUDPSocket(int socketId, byte[] buffer, int offset, int length) - { - WXSendUDPSocket(socketId, buffer, offset, length); - } - - public void ShowAd(string id, string branchId, string branchDim, string succ, string fail) - { - WXShowAd2(id, branchId, branchDim, succ, fail); - } - - public void HideAd(string id, string succ = "", string fail = "") - { - WXHideAd(id, succ, fail); - } - - public int ADGetStyleValue(string id, string key) - { - return WXADGetStyleValue(id, key); - } - - public void ADDestroy(string id) - { - WXADDestroy(id); - } - - public void ADLoad(string id, string succ, string fail) - { - WXADLoad(id, succ, fail); - } - -#endregion - - -#region 开放数据域,排行榜这一类 - - public void OpenDataContextPostMessage(string msg) - { - WXDataContextPostMessage(msg); - } - - - public void ShowOpenData(Texture texture, int x, int y, int width, int height) - { - WXShowOpenData(texture.GetNativeTexturePtr(), x, y, width, height); - } - - - public void HideOpenData() - { - WXHideOpenData(); - } - - - -#endregion - - -#region 游戏上报 - - public void ReportGameStart() - { - WXReportGameStart(); - } - - public void SetGameStage(int stageType) - { - WXSetGameStage(stageType); - } - - public void ReportGameStageCostTime(int costTime, string extJsonStr) - { - WXReportGameStageCostTime(costTime, extJsonStr); - } - - public void ReportGameStageError(int errorType, string errStr, string extJsonStr) - { - WXReportGameStageError(errorType, errStr, extJsonStr); - } - - public void WriteLog(string str) - { - WXWriteLog(str); - } - - public void WriteWarn(string str) - { - WXWriteWarn(str); - } - - public void HideLoadingPage() - { - WXHideLoadingPage(); - } - - public void PreloadConcurrent(int count) - { - WXPreloadConcurrent(count); - } - - public void ReportUserBehaviorBranchAnalytics(string branchId, string branchDim, int eventType) - { - WXReportUserBehaviorBranchAnalytics(branchId, branchDim, eventType); - } - -#endregion - - -#region 音频 - public WXInnerAudioContext CreateInnerAudioContext(InnerAudioContextParam param = null) - { - if (param == null) - { - param = new InnerAudioContextParam(); - } -#if UNITY_WEBGL && !UNITY_EDITOR - var id = WXCreateInnerAudioContext(param.src, param.loop, param.startTime, param.autoplay, param.volume, param.playbackRate, param.needDownload); - return new WXInnerAudioContext(id, param); -#else - var rd = UnityEngine.Random.Range(0f, 1000000f); - var id2 = rd.ToString() + param.src; - return new WXInnerAudioContext(id2, param); -#endif - } - - private static Dictionary> PreDownloadAudiosAction = new Dictionary>(); - - - public void PreDownloadAudios(string[] pathList, Action action) - { - int num = PreDownloadAudiosAction.Count; - PreDownloadAudiosAction.Add(num, action); - WXPreDownloadAudios(string.Join(",", pathList), num); - } - -#endregion - -#region 视频 - public WXVideo CreateVideo(WXCreateVideoParam param) - { - -#if UNITY_WEBGL && !UNITY_EDITOR - var id = WXCreateVideo(JsonUtility.ToJson(param)); - return new WXVideo(id, param); - -#else - var rd = UnityEngine.Random.Range(0f, 1000000f); - var id2 = rd.ToString() + param.src; - return new WXVideo(id2, param); -#endif - } -#endregion - - -#region 性能 - public uint GetTotalMemorySize() - { - return WXGetTotalMemorySize(); - } - public uint GetTotalStackSize() - { - return WXGetStaticMemorySize(); - } - public uint GetStaticMemorySize() - { - return WXGetStaticMemorySize(); - } - public uint GetDynamicMemorySize() - { - return WXGetDynamicMemorySize(); - } - public uint GetUsedMemorySize() - { - return WXGetUsedMemorySize(); - } - public uint GetUnAllocatedMemorySize() - { - return WXGetUnAllocatedMemorySize(); - } - public void LogUnityHeapMem() - { - const uint sizeInMB = 1024 * 1024; - var total = GetTotalMemorySize() / sizeInMB; - var dynamic = WXGetDynamicMemorySize() / sizeInMB; - Debug.Log($"WebGL Memory - Total:{total}MB, Dynamic:{dynamic}MB, " + - $"MonoUsedSize:{UnityEngine.Profiling.Profiler.GetMonoUsedSizeLong() / sizeInMB}MB," + - $"MonoHeapSize:{UnityEngine.Profiling.Profiler.GetMonoHeapSizeLong() / sizeInMB}MB"); - - } - - public void OpenProfileStats() - { - this.gameObject.AddComponent(); - } - #endregion - - -#region 用户日志(MP后台可下载的用户日志) - - public void LogManagerDebug(string str) - { - WXLogManagerDebug(str); - } - - public void LogManagerInfo(string str) - { - WXLogManagerInfo(str); - } - - public void LogManagerLog(string str) - { - WXLogManagerLog(str); - } - - public void LogManagerWarn(string str) - { - WXLogManagerWarn(str); - } -#endregion - -#region 云测试 - public bool IsCloudTest() - { - return WXIsCloudTest(); - } -#endregion - -#region 异常上报 - public void UncaughtException() - { - WXUncaughtException(); - } - #endregion - - - - - #region 交互 - - - public WXGameClubButton CreateGameClubButton(WXCreateGameClubButtonParam param) - { - -#if UNITY_WEBGL && !UNITY_EDITOR - param.styleRaw = JsonUtility.ToJson(param.style); - var id = WXCreateGameClubButton(JsonUtility.ToJson(param)); - return new WXGameClubButton(id, param.style); -#else - var id = UnityEngine.Random.Range(0f, 1000000f).ToString(); - return new WXGameClubButton(id, param.style); -#endif - } - - public void GameClubStyleChangeInt(string id, string key, int value) - { - WXGameClubStyleChangeInt(id, key, value); - } - - public void GameClubStyleChangeStr(string id, string key, string value) - { - WXGameClubStyleChangeStr(id, key, value); - } - - #endregion - - #region 文件缓存清理 - public void CleanAllFileCache(Action action) - { - new WXFileCacheCleanTask(true, action); - } - public void CleanAllFileCacheCallback(string msg) { - if (!string.IsNullOrEmpty(msg)) { - var res = JsonUtility.FromJson(msg); - var id = res.callbackId; - var result = res.result; - if (WXFileCacheCleanTask.Dict.ContainsKey(id)) { - WXFileCacheCleanTask.Dict[id].OnCleanAllFileCacheAction?.Invoke(result); - WXFileCacheCleanTask.Dict.Remove(id); - } - } - } - public void CleanFileCache(int fileSize, Action action) - { - new WXFileCacheCleanTask(fileSize, action); - } - public void CleanFileCacheCallback(string msg) { - if (!string.IsNullOrEmpty(msg)) { - var res = JsonUtility.FromJson(msg); - var id = res.callbackId; - var result = res.result; - if (WXFileCacheCleanTask.Dict.ContainsKey(id)) { - WXFileCacheCleanTask.Dict[id].OnCleanFileCacheAction?.Invoke(result); - WXFileCacheCleanTask.Dict.Remove(id); - } - } - } - public void RemoveFile(string path, Action action) - { - new WXFileCacheCleanTask(path, action); - } - public void RemoveFileCallback(string msg) { - if (!string.IsNullOrEmpty(msg)) { - var res = JsonUtility.FromJson(msg); - var id = res.callbackId; - var result = res.result; - if (WXFileCacheCleanTask.Dict.ContainsKey(id)) { - WXFileCacheCleanTask.Dict[id].OnRemoveFileAction?.Invoke(result); - WXFileCacheCleanTask.Dict.Remove(id); - } - } - } - #endregion - - public void OnLaunchProgress(Action action) - { - new WXLaunchEventListener(action); - } - - public void OnLaunchProgressCallback(string msg) { - if (!string.IsNullOrEmpty(msg)) { - var result = JsonUtility.FromJson(msg); - var id = result.callbackId; - var res = result.res; - if (WXLaunchEventListener.Dict.ContainsKey(id)) { - WXLaunchEventListener.Dict[id].OnLaunchProgressAction?.Invoke(JsonMapper.ToObject(res)); - } - } - } - - public void RemoveLaunchProgressCallback(string msg) { - if (!string.IsNullOrEmpty(msg)) { - var result = JsonUtility.FromJson(msg); - var id = result.callbackId; - if (WXLaunchEventListener.Dict.ContainsKey(id)) { - WXLaunchEventListener.Dict.Remove(id); - } - } - } - - - - private string GetCallbackId(Dictionary dict) { - var id = dict.Count; - var res = (id + UnityEngine.Random.value).ToString(); - while (dict.ContainsKey(res)) - { - id++; - res = (id + UnityEngine.Random.value).ToString(); - } - return res; - } - public void AddCardCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && AddCardOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(AddCardOptionList.ContainsKey(id)){ - var item = AddCardOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - AddCardOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_AddCard(string conf, string callbackId); - #else - private void WX_AddCard(string conf, string callbackId){} - #endif - - private Dictionary AddCardOptionList; - public void AddCard(AddCardOption option) - { - if(AddCardOptionList == null){ - AddCardOptionList = new Dictionary(); - } - string id = GetCallbackId(AddCardOptionList); - var callback = new AddCardOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - AddCardOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_AddCard(conf,id); - } - public void AuthPrivateMessageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && AuthPrivateMessageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(AuthPrivateMessageOptionList.ContainsKey(id)){ - var item = AuthPrivateMessageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - AuthPrivateMessageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_AuthPrivateMessage(string conf, string callbackId); - #else - private void WX_AuthPrivateMessage(string conf, string callbackId){} - #endif - - private Dictionary AuthPrivateMessageOptionList; - public void AuthPrivateMessage(AuthPrivateMessageOption option) - { - if(AuthPrivateMessageOptionList == null){ - AuthPrivateMessageOptionList = new Dictionary(); - } - string id = GetCallbackId(AuthPrivateMessageOptionList); - var callback = new AuthPrivateMessageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - AuthPrivateMessageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_AuthPrivateMessage(conf,id); - } - public void AuthorizeCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && AuthorizeOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(AuthorizeOptionList.ContainsKey(id)){ - var item = AuthorizeOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - AuthorizeOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_Authorize(string conf, string callbackId); - #else - private void WX_Authorize(string conf, string callbackId){} - #endif - - private Dictionary AuthorizeOptionList; - public void Authorize(AuthorizeOption option) - { - if(AuthorizeOptionList == null){ - AuthorizeOptionList = new Dictionary(); - } - string id = GetCallbackId(AuthorizeOptionList); - var callback = new AuthorizeOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - AuthorizeOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_Authorize(conf,id); - } - public void CheckHandoffEnabledCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CheckHandoffEnabledOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CheckHandoffEnabledOptionList.ContainsKey(id)){ - var item = CheckHandoffEnabledOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CheckHandoffEnabledOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CheckHandoffEnabled(string conf, string callbackId); - #else - private void WX_CheckHandoffEnabled(string conf, string callbackId){} - #endif - - private Dictionary CheckHandoffEnabledOptionList; - public void CheckHandoffEnabled(CheckHandoffEnabledOption option) - { - if(CheckHandoffEnabledOptionList == null){ - CheckHandoffEnabledOptionList = new Dictionary(); - } - string id = GetCallbackId(CheckHandoffEnabledOptionList); - var callback = new CheckHandoffEnabledOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CheckHandoffEnabledOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CheckHandoffEnabled(conf,id); - } - public void CheckIsUserAdvisedToRestCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CheckIsUserAdvisedToRestOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CheckIsUserAdvisedToRestOptionList.ContainsKey(id)){ - var item = CheckIsUserAdvisedToRestOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CheckIsUserAdvisedToRestOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CheckIsUserAdvisedToRest(string conf, string callbackId); - #else - private void WX_CheckIsUserAdvisedToRest(string conf, string callbackId){} - #endif - - private Dictionary CheckIsUserAdvisedToRestOptionList; - public void CheckIsUserAdvisedToRest(CheckIsUserAdvisedToRestOption option) - { - if(CheckIsUserAdvisedToRestOptionList == null){ - CheckIsUserAdvisedToRestOptionList = new Dictionary(); - } - string id = GetCallbackId(CheckIsUserAdvisedToRestOptionList); - var callback = new CheckIsUserAdvisedToRestOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CheckIsUserAdvisedToRestOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CheckIsUserAdvisedToRest(conf,id); - } - public void CheckSessionCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CheckSessionOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CheckSessionOptionList.ContainsKey(id)){ - var item = CheckSessionOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CheckSessionOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CheckSession(string conf, string callbackId); - #else - private void WX_CheckSession(string conf, string callbackId){} - #endif - - private Dictionary CheckSessionOptionList; - public void CheckSession(CheckSessionOption option) - { - if(CheckSessionOptionList == null){ - CheckSessionOptionList = new Dictionary(); - } - string id = GetCallbackId(CheckSessionOptionList); - var callback = new CheckSessionOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CheckSessionOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CheckSession(conf,id); - } - public void ChooseImageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ChooseImageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ChooseImageOptionList.ContainsKey(id)){ - var item = ChooseImageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ChooseImageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ChooseImage(string conf, string callbackId); - #else - private void WX_ChooseImage(string conf, string callbackId){} - #endif - - private Dictionary ChooseImageOptionList; - public void ChooseImage(ChooseImageOption option) - { - if(ChooseImageOptionList == null){ - ChooseImageOptionList = new Dictionary(); - } - string id = GetCallbackId(ChooseImageOptionList); - var callback = new ChooseImageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ChooseImageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ChooseImage(conf,id); - } - public void CloseBLEConnectionCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CloseBLEConnectionOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CloseBLEConnectionOptionList.ContainsKey(id)){ - var item = CloseBLEConnectionOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CloseBLEConnectionOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CloseBLEConnection(string conf, string callbackId); - #else - private void WX_CloseBLEConnection(string conf, string callbackId){} - #endif - - private Dictionary CloseBLEConnectionOptionList; - public void CloseBLEConnection(CloseBLEConnectionOption option) - { - if(CloseBLEConnectionOptionList == null){ - CloseBLEConnectionOptionList = new Dictionary(); - } - string id = GetCallbackId(CloseBLEConnectionOptionList); - var callback = new CloseBLEConnectionOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CloseBLEConnectionOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CloseBLEConnection(conf,id); - } - public void CloseBluetoothAdapterCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CloseBluetoothAdapterOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CloseBluetoothAdapterOptionList.ContainsKey(id)){ - var item = CloseBluetoothAdapterOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CloseBluetoothAdapterOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CloseBluetoothAdapter(string conf, string callbackId); - #else - private void WX_CloseBluetoothAdapter(string conf, string callbackId){} - #endif - - private Dictionary CloseBluetoothAdapterOptionList; - public void CloseBluetoothAdapter(CloseBluetoothAdapterOption option) - { - if(CloseBluetoothAdapterOptionList == null){ - CloseBluetoothAdapterOptionList = new Dictionary(); - } - string id = GetCallbackId(CloseBluetoothAdapterOptionList); - var callback = new CloseBluetoothAdapterOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CloseBluetoothAdapterOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CloseBluetoothAdapter(conf,id); - } - public void CloseSocketCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CloseSocketOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CloseSocketOptionList.ContainsKey(id)){ - var item = CloseSocketOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CloseSocketOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CloseSocket(string conf, string callbackId); - #else - private void WX_CloseSocket(string conf, string callbackId){} - #endif - - private Dictionary CloseSocketOptionList; - public void CloseSocket(CloseSocketOption option) - { - if(CloseSocketOptionList == null){ - CloseSocketOptionList = new Dictionary(); - } - string id = GetCallbackId(CloseSocketOptionList); - var callback = new CloseSocketOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CloseSocketOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CloseSocket(conf,id); - } - public void CreateBLEConnectionCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CreateBLEConnectionOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CreateBLEConnectionOptionList.ContainsKey(id)){ - var item = CreateBLEConnectionOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CreateBLEConnectionOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CreateBLEConnection(string conf, string callbackId); - #else - private void WX_CreateBLEConnection(string conf, string callbackId){} - #endif - - private Dictionary CreateBLEConnectionOptionList; - public void CreateBLEConnection(CreateBLEConnectionOption option) - { - if(CreateBLEConnectionOptionList == null){ - CreateBLEConnectionOptionList = new Dictionary(); - } - string id = GetCallbackId(CreateBLEConnectionOptionList); - var callback = new CreateBLEConnectionOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CreateBLEConnectionOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CreateBLEConnection(conf,id); - } - public void CreateBLEPeripheralServerCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CreateBLEPeripheralServerOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CreateBLEPeripheralServerOptionList.ContainsKey(id)){ - var item = CreateBLEPeripheralServerOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CreateBLEPeripheralServerOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CreateBLEPeripheralServer(string conf, string callbackId); - #else - private void WX_CreateBLEPeripheralServer(string conf, string callbackId){} - #endif - - private Dictionary CreateBLEPeripheralServerOptionList; - public void CreateBLEPeripheralServer(CreateBLEPeripheralServerOption option) - { - if(CreateBLEPeripheralServerOptionList == null){ - CreateBLEPeripheralServerOptionList = new Dictionary(); - } - string id = GetCallbackId(CreateBLEPeripheralServerOptionList); - var callback = new CreateBLEPeripheralServerOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CreateBLEPeripheralServerOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CreateBLEPeripheralServer(conf,id); - } - public void ExitMiniProgramCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ExitMiniProgramOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ExitMiniProgramOptionList.ContainsKey(id)){ - var item = ExitMiniProgramOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ExitMiniProgramOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ExitMiniProgram(string conf, string callbackId); - #else - private void WX_ExitMiniProgram(string conf, string callbackId){} - #endif - - private Dictionary ExitMiniProgramOptionList; - public void ExitMiniProgram(ExitMiniProgramOption option) - { - if(ExitMiniProgramOptionList == null){ - ExitMiniProgramOptionList = new Dictionary(); - } - string id = GetCallbackId(ExitMiniProgramOptionList); - var callback = new ExitMiniProgramOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ExitMiniProgramOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ExitMiniProgram(conf,id); - } - public void ExitVoIPChatCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ExitVoIPChatOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ExitVoIPChatOptionList.ContainsKey(id)){ - var item = ExitVoIPChatOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ExitVoIPChatOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ExitVoIPChat(string conf, string callbackId); - #else - private void WX_ExitVoIPChat(string conf, string callbackId){} - #endif - - private Dictionary ExitVoIPChatOptionList; - public void ExitVoIPChat(ExitVoIPChatOption option) - { - if(ExitVoIPChatOptionList == null){ - ExitVoIPChatOptionList = new Dictionary(); - } - string id = GetCallbackId(ExitVoIPChatOptionList); - var callback = new ExitVoIPChatOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ExitVoIPChatOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ExitVoIPChat(conf,id); - } - public void FaceDetectCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && FaceDetectOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(FaceDetectOptionList.ContainsKey(id)){ - var item = FaceDetectOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - FaceDetectOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_FaceDetect(string conf, string callbackId); - #else - private void WX_FaceDetect(string conf, string callbackId){} - #endif - - private Dictionary FaceDetectOptionList; - public void FaceDetect(FaceDetectOption option) - { - if(FaceDetectOptionList == null){ - FaceDetectOptionList = new Dictionary(); - } - string id = GetCallbackId(FaceDetectOptionList); - var callback = new FaceDetectOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - FaceDetectOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_FaceDetect(conf,id); - } - public void GetAvailableAudioSourcesCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetAvailableAudioSourcesOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetAvailableAudioSourcesOptionList.ContainsKey(id)){ - var item = GetAvailableAudioSourcesOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetAvailableAudioSourcesOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetAvailableAudioSources(string conf, string callbackId); - #else - private void WX_GetAvailableAudioSources(string conf, string callbackId){} - #endif - - private Dictionary GetAvailableAudioSourcesOptionList; - public void GetAvailableAudioSources(GetAvailableAudioSourcesOption option) - { - if(GetAvailableAudioSourcesOptionList == null){ - GetAvailableAudioSourcesOptionList = new Dictionary(); - } - string id = GetCallbackId(GetAvailableAudioSourcesOptionList); - var callback = new GetAvailableAudioSourcesOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetAvailableAudioSourcesOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetAvailableAudioSources(conf,id); - } - public void GetBLEDeviceCharacteristicsCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBLEDeviceCharacteristicsOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBLEDeviceCharacteristicsOptionList.ContainsKey(id)){ - var item = GetBLEDeviceCharacteristicsOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBLEDeviceCharacteristicsOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBLEDeviceCharacteristics(string conf, string callbackId); - #else - private void WX_GetBLEDeviceCharacteristics(string conf, string callbackId){} - #endif - - private Dictionary GetBLEDeviceCharacteristicsOptionList; - public void GetBLEDeviceCharacteristics(GetBLEDeviceCharacteristicsOption option) - { - if(GetBLEDeviceCharacteristicsOptionList == null){ - GetBLEDeviceCharacteristicsOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBLEDeviceCharacteristicsOptionList); - var callback = new GetBLEDeviceCharacteristicsOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBLEDeviceCharacteristicsOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBLEDeviceCharacteristics(conf,id); - } - public void GetBLEDeviceRSSICallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBLEDeviceRSSIOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBLEDeviceRSSIOptionList.ContainsKey(id)){ - var item = GetBLEDeviceRSSIOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBLEDeviceRSSIOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBLEDeviceRSSI(string conf, string callbackId); - #else - private void WX_GetBLEDeviceRSSI(string conf, string callbackId){} - #endif - - private Dictionary GetBLEDeviceRSSIOptionList; - public void GetBLEDeviceRSSI(GetBLEDeviceRSSIOption option) - { - if(GetBLEDeviceRSSIOptionList == null){ - GetBLEDeviceRSSIOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBLEDeviceRSSIOptionList); - var callback = new GetBLEDeviceRSSIOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBLEDeviceRSSIOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBLEDeviceRSSI(conf,id); - } - public void GetBLEDeviceServicesCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBLEDeviceServicesOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBLEDeviceServicesOptionList.ContainsKey(id)){ - var item = GetBLEDeviceServicesOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBLEDeviceServicesOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBLEDeviceServices(string conf, string callbackId); - #else - private void WX_GetBLEDeviceServices(string conf, string callbackId){} - #endif - - private Dictionary GetBLEDeviceServicesOptionList; - public void GetBLEDeviceServices(GetBLEDeviceServicesOption option) - { - if(GetBLEDeviceServicesOptionList == null){ - GetBLEDeviceServicesOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBLEDeviceServicesOptionList); - var callback = new GetBLEDeviceServicesOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBLEDeviceServicesOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBLEDeviceServices(conf,id); - } - public void GetBLEMTUCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBLEMTUOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBLEMTUOptionList.ContainsKey(id)){ - var item = GetBLEMTUOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBLEMTUOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBLEMTU(string conf, string callbackId); - #else - private void WX_GetBLEMTU(string conf, string callbackId){} - #endif - - private Dictionary GetBLEMTUOptionList; - public void GetBLEMTU(GetBLEMTUOption option) - { - if(GetBLEMTUOptionList == null){ - GetBLEMTUOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBLEMTUOptionList); - var callback = new GetBLEMTUOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBLEMTUOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBLEMTU(conf,id); - } - public void GetBatteryInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBatteryInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBatteryInfoOptionList.ContainsKey(id)){ - var item = GetBatteryInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBatteryInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBatteryInfo(string conf, string callbackId); - #else - private void WX_GetBatteryInfo(string conf, string callbackId){} - #endif - - private Dictionary GetBatteryInfoOptionList; - public void GetBatteryInfo(GetBatteryInfoOption option) - { - if(GetBatteryInfoOptionList == null){ - GetBatteryInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBatteryInfoOptionList); - var callback = new GetBatteryInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBatteryInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBatteryInfo(conf,id); - } - public void GetBeaconsCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBeaconsOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBeaconsOptionList.ContainsKey(id)){ - var item = GetBeaconsOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBeaconsOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBeacons(string conf, string callbackId); - #else - private void WX_GetBeacons(string conf, string callbackId){} - #endif - - private Dictionary GetBeaconsOptionList; - public void GetBeacons(GetBeaconsOption option) - { - if(GetBeaconsOptionList == null){ - GetBeaconsOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBeaconsOptionList); - var callback = new GetBeaconsOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBeaconsOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBeacons(conf,id); - } - public void GetBluetoothAdapterStateCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBluetoothAdapterStateOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBluetoothAdapterStateOptionList.ContainsKey(id)){ - var item = GetBluetoothAdapterStateOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBluetoothAdapterStateOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBluetoothAdapterState(string conf, string callbackId); - #else - private void WX_GetBluetoothAdapterState(string conf, string callbackId){} - #endif - - private Dictionary GetBluetoothAdapterStateOptionList; - public void GetBluetoothAdapterState(GetBluetoothAdapterStateOption option) - { - if(GetBluetoothAdapterStateOptionList == null){ - GetBluetoothAdapterStateOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBluetoothAdapterStateOptionList); - var callback = new GetBluetoothAdapterStateOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBluetoothAdapterStateOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBluetoothAdapterState(conf,id); - } - public void GetBluetoothDevicesCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetBluetoothDevicesOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetBluetoothDevicesOptionList.ContainsKey(id)){ - var item = GetBluetoothDevicesOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetBluetoothDevicesOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetBluetoothDevices(string conf, string callbackId); - #else - private void WX_GetBluetoothDevices(string conf, string callbackId){} - #endif - - private Dictionary GetBluetoothDevicesOptionList; - public void GetBluetoothDevices(GetBluetoothDevicesOption option) - { - if(GetBluetoothDevicesOptionList == null){ - GetBluetoothDevicesOptionList = new Dictionary(); - } - string id = GetCallbackId(GetBluetoothDevicesOptionList); - var callback = new GetBluetoothDevicesOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetBluetoothDevicesOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetBluetoothDevices(conf,id); - } - public void GetChannelsLiveInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetChannelsLiveInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetChannelsLiveInfoOptionList.ContainsKey(id)){ - var item = GetChannelsLiveInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetChannelsLiveInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetChannelsLiveInfo(string conf, string callbackId); - #else - private void WX_GetChannelsLiveInfo(string conf, string callbackId){} - #endif - - private Dictionary GetChannelsLiveInfoOptionList; - public void GetChannelsLiveInfo(GetChannelsLiveInfoOption option) - { - if(GetChannelsLiveInfoOptionList == null){ - GetChannelsLiveInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetChannelsLiveInfoOptionList); - var callback = new GetChannelsLiveInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetChannelsLiveInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetChannelsLiveInfo(conf,id); - } - public void GetChannelsLiveNoticeInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetChannelsLiveNoticeInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetChannelsLiveNoticeInfoOptionList.ContainsKey(id)){ - var item = GetChannelsLiveNoticeInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetChannelsLiveNoticeInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetChannelsLiveNoticeInfo(string conf, string callbackId); - #else - private void WX_GetChannelsLiveNoticeInfo(string conf, string callbackId){} - #endif - - private Dictionary GetChannelsLiveNoticeInfoOptionList; - public void GetChannelsLiveNoticeInfo(GetChannelsLiveNoticeInfoOption option) - { - if(GetChannelsLiveNoticeInfoOptionList == null){ - GetChannelsLiveNoticeInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetChannelsLiveNoticeInfoOptionList); - var callback = new GetChannelsLiveNoticeInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetChannelsLiveNoticeInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetChannelsLiveNoticeInfo(conf,id); - } - public void GetClipboardDataCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetClipboardDataOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetClipboardDataOptionList.ContainsKey(id)){ - var item = GetClipboardDataOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetClipboardDataOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetClipboardData(string conf, string callbackId); - #else - private void WX_GetClipboardData(string conf, string callbackId){} - #endif - - private Dictionary GetClipboardDataOptionList; - public void GetClipboardData(GetClipboardDataOption option) - { - if(GetClipboardDataOptionList == null){ - GetClipboardDataOptionList = new Dictionary(); - } - string id = GetCallbackId(GetClipboardDataOptionList); - var callback = new GetClipboardDataOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetClipboardDataOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetClipboardData(conf,id); - } - public void GetConnectedBluetoothDevicesCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetConnectedBluetoothDevicesOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetConnectedBluetoothDevicesOptionList.ContainsKey(id)){ - var item = GetConnectedBluetoothDevicesOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetConnectedBluetoothDevicesOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetConnectedBluetoothDevices(string conf, string callbackId); - #else - private void WX_GetConnectedBluetoothDevices(string conf, string callbackId){} - #endif - - private Dictionary GetConnectedBluetoothDevicesOptionList; - public void GetConnectedBluetoothDevices(GetConnectedBluetoothDevicesOption option) - { - if(GetConnectedBluetoothDevicesOptionList == null){ - GetConnectedBluetoothDevicesOptionList = new Dictionary(); - } - string id = GetCallbackId(GetConnectedBluetoothDevicesOptionList); - var callback = new GetConnectedBluetoothDevicesOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetConnectedBluetoothDevicesOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetConnectedBluetoothDevices(conf,id); - } - public void GetExtConfigCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetExtConfigOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetExtConfigOptionList.ContainsKey(id)){ - var item = GetExtConfigOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetExtConfigOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetExtConfig(string conf, string callbackId); - #else - private void WX_GetExtConfig(string conf, string callbackId){} - #endif - - private Dictionary GetExtConfigOptionList; - public void GetExtConfig(GetExtConfigOption option) - { - if(GetExtConfigOptionList == null){ - GetExtConfigOptionList = new Dictionary(); - } - string id = GetCallbackId(GetExtConfigOptionList); - var callback = new GetExtConfigOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetExtConfigOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetExtConfig(conf,id); - } - public void GetFileInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && WxGetFileInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(WxGetFileInfoOptionList.ContainsKey(id)){ - var item = WxGetFileInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - WxGetFileInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetFileInfo(string conf, string callbackId); - #else - private void WX_GetFileInfo(string conf, string callbackId){} - #endif - - private Dictionary WxGetFileInfoOptionList; - public void GetFileInfo(WxGetFileInfoOption option) - { - if(WxGetFileInfoOptionList == null){ - WxGetFileInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(WxGetFileInfoOptionList); - var callback = new WxGetFileInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - WxGetFileInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetFileInfo(conf,id); - } - public void GetFriendCloudStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetFriendCloudStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetFriendCloudStorageOptionList.ContainsKey(id)){ - var item = GetFriendCloudStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetFriendCloudStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetFriendCloudStorage(string conf, string callbackId); - #else - private void WX_GetFriendCloudStorage(string conf, string callbackId){} - #endif - - private Dictionary GetFriendCloudStorageOptionList; - public void GetFriendCloudStorage(GetFriendCloudStorageOption option) - { - if(GetFriendCloudStorageOptionList == null){ - GetFriendCloudStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(GetFriendCloudStorageOptionList); - var callback = new GetFriendCloudStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetFriendCloudStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetFriendCloudStorage(conf,id); - } - public void GetGroupCloudStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetGroupCloudStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetGroupCloudStorageOptionList.ContainsKey(id)){ - var item = GetGroupCloudStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetGroupCloudStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetGroupCloudStorage(string conf, string callbackId); - #else - private void WX_GetGroupCloudStorage(string conf, string callbackId){} - #endif - - private Dictionary GetGroupCloudStorageOptionList; - public void GetGroupCloudStorage(GetGroupCloudStorageOption option) - { - if(GetGroupCloudStorageOptionList == null){ - GetGroupCloudStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(GetGroupCloudStorageOptionList); - var callback = new GetGroupCloudStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetGroupCloudStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetGroupCloudStorage(conf,id); - } - public void GetGroupEnterInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetGroupEnterInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetGroupEnterInfoOptionList.ContainsKey(id)){ - var item = GetGroupEnterInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetGroupEnterInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetGroupEnterInfo(string conf, string callbackId); - #else - private void WX_GetGroupEnterInfo(string conf, string callbackId){} - #endif - - private Dictionary GetGroupEnterInfoOptionList; - public void GetGroupEnterInfo(GetGroupEnterInfoOption option) - { - if(GetGroupEnterInfoOptionList == null){ - GetGroupEnterInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetGroupEnterInfoOptionList); - var callback = new GetGroupEnterInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetGroupEnterInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetGroupEnterInfo(conf,id); - } - public void GetGroupInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetGroupInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetGroupInfoOptionList.ContainsKey(id)){ - var item = GetGroupInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetGroupInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetGroupInfo(string conf, string callbackId); - #else - private void WX_GetGroupInfo(string conf, string callbackId){} - #endif - - private Dictionary GetGroupInfoOptionList; - public void GetGroupInfo(GetGroupInfoOption option) - { - if(GetGroupInfoOptionList == null){ - GetGroupInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetGroupInfoOptionList); - var callback = new GetGroupInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetGroupInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetGroupInfo(conf,id); - } - public void GetLocalIPAddressCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetLocalIPAddressOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetLocalIPAddressOptionList.ContainsKey(id)){ - var item = GetLocalIPAddressOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetLocalIPAddressOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetLocalIPAddress(string conf, string callbackId); - #else - private void WX_GetLocalIPAddress(string conf, string callbackId){} - #endif - - private Dictionary GetLocalIPAddressOptionList; - public void GetLocalIPAddress(GetLocalIPAddressOption option) - { - if(GetLocalIPAddressOptionList == null){ - GetLocalIPAddressOptionList = new Dictionary(); - } - string id = GetCallbackId(GetLocalIPAddressOptionList); - var callback = new GetLocalIPAddressOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetLocalIPAddressOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetLocalIPAddress(conf,id); - } - public void GetLocationCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetLocationOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetLocationOptionList.ContainsKey(id)){ - var item = GetLocationOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetLocationOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetLocation(string conf, string callbackId); - #else - private void WX_GetLocation(string conf, string callbackId){} - #endif - - private Dictionary GetLocationOptionList; - public void GetLocation(GetLocationOption option) - { - if(GetLocationOptionList == null){ - GetLocationOptionList = new Dictionary(); - } - string id = GetCallbackId(GetLocationOptionList); - var callback = new GetLocationOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetLocationOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetLocation(conf,id); - } - public void GetNetworkTypeCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetNetworkTypeOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetNetworkTypeOptionList.ContainsKey(id)){ - var item = GetNetworkTypeOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetNetworkTypeOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetNetworkType(string conf, string callbackId); - #else - private void WX_GetNetworkType(string conf, string callbackId){} - #endif - - private Dictionary GetNetworkTypeOptionList; - public void GetNetworkType(GetNetworkTypeOption option) - { - if(GetNetworkTypeOptionList == null){ - GetNetworkTypeOptionList = new Dictionary(); - } - string id = GetCallbackId(GetNetworkTypeOptionList); - var callback = new GetNetworkTypeOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetNetworkTypeOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetNetworkType(conf,id); - } - public void GetPotentialFriendListCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetPotentialFriendListOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetPotentialFriendListOptionList.ContainsKey(id)){ - var item = GetPotentialFriendListOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetPotentialFriendListOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetPotentialFriendList(string conf, string callbackId); - #else - private void WX_GetPotentialFriendList(string conf, string callbackId){} - #endif - - private Dictionary GetPotentialFriendListOptionList; - public void GetPotentialFriendList(GetPotentialFriendListOption option) - { - if(GetPotentialFriendListOptionList == null){ - GetPotentialFriendListOptionList = new Dictionary(); - } - string id = GetCallbackId(GetPotentialFriendListOptionList); - var callback = new GetPotentialFriendListOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetPotentialFriendListOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetPotentialFriendList(conf,id); - } - public void GetScreenBrightnessCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetScreenBrightnessOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetScreenBrightnessOptionList.ContainsKey(id)){ - var item = GetScreenBrightnessOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetScreenBrightnessOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetScreenBrightness(string conf, string callbackId); - #else - private void WX_GetScreenBrightness(string conf, string callbackId){} - #endif - - private Dictionary GetScreenBrightnessOptionList; - public void GetScreenBrightness(GetScreenBrightnessOption option) - { - if(GetScreenBrightnessOptionList == null){ - GetScreenBrightnessOptionList = new Dictionary(); - } - string id = GetCallbackId(GetScreenBrightnessOptionList); - var callback = new GetScreenBrightnessOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetScreenBrightnessOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetScreenBrightness(conf,id); - } - public void GetSettingCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetSettingOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetSettingOptionList.ContainsKey(id)){ - var item = GetSettingOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetSettingOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetSetting(string conf, string callbackId); - #else - private void WX_GetSetting(string conf, string callbackId){} - #endif - - private Dictionary GetSettingOptionList; - public void GetSetting(GetSettingOption option) - { - if(GetSettingOptionList == null){ - GetSettingOptionList = new Dictionary(); - } - string id = GetCallbackId(GetSettingOptionList); - var callback = new GetSettingOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetSettingOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetSetting(conf,id); - } - public void GetShareInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetShareInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetShareInfoOptionList.ContainsKey(id)){ - var item = GetShareInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetShareInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetShareInfo(string conf, string callbackId); - #else - private void WX_GetShareInfo(string conf, string callbackId){} - #endif - - private Dictionary GetShareInfoOptionList; - public void GetShareInfo(GetShareInfoOption option) - { - if(GetShareInfoOptionList == null){ - GetShareInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetShareInfoOptionList); - var callback = new GetShareInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetShareInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetShareInfo(conf,id); - } - public void GetStorageInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetStorageInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetStorageInfoOptionList.ContainsKey(id)){ - var item = GetStorageInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetStorageInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetStorageInfo(string conf, string callbackId); - #else - private void WX_GetStorageInfo(string conf, string callbackId){} - #endif - - private Dictionary GetStorageInfoOptionList; - public void GetStorageInfo(GetStorageInfoOption option) - { - if(GetStorageInfoOptionList == null){ - GetStorageInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetStorageInfoOptionList); - var callback = new GetStorageInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetStorageInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetStorageInfo(conf,id); - } - public void GetSystemInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetSystemInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetSystemInfoOptionList.ContainsKey(id)){ - var item = GetSystemInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetSystemInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetSystemInfo(string conf, string callbackId); - #else - private void WX_GetSystemInfo(string conf, string callbackId){} - #endif - - private Dictionary GetSystemInfoOptionList; - public void GetSystemInfo(GetSystemInfoOption option) - { - if(GetSystemInfoOptionList == null){ - GetSystemInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetSystemInfoOptionList); - var callback = new GetSystemInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetSystemInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetSystemInfo(conf,id); - } - public void GetSystemInfoAsyncCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetSystemInfoAsyncOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetSystemInfoAsyncOptionList.ContainsKey(id)){ - var item = GetSystemInfoAsyncOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetSystemInfoAsyncOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetSystemInfoAsync(string conf, string callbackId); - #else - private void WX_GetSystemInfoAsync(string conf, string callbackId){} - #endif - - private Dictionary GetSystemInfoAsyncOptionList; - public void GetSystemInfoAsync(GetSystemInfoAsyncOption option) - { - if(GetSystemInfoAsyncOptionList == null){ - GetSystemInfoAsyncOptionList = new Dictionary(); - } - string id = GetCallbackId(GetSystemInfoAsyncOptionList); - var callback = new GetSystemInfoAsyncOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetSystemInfoAsyncOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetSystemInfoAsync(conf,id); - } - public void GetUserCloudStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetUserCloudStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetUserCloudStorageOptionList.ContainsKey(id)){ - var item = GetUserCloudStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetUserCloudStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetUserCloudStorage(string conf, string callbackId); - #else - private void WX_GetUserCloudStorage(string conf, string callbackId){} - #endif - - private Dictionary GetUserCloudStorageOptionList; - public void GetUserCloudStorage(GetUserCloudStorageOption option) - { - if(GetUserCloudStorageOptionList == null){ - GetUserCloudStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(GetUserCloudStorageOptionList); - var callback = new GetUserCloudStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetUserCloudStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetUserCloudStorage(conf,id); - } - public void GetUserCloudStorageKeysCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetUserCloudStorageKeysOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetUserCloudStorageKeysOptionList.ContainsKey(id)){ - var item = GetUserCloudStorageKeysOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetUserCloudStorageKeysOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetUserCloudStorageKeys(string conf, string callbackId); - #else - private void WX_GetUserCloudStorageKeys(string conf, string callbackId){} - #endif - - private Dictionary GetUserCloudStorageKeysOptionList; - public void GetUserCloudStorageKeys(GetUserCloudStorageKeysOption option) - { - if(GetUserCloudStorageKeysOptionList == null){ - GetUserCloudStorageKeysOptionList = new Dictionary(); - } - string id = GetCallbackId(GetUserCloudStorageKeysOptionList); - var callback = new GetUserCloudStorageKeysOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetUserCloudStorageKeysOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetUserCloudStorageKeys(conf,id); - } - public void GetUserInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetUserInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetUserInfoOptionList.ContainsKey(id)){ - var item = GetUserInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetUserInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetUserInfo(string conf, string callbackId); - #else - private void WX_GetUserInfo(string conf, string callbackId){} - #endif - - private Dictionary GetUserInfoOptionList; - public void GetUserInfo(GetUserInfoOption option) - { - if(GetUserInfoOptionList == null){ - GetUserInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetUserInfoOptionList); - var callback = new GetUserInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetUserInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetUserInfo(conf,id); - } - public void GetUserInteractiveStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetUserInteractiveStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetUserInteractiveStorageOptionList.ContainsKey(id)){ - var item = GetUserInteractiveStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetUserInteractiveStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetUserInteractiveStorage(string conf, string callbackId); - #else - private void WX_GetUserInteractiveStorage(string conf, string callbackId){} - #endif - - private Dictionary GetUserInteractiveStorageOptionList; - public void GetUserInteractiveStorage(GetUserInteractiveStorageOption option) - { - if(GetUserInteractiveStorageOptionList == null){ - GetUserInteractiveStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(GetUserInteractiveStorageOptionList); - var callback = new GetUserInteractiveStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetUserInteractiveStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetUserInteractiveStorage(conf,id); - } - public void GetWeRunDataCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetWeRunDataOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetWeRunDataOptionList.ContainsKey(id)){ - var item = GetWeRunDataOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetWeRunDataOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetWeRunData(string conf, string callbackId); - #else - private void WX_GetWeRunData(string conf, string callbackId){} - #endif - - private Dictionary GetWeRunDataOptionList; - public void GetWeRunData(GetWeRunDataOption option) - { - if(GetWeRunDataOptionList == null){ - GetWeRunDataOptionList = new Dictionary(); - } - string id = GetCallbackId(GetWeRunDataOptionList); - var callback = new GetWeRunDataOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetWeRunDataOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetWeRunData(conf,id); - } - public void HideKeyboardCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && HideKeyboardOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(HideKeyboardOptionList.ContainsKey(id)){ - var item = HideKeyboardOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - HideKeyboardOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_HideKeyboard(string conf, string callbackId); - #else - private void WX_HideKeyboard(string conf, string callbackId){} - #endif - - private Dictionary HideKeyboardOptionList; - public void HideKeyboard(HideKeyboardOption option) - { - if(HideKeyboardOptionList == null){ - HideKeyboardOptionList = new Dictionary(); - } - string id = GetCallbackId(HideKeyboardOptionList); - var callback = new HideKeyboardOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - HideKeyboardOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_HideKeyboard(conf,id); - } - public void HideLoadingCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && HideLoadingOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(HideLoadingOptionList.ContainsKey(id)){ - var item = HideLoadingOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - HideLoadingOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_HideLoading(string conf, string callbackId); - #else - private void WX_HideLoading(string conf, string callbackId){} - #endif - - private Dictionary HideLoadingOptionList; - public void HideLoading(HideLoadingOption option) - { - if(HideLoadingOptionList == null){ - HideLoadingOptionList = new Dictionary(); - } - string id = GetCallbackId(HideLoadingOptionList); - var callback = new HideLoadingOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - HideLoadingOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_HideLoading(conf,id); - } - public void HideShareMenuCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && HideShareMenuOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(HideShareMenuOptionList.ContainsKey(id)){ - var item = HideShareMenuOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - HideShareMenuOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_HideShareMenu(string conf, string callbackId); - #else - private void WX_HideShareMenu(string conf, string callbackId){} - #endif - - private Dictionary HideShareMenuOptionList; - public void HideShareMenu(HideShareMenuOption option) - { - if(HideShareMenuOptionList == null){ - HideShareMenuOptionList = new Dictionary(); - } - string id = GetCallbackId(HideShareMenuOptionList); - var callback = new HideShareMenuOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - HideShareMenuOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_HideShareMenu(conf,id); - } - public void HideToastCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && HideToastOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(HideToastOptionList.ContainsKey(id)){ - var item = HideToastOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - HideToastOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_HideToast(string conf, string callbackId); - #else - private void WX_HideToast(string conf, string callbackId){} - #endif - - private Dictionary HideToastOptionList; - public void HideToast(HideToastOption option) - { - if(HideToastOptionList == null){ - HideToastOptionList = new Dictionary(); - } - string id = GetCallbackId(HideToastOptionList); - var callback = new HideToastOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - HideToastOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_HideToast(conf,id); - } - public void InitFaceDetectCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && InitFaceDetectOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(InitFaceDetectOptionList.ContainsKey(id)){ - var item = InitFaceDetectOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - InitFaceDetectOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_InitFaceDetect(string conf, string callbackId); - #else - private void WX_InitFaceDetect(string conf, string callbackId){} - #endif - - private Dictionary InitFaceDetectOptionList; - public void InitFaceDetect(InitFaceDetectOption option) - { - if(InitFaceDetectOptionList == null){ - InitFaceDetectOptionList = new Dictionary(); - } - string id = GetCallbackId(InitFaceDetectOptionList); - var callback = new InitFaceDetectOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - InitFaceDetectOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_InitFaceDetect(conf,id); - } - public void IsBluetoothDevicePairedCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && IsBluetoothDevicePairedOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(IsBluetoothDevicePairedOptionList.ContainsKey(id)){ - var item = IsBluetoothDevicePairedOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - IsBluetoothDevicePairedOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_IsBluetoothDevicePaired(string conf, string callbackId); - #else - private void WX_IsBluetoothDevicePaired(string conf, string callbackId){} - #endif - - private Dictionary IsBluetoothDevicePairedOptionList; - public void IsBluetoothDevicePaired(IsBluetoothDevicePairedOption option) - { - if(IsBluetoothDevicePairedOptionList == null){ - IsBluetoothDevicePairedOptionList = new Dictionary(); - } - string id = GetCallbackId(IsBluetoothDevicePairedOptionList); - var callback = new IsBluetoothDevicePairedOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - IsBluetoothDevicePairedOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_IsBluetoothDevicePaired(conf,id); - } - public void JoinVoIPChatCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && JoinVoIPChatOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(JoinVoIPChatOptionList.ContainsKey(id)){ - var item = JoinVoIPChatOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - JoinVoIPChatOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_JoinVoIPChat(string conf, string callbackId); - #else - private void WX_JoinVoIPChat(string conf, string callbackId){} - #endif - - private Dictionary JoinVoIPChatOptionList; - public void JoinVoIPChat(JoinVoIPChatOption option) - { - if(JoinVoIPChatOptionList == null){ - JoinVoIPChatOptionList = new Dictionary(); - } - string id = GetCallbackId(JoinVoIPChatOptionList); - var callback = new JoinVoIPChatOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - JoinVoIPChatOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_JoinVoIPChat(conf,id); - } - public void LoginCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && LoginOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(LoginOptionList.ContainsKey(id)){ - var item = LoginOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - LoginOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_Login(string conf, string callbackId); - #else - private void WX_Login(string conf, string callbackId){} - #endif - - private Dictionary LoginOptionList; - public void Login(LoginOption option) - { - if(LoginOptionList == null){ - LoginOptionList = new Dictionary(); - } - string id = GetCallbackId(LoginOptionList); - var callback = new LoginOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - LoginOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_Login(conf,id); - } - public void MakeBluetoothPairCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && MakeBluetoothPairOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(MakeBluetoothPairOptionList.ContainsKey(id)){ - var item = MakeBluetoothPairOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - MakeBluetoothPairOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_MakeBluetoothPair(string conf, string callbackId); - #else - private void WX_MakeBluetoothPair(string conf, string callbackId){} - #endif - - private Dictionary MakeBluetoothPairOptionList; - public void MakeBluetoothPair(MakeBluetoothPairOption option) - { - if(MakeBluetoothPairOptionList == null){ - MakeBluetoothPairOptionList = new Dictionary(); - } - string id = GetCallbackId(MakeBluetoothPairOptionList); - var callback = new MakeBluetoothPairOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - MakeBluetoothPairOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_MakeBluetoothPair(conf,id); - } - public void ModifyFriendInteractiveStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ModifyFriendInteractiveStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ModifyFriendInteractiveStorageOptionList.ContainsKey(id)){ - var item = ModifyFriendInteractiveStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ModifyFriendInteractiveStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ModifyFriendInteractiveStorage(string conf, string callbackId); - #else - private void WX_ModifyFriendInteractiveStorage(string conf, string callbackId){} - #endif - - private Dictionary ModifyFriendInteractiveStorageOptionList; - public void ModifyFriendInteractiveStorage(ModifyFriendInteractiveStorageOption option) - { - if(ModifyFriendInteractiveStorageOptionList == null){ - ModifyFriendInteractiveStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(ModifyFriendInteractiveStorageOptionList); - var callback = new ModifyFriendInteractiveStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ModifyFriendInteractiveStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ModifyFriendInteractiveStorage(conf,id); - } - public void NavigateToMiniProgramCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && NavigateToMiniProgramOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(NavigateToMiniProgramOptionList.ContainsKey(id)){ - var item = NavigateToMiniProgramOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - NavigateToMiniProgramOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_NavigateToMiniProgram(string conf, string callbackId); - #else - private void WX_NavigateToMiniProgram(string conf, string callbackId){} - #endif - - private Dictionary NavigateToMiniProgramOptionList; - public void NavigateToMiniProgram(NavigateToMiniProgramOption option) - { - if(NavigateToMiniProgramOptionList == null){ - NavigateToMiniProgramOptionList = new Dictionary(); - } - string id = GetCallbackId(NavigateToMiniProgramOptionList); - var callback = new NavigateToMiniProgramOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - NavigateToMiniProgramOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_NavigateToMiniProgram(conf,id); - } - public void NotifyBLECharacteristicValueChangeCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && NotifyBLECharacteristicValueChangeOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(NotifyBLECharacteristicValueChangeOptionList.ContainsKey(id)){ - var item = NotifyBLECharacteristicValueChangeOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - NotifyBLECharacteristicValueChangeOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_NotifyBLECharacteristicValueChange(string conf, string callbackId); - #else - private void WX_NotifyBLECharacteristicValueChange(string conf, string callbackId){} - #endif - - private Dictionary NotifyBLECharacteristicValueChangeOptionList; - public void NotifyBLECharacteristicValueChange(NotifyBLECharacteristicValueChangeOption option) - { - if(NotifyBLECharacteristicValueChangeOptionList == null){ - NotifyBLECharacteristicValueChangeOptionList = new Dictionary(); - } - string id = GetCallbackId(NotifyBLECharacteristicValueChangeOptionList); - var callback = new NotifyBLECharacteristicValueChangeOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - NotifyBLECharacteristicValueChangeOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_NotifyBLECharacteristicValueChange(conf,id); - } - public void OpenBluetoothAdapterCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenBluetoothAdapterOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenBluetoothAdapterOptionList.ContainsKey(id)){ - var item = OpenBluetoothAdapterOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenBluetoothAdapterOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenBluetoothAdapter(string conf, string callbackId); - #else - private void WX_OpenBluetoothAdapter(string conf, string callbackId){} - #endif - - private Dictionary OpenBluetoothAdapterOptionList; - public void OpenBluetoothAdapter(OpenBluetoothAdapterOption option) - { - if(OpenBluetoothAdapterOptionList == null){ - OpenBluetoothAdapterOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenBluetoothAdapterOptionList); - var callback = new OpenBluetoothAdapterOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenBluetoothAdapterOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenBluetoothAdapter(conf,id); - } - public void OpenCardCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenCardOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenCardOptionList.ContainsKey(id)){ - var item = OpenCardOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenCardOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenCard(string conf, string callbackId); - #else - private void WX_OpenCard(string conf, string callbackId){} - #endif - - private Dictionary OpenCardOptionList; - public void OpenCard(OpenCardOption option) - { - if(OpenCardOptionList == null){ - OpenCardOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenCardOptionList); - var callback = new OpenCardOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenCardOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenCard(conf,id); - } - public void OpenChannelsActivityCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenChannelsActivityOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenChannelsActivityOptionList.ContainsKey(id)){ - var item = OpenChannelsActivityOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenChannelsActivityOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_RestartMiniProgram(); - - public void RestartMiniProgram() - { - WX_RestartMiniProgram(); - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenChannelsActivity(string conf, string callbackId); - #else - private void WX_OpenChannelsActivity(string conf, string callbackId){} - #endif - - private Dictionary OpenChannelsActivityOptionList; - public void OpenChannelsActivity(OpenChannelsActivityOption option) - { - if(OpenChannelsActivityOptionList == null){ - OpenChannelsActivityOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenChannelsActivityOptionList); - var callback = new OpenChannelsActivityOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenChannelsActivityOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenChannelsActivity(conf,id); - } - public void OpenChannelsEventCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenChannelsEventOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenChannelsEventOptionList.ContainsKey(id)){ - var item = OpenChannelsEventOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenChannelsEventOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenChannelsEvent(string conf, string callbackId); - #else - private void WX_OpenChannelsEvent(string conf, string callbackId){} - #endif - - private Dictionary OpenChannelsEventOptionList; - public void OpenChannelsEvent(OpenChannelsEventOption option) - { - if(OpenChannelsEventOptionList == null){ - OpenChannelsEventOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenChannelsEventOptionList); - var callback = new OpenChannelsEventOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenChannelsEventOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenChannelsEvent(conf,id); - } - public void OpenChannelsLiveCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenChannelsLiveOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenChannelsLiveOptionList.ContainsKey(id)){ - var item = OpenChannelsLiveOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenChannelsLiveOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenChannelsLive(string conf, string callbackId); - #else - private void WX_OpenChannelsLive(string conf, string callbackId){} - #endif - - private Dictionary OpenChannelsLiveOptionList; - public void OpenChannelsLive(OpenChannelsLiveOption option) - { - if(OpenChannelsLiveOptionList == null){ - OpenChannelsLiveOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenChannelsLiveOptionList); - var callback = new OpenChannelsLiveOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenChannelsLiveOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenChannelsLive(conf,id); - } - public void OpenChannelsUserProfileCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenChannelsUserProfileOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenChannelsUserProfileOptionList.ContainsKey(id)){ - var item = OpenChannelsUserProfileOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenChannelsUserProfileOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenChannelsUserProfile(string conf, string callbackId); - #else - private void WX_OpenChannelsUserProfile(string conf, string callbackId){} - #endif - - private Dictionary OpenChannelsUserProfileOptionList; - public void OpenChannelsUserProfile(OpenChannelsUserProfileOption option) - { - if(OpenChannelsUserProfileOptionList == null){ - OpenChannelsUserProfileOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenChannelsUserProfileOptionList); - var callback = new OpenChannelsUserProfileOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenChannelsUserProfileOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenChannelsUserProfile(conf,id); - } - public void OpenCustomerServiceConversationCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenCustomerServiceConversationOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenCustomerServiceConversationOptionList.ContainsKey(id)){ - var item = OpenCustomerServiceConversationOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenCustomerServiceConversationOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenCustomerServiceConversation(string conf, string callbackId); - #else - private void WX_OpenCustomerServiceConversation(string conf, string callbackId){} - #endif - - private Dictionary OpenCustomerServiceConversationOptionList; - public void OpenCustomerServiceConversation(OpenCustomerServiceConversationOption option) - { - if(OpenCustomerServiceConversationOptionList == null){ - OpenCustomerServiceConversationOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenCustomerServiceConversationOptionList); - var callback = new OpenCustomerServiceConversationOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenCustomerServiceConversationOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenCustomerServiceConversation(conf,id); - } - public void OpenSettingCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenSettingOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenSettingOptionList.ContainsKey(id)){ - var item = OpenSettingOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenSettingOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenSetting(string conf, string callbackId); - #else - private void WX_OpenSetting(string conf, string callbackId){} - #endif - - private Dictionary OpenSettingOptionList; - public void OpenSetting(OpenSettingOption option) - { - if(OpenSettingOptionList == null){ - OpenSettingOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenSettingOptionList); - var callback = new OpenSettingOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenSettingOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenSetting(conf,id); - } - public void PreviewImageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && PreviewImageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(PreviewImageOptionList.ContainsKey(id)){ - var item = PreviewImageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - PreviewImageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_PreviewImage(string conf, string callbackId); - #else - private void WX_PreviewImage(string conf, string callbackId){} - #endif - - private Dictionary PreviewImageOptionList; - public void PreviewImage(PreviewImageOption option) - { - if(PreviewImageOptionList == null){ - PreviewImageOptionList = new Dictionary(); - } - string id = GetCallbackId(PreviewImageOptionList); - var callback = new PreviewImageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - PreviewImageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_PreviewImage(conf,id); - } - public void PreviewMediaCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && PreviewMediaOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(PreviewMediaOptionList.ContainsKey(id)){ - var item = PreviewMediaOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - PreviewMediaOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_PreviewMedia(string conf, string callbackId); - #else - private void WX_PreviewMedia(string conf, string callbackId){} - #endif - - private Dictionary PreviewMediaOptionList; - public void PreviewMedia(PreviewMediaOption option) - { - if(PreviewMediaOptionList == null){ - PreviewMediaOptionList = new Dictionary(); - } - string id = GetCallbackId(PreviewMediaOptionList); - var callback = new PreviewMediaOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - PreviewMediaOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_PreviewMedia(conf,id); - } - public void ReadBLECharacteristicValueCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ReadBLECharacteristicValueOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ReadBLECharacteristicValueOptionList.ContainsKey(id)){ - var item = ReadBLECharacteristicValueOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ReadBLECharacteristicValueOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ReadBLECharacteristicValue(string conf, string callbackId); - #else - private void WX_ReadBLECharacteristicValue(string conf, string callbackId){} - #endif - - private Dictionary ReadBLECharacteristicValueOptionList; - public void ReadBLECharacteristicValue(ReadBLECharacteristicValueOption option) - { - if(ReadBLECharacteristicValueOptionList == null){ - ReadBLECharacteristicValueOptionList = new Dictionary(); - } - string id = GetCallbackId(ReadBLECharacteristicValueOptionList); - var callback = new ReadBLECharacteristicValueOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ReadBLECharacteristicValueOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ReadBLECharacteristicValue(conf,id); - } - public void RemoveStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && RemoveStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(RemoveStorageOptionList.ContainsKey(id)){ - var item = RemoveStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - RemoveStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_RemoveStorage(string conf, string callbackId); - #else - private void WX_RemoveStorage(string conf, string callbackId){} - #endif - - private Dictionary RemoveStorageOptionList; - public void RemoveStorage(RemoveStorageOption option) - { - if(RemoveStorageOptionList == null){ - RemoveStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(RemoveStorageOptionList); - var callback = new RemoveStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - RemoveStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_RemoveStorage(conf,id); - } - public void RemoveUserCloudStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && RemoveUserCloudStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(RemoveUserCloudStorageOptionList.ContainsKey(id)){ - var item = RemoveUserCloudStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - RemoveUserCloudStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_RemoveUserCloudStorage(string conf, string callbackId); - #else - private void WX_RemoveUserCloudStorage(string conf, string callbackId){} - #endif - - private Dictionary RemoveUserCloudStorageOptionList; - public void RemoveUserCloudStorage(RemoveUserCloudStorageOption option) - { - if(RemoveUserCloudStorageOptionList == null){ - RemoveUserCloudStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(RemoveUserCloudStorageOptionList); - var callback = new RemoveUserCloudStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - RemoveUserCloudStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_RemoveUserCloudStorage(conf,id); - } - public void RequestMidasFriendPaymentCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && RequestMidasFriendPaymentOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(RequestMidasFriendPaymentOptionList.ContainsKey(id)){ - var item = RequestMidasFriendPaymentOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - RequestMidasFriendPaymentOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_RequestMidasFriendPayment(string conf, string callbackId); - #else - private void WX_RequestMidasFriendPayment(string conf, string callbackId){} - #endif - - private Dictionary RequestMidasFriendPaymentOptionList; - public void RequestMidasFriendPayment(RequestMidasFriendPaymentOption option) - { - if(RequestMidasFriendPaymentOptionList == null){ - RequestMidasFriendPaymentOptionList = new Dictionary(); - } - string id = GetCallbackId(RequestMidasFriendPaymentOptionList); - var callback = new RequestMidasFriendPaymentOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - RequestMidasFriendPaymentOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_RequestMidasFriendPayment(conf,id); - } - public void RequestMidasPaymentCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && RequestMidasPaymentOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(RequestMidasPaymentOptionList.ContainsKey(id)){ - var item = RequestMidasPaymentOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - RequestMidasPaymentOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_RequestMidasPayment(string conf, string callbackId); - #else - private void WX_RequestMidasPayment(string conf, string callbackId){} - #endif - - private Dictionary RequestMidasPaymentOptionList; - public void RequestMidasPayment(RequestMidasPaymentOption option) - { - if(RequestMidasPaymentOptionList == null){ - RequestMidasPaymentOptionList = new Dictionary(); - } - string id = GetCallbackId(RequestMidasPaymentOptionList); - var callback = new RequestMidasPaymentOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - RequestMidasPaymentOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_RequestMidasPayment(conf,id); - } - public void RequestSubscribeMessageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && RequestSubscribeMessageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(RequestSubscribeMessageOptionList.ContainsKey(id)){ - var item = RequestSubscribeMessageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - RequestSubscribeMessageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_RequestSubscribeMessage(string conf, string callbackId); - #else - private void WX_RequestSubscribeMessage(string conf, string callbackId){} - #endif - - private Dictionary RequestSubscribeMessageOptionList; - public void RequestSubscribeMessage(RequestSubscribeMessageOption option) - { - if(RequestSubscribeMessageOptionList == null){ - RequestSubscribeMessageOptionList = new Dictionary(); - } - string id = GetCallbackId(RequestSubscribeMessageOptionList); - var callback = new RequestSubscribeMessageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - RequestSubscribeMessageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_RequestSubscribeMessage(conf,id); - } - public void RequestSubscribeSystemMessageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && RequestSubscribeSystemMessageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(RequestSubscribeSystemMessageOptionList.ContainsKey(id)){ - var item = RequestSubscribeSystemMessageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - RequestSubscribeSystemMessageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_RequestSubscribeSystemMessage(string conf, string callbackId); - #else - private void WX_RequestSubscribeSystemMessage(string conf, string callbackId){} - #endif - - private Dictionary RequestSubscribeSystemMessageOptionList; - public void RequestSubscribeSystemMessage(RequestSubscribeSystemMessageOption option) - { - if(RequestSubscribeSystemMessageOptionList == null){ - RequestSubscribeSystemMessageOptionList = new Dictionary(); - } - string id = GetCallbackId(RequestSubscribeSystemMessageOptionList); - var callback = new RequestSubscribeSystemMessageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - RequestSubscribeSystemMessageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_RequestSubscribeSystemMessage(conf,id); - } - public void SaveFileToDiskCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SaveFileToDiskOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SaveFileToDiskOptionList.ContainsKey(id)){ - var item = SaveFileToDiskOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SaveFileToDiskOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SaveFileToDisk(string conf, string callbackId); - #else - private void WX_SaveFileToDisk(string conf, string callbackId){} - #endif - - private Dictionary SaveFileToDiskOptionList; - public void SaveFileToDisk(SaveFileToDiskOption option) - { - if(SaveFileToDiskOptionList == null){ - SaveFileToDiskOptionList = new Dictionary(); - } - string id = GetCallbackId(SaveFileToDiskOptionList); - var callback = new SaveFileToDiskOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SaveFileToDiskOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SaveFileToDisk(conf,id); - } - public void SaveImageToPhotosAlbumCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SaveImageToPhotosAlbumOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SaveImageToPhotosAlbumOptionList.ContainsKey(id)){ - var item = SaveImageToPhotosAlbumOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SaveImageToPhotosAlbumOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SaveImageToPhotosAlbum(string conf, string callbackId); - #else - private void WX_SaveImageToPhotosAlbum(string conf, string callbackId){} - #endif - - private Dictionary SaveImageToPhotosAlbumOptionList; - public void SaveImageToPhotosAlbum(SaveImageToPhotosAlbumOption option) - { - if(SaveImageToPhotosAlbumOptionList == null){ - SaveImageToPhotosAlbumOptionList = new Dictionary(); - } - string id = GetCallbackId(SaveImageToPhotosAlbumOptionList); - var callback = new SaveImageToPhotosAlbumOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SaveImageToPhotosAlbumOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SaveImageToPhotosAlbum(conf,id); - } - public void ScanCodeCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ScanCodeOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ScanCodeOptionList.ContainsKey(id)){ - var item = ScanCodeOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ScanCodeOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ScanCode(string conf, string callbackId); - #else - private void WX_ScanCode(string conf, string callbackId){} - #endif - - private Dictionary ScanCodeOptionList; - public void ScanCode(ScanCodeOption option) - { - if(ScanCodeOptionList == null){ - ScanCodeOptionList = new Dictionary(); - } - string id = GetCallbackId(ScanCodeOptionList); - var callback = new ScanCodeOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ScanCodeOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ScanCode(conf,id); - } - public void SendSocketMessageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SendSocketMessageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SendSocketMessageOptionList.ContainsKey(id)){ - var item = SendSocketMessageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SendSocketMessageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SendSocketMessage(string conf, string callbackId); - #else - private void WX_SendSocketMessage(string conf, string callbackId){} - #endif - - private Dictionary SendSocketMessageOptionList; - public void SendSocketMessage(SendSocketMessageOption option) - { - if(SendSocketMessageOptionList == null){ - SendSocketMessageOptionList = new Dictionary(); - } - string id = GetCallbackId(SendSocketMessageOptionList); - var callback = new SendSocketMessageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SendSocketMessageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SendSocketMessage(conf,id); - } - public void SetBLEMTUCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetBLEMTUOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetBLEMTUOptionList.ContainsKey(id)){ - var item = SetBLEMTUOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetBLEMTUOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetBLEMTU(string conf, string callbackId); - #else - private void WX_SetBLEMTU(string conf, string callbackId){} - #endif - - private Dictionary SetBLEMTUOptionList; - public void SetBLEMTU(SetBLEMTUOption option) - { - if(SetBLEMTUOptionList == null){ - SetBLEMTUOptionList = new Dictionary(); - } - string id = GetCallbackId(SetBLEMTUOptionList); - var callback = new SetBLEMTUOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetBLEMTUOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetBLEMTU(conf,id); - } - public void SetClipboardDataCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetClipboardDataOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetClipboardDataOptionList.ContainsKey(id)){ - var item = SetClipboardDataOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetClipboardDataOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetClipboardData(string conf, string callbackId); - #else - private void WX_SetClipboardData(string conf, string callbackId){} - #endif - - private Dictionary SetClipboardDataOptionList; - public void SetClipboardData(SetClipboardDataOption option) - { - if(SetClipboardDataOptionList == null){ - SetClipboardDataOptionList = new Dictionary(); - } - string id = GetCallbackId(SetClipboardDataOptionList); - var callback = new SetClipboardDataOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetClipboardDataOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetClipboardData(conf,id); - } - public void SetEnableDebugCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetEnableDebugOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetEnableDebugOptionList.ContainsKey(id)){ - var item = SetEnableDebugOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetEnableDebugOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetEnableDebug(string conf, string callbackId); - #else - private void WX_SetEnableDebug(string conf, string callbackId){} - #endif - - private Dictionary SetEnableDebugOptionList; - public void SetEnableDebug(SetEnableDebugOption option) - { - if(SetEnableDebugOptionList == null){ - SetEnableDebugOptionList = new Dictionary(); - } - string id = GetCallbackId(SetEnableDebugOptionList); - var callback = new SetEnableDebugOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetEnableDebugOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetEnableDebug(conf,id); - } - public void SetInnerAudioOptionCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetInnerAudioOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetInnerAudioOptionList.ContainsKey(id)){ - var item = SetInnerAudioOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetInnerAudioOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetInnerAudioOption(string conf, string callbackId); - #else - private void WX_SetInnerAudioOption(string conf, string callbackId){} - #endif - - private Dictionary SetInnerAudioOptionList; - public void SetInnerAudioOption(SetInnerAudioOption option) - { - if(SetInnerAudioOptionList == null){ - SetInnerAudioOptionList = new Dictionary(); - } - string id = GetCallbackId(SetInnerAudioOptionList); - var callback = new SetInnerAudioOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetInnerAudioOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetInnerAudioOption(conf,id); - } - public void SetKeepScreenOnCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetKeepScreenOnOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetKeepScreenOnOptionList.ContainsKey(id)){ - var item = SetKeepScreenOnOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetKeepScreenOnOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetKeepScreenOn(string conf, string callbackId); - #else - private void WX_SetKeepScreenOn(string conf, string callbackId){} - #endif - - private Dictionary SetKeepScreenOnOptionList; - public void SetKeepScreenOn(SetKeepScreenOnOption option) - { - if(SetKeepScreenOnOptionList == null){ - SetKeepScreenOnOptionList = new Dictionary(); - } - string id = GetCallbackId(SetKeepScreenOnOptionList); - var callback = new SetKeepScreenOnOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetKeepScreenOnOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetKeepScreenOn(conf,id); - } - public void SetMenuStyleCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetMenuStyleOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetMenuStyleOptionList.ContainsKey(id)){ - var item = SetMenuStyleOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetMenuStyleOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetMenuStyle(string conf, string callbackId); - #else - private void WX_SetMenuStyle(string conf, string callbackId){} - #endif - - private Dictionary SetMenuStyleOptionList; - public void SetMenuStyle(SetMenuStyleOption option) - { - if(SetMenuStyleOptionList == null){ - SetMenuStyleOptionList = new Dictionary(); - } - string id = GetCallbackId(SetMenuStyleOptionList); - var callback = new SetMenuStyleOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetMenuStyleOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetMenuStyle(conf,id); - } - public void SetScreenBrightnessCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetScreenBrightnessOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetScreenBrightnessOptionList.ContainsKey(id)){ - var item = SetScreenBrightnessOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetScreenBrightnessOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetScreenBrightness(string conf, string callbackId); - #else - private void WX_SetScreenBrightness(string conf, string callbackId){} - #endif - - private Dictionary SetScreenBrightnessOptionList; - public void SetScreenBrightness(SetScreenBrightnessOption option) - { - if(SetScreenBrightnessOptionList == null){ - SetScreenBrightnessOptionList = new Dictionary(); - } - string id = GetCallbackId(SetScreenBrightnessOptionList); - var callback = new SetScreenBrightnessOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetScreenBrightnessOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetScreenBrightness(conf,id); - } - public void SetStatusBarStyleCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetStatusBarStyleOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetStatusBarStyleOptionList.ContainsKey(id)){ - var item = SetStatusBarStyleOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetStatusBarStyleOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetStatusBarStyle(string conf, string callbackId); - #else - private void WX_SetStatusBarStyle(string conf, string callbackId){} - #endif - - private Dictionary SetStatusBarStyleOptionList; - public void SetStatusBarStyle(SetStatusBarStyleOption option) - { - if(SetStatusBarStyleOptionList == null){ - SetStatusBarStyleOptionList = new Dictionary(); - } - string id = GetCallbackId(SetStatusBarStyleOptionList); - var callback = new SetStatusBarStyleOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetStatusBarStyleOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetStatusBarStyle(conf,id); - } - public void SetUserCloudStorageCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && SetUserCloudStorageOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(SetUserCloudStorageOptionList.ContainsKey(id)){ - var item = SetUserCloudStorageOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - SetUserCloudStorageOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_SetUserCloudStorage(string conf, string callbackId); - #else - private void WX_SetUserCloudStorage(string conf, string callbackId){} - #endif - - private Dictionary SetUserCloudStorageOptionList; - public void SetUserCloudStorage(SetUserCloudStorageOption option) - { - if(SetUserCloudStorageOptionList == null){ - SetUserCloudStorageOptionList = new Dictionary(); - } - string id = GetCallbackId(SetUserCloudStorageOptionList); - var callback = new SetUserCloudStorageOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - SetUserCloudStorageOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_SetUserCloudStorage(conf,id); - } - public void ShareMessageToFriendCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShareMessageToFriendOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShareMessageToFriendOptionList.ContainsKey(id)){ - var item = ShareMessageToFriendOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShareMessageToFriendOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShareMessageToFriend(string conf, string callbackId); - #else - private void WX_ShareMessageToFriend(string conf, string callbackId){} - #endif - - private Dictionary ShareMessageToFriendOptionList; - public void ShareMessageToFriend(ShareMessageToFriendOption option) - { - if(ShareMessageToFriendOptionList == null){ - ShareMessageToFriendOptionList = new Dictionary(); - } - string id = GetCallbackId(ShareMessageToFriendOptionList); - var callback = new ShareMessageToFriendOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShareMessageToFriendOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShareMessageToFriend(conf,id); - } - public void ShowActionSheetCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShowActionSheetOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShowActionSheetOptionList.ContainsKey(id)){ - var item = ShowActionSheetOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShowActionSheetOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShowActionSheet(string conf, string callbackId); - #else - private void WX_ShowActionSheet(string conf, string callbackId){} - #endif - - private Dictionary ShowActionSheetOptionList; - public void ShowActionSheet(ShowActionSheetOption option) - { - if(ShowActionSheetOptionList == null){ - ShowActionSheetOptionList = new Dictionary(); - } - string id = GetCallbackId(ShowActionSheetOptionList); - var callback = new ShowActionSheetOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShowActionSheetOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShowActionSheet(conf,id); - } - public void ShowKeyboardCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShowKeyboardOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShowKeyboardOptionList.ContainsKey(id)){ - var item = ShowKeyboardOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShowKeyboardOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShowKeyboard(string conf, string callbackId); - #else - private void WX_ShowKeyboard(string conf, string callbackId){} - #endif - - private Dictionary ShowKeyboardOptionList; - public void ShowKeyboard(ShowKeyboardOption option) - { - if(ShowKeyboardOptionList == null){ - ShowKeyboardOptionList = new Dictionary(); - } - string id = GetCallbackId(ShowKeyboardOptionList); - var callback = new ShowKeyboardOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShowKeyboardOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShowKeyboard(conf,id); - } - public void ShowLoadingCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShowLoadingOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShowLoadingOptionList.ContainsKey(id)){ - var item = ShowLoadingOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShowLoadingOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShowLoading(string conf, string callbackId); - #else - private void WX_ShowLoading(string conf, string callbackId){} - #endif - - private Dictionary ShowLoadingOptionList; - public void ShowLoading(ShowLoadingOption option) - { - if(ShowLoadingOptionList == null){ - ShowLoadingOptionList = new Dictionary(); - } - string id = GetCallbackId(ShowLoadingOptionList); - var callback = new ShowLoadingOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShowLoadingOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShowLoading(conf,id); - } - public void ShowModalCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShowModalOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShowModalOptionList.ContainsKey(id)){ - var item = ShowModalOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShowModalOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShowModal(string conf, string callbackId); - #else - private void WX_ShowModal(string conf, string callbackId){} - #endif - - private Dictionary ShowModalOptionList; - public void ShowModal(ShowModalOption option) - { - if(ShowModalOptionList == null){ - ShowModalOptionList = new Dictionary(); - } - string id = GetCallbackId(ShowModalOptionList); - var callback = new ShowModalOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShowModalOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShowModal(conf,id); - } - public void ShowShareImageMenuCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShowShareImageMenuOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShowShareImageMenuOptionList.ContainsKey(id)){ - var item = ShowShareImageMenuOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShowShareImageMenuOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShowShareImageMenu(string conf, string callbackId); - #else - private void WX_ShowShareImageMenu(string conf, string callbackId){} - #endif - - private Dictionary ShowShareImageMenuOptionList; - public void ShowShareImageMenu(ShowShareImageMenuOption option) - { - if(ShowShareImageMenuOptionList == null){ - ShowShareImageMenuOptionList = new Dictionary(); - } - string id = GetCallbackId(ShowShareImageMenuOptionList); - var callback = new ShowShareImageMenuOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShowShareImageMenuOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShowShareImageMenu(conf,id); - } - public void ShowShareMenuCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShowShareMenuOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShowShareMenuOptionList.ContainsKey(id)){ - var item = ShowShareMenuOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShowShareMenuOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShowShareMenu(string conf, string callbackId); - #else - private void WX_ShowShareMenu(string conf, string callbackId){} - #endif - - private Dictionary ShowShareMenuOptionList; - public void ShowShareMenu(ShowShareMenuOption option) - { - if(ShowShareMenuOptionList == null){ - ShowShareMenuOptionList = new Dictionary(); - } - string id = GetCallbackId(ShowShareMenuOptionList); - var callback = new ShowShareMenuOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShowShareMenuOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShowShareMenu(conf,id); - } - public void ShowToastCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && ShowToastOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(ShowToastOptionList.ContainsKey(id)){ - var item = ShowToastOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - ShowToastOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_ShowToast(string conf, string callbackId); - #else - private void WX_ShowToast(string conf, string callbackId){} - #endif - - private Dictionary ShowToastOptionList; - public void ShowToast(ShowToastOption option) - { - if(ShowToastOptionList == null){ - ShowToastOptionList = new Dictionary(); - } - string id = GetCallbackId(ShowToastOptionList); - var callback = new ShowToastOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - ShowToastOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_ShowToast(conf,id); - } - public void StartAccelerometerCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StartAccelerometerOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StartAccelerometerOptionList.ContainsKey(id)){ - var item = StartAccelerometerOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StartAccelerometerOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StartAccelerometer(string conf, string callbackId); - #else - private void WX_StartAccelerometer(string conf, string callbackId){} - #endif - - private Dictionary StartAccelerometerOptionList; - public void StartAccelerometer(StartAccelerometerOption option) - { - if(StartAccelerometerOptionList == null){ - StartAccelerometerOptionList = new Dictionary(); - } - string id = GetCallbackId(StartAccelerometerOptionList); - var callback = new StartAccelerometerOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StartAccelerometerOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StartAccelerometer(conf,id); - } - public void StartBeaconDiscoveryCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StartBeaconDiscoveryOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StartBeaconDiscoveryOptionList.ContainsKey(id)){ - var item = StartBeaconDiscoveryOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StartBeaconDiscoveryOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StartBeaconDiscovery(string conf, string callbackId); - #else - private void WX_StartBeaconDiscovery(string conf, string callbackId){} - #endif - - private Dictionary StartBeaconDiscoveryOptionList; - public void StartBeaconDiscovery(StartBeaconDiscoveryOption option) - { - if(StartBeaconDiscoveryOptionList == null){ - StartBeaconDiscoveryOptionList = new Dictionary(); - } - string id = GetCallbackId(StartBeaconDiscoveryOptionList); - var callback = new StartBeaconDiscoveryOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StartBeaconDiscoveryOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StartBeaconDiscovery(conf,id); - } - public void StartBluetoothDevicesDiscoveryCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StartBluetoothDevicesDiscoveryOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StartBluetoothDevicesDiscoveryOptionList.ContainsKey(id)){ - var item = StartBluetoothDevicesDiscoveryOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StartBluetoothDevicesDiscoveryOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StartBluetoothDevicesDiscovery(string conf, string callbackId); - #else - private void WX_StartBluetoothDevicesDiscovery(string conf, string callbackId){} - #endif - - private Dictionary StartBluetoothDevicesDiscoveryOptionList; - public void StartBluetoothDevicesDiscovery(StartBluetoothDevicesDiscoveryOption option) - { - if(StartBluetoothDevicesDiscoveryOptionList == null){ - StartBluetoothDevicesDiscoveryOptionList = new Dictionary(); - } - string id = GetCallbackId(StartBluetoothDevicesDiscoveryOptionList); - var callback = new StartBluetoothDevicesDiscoveryOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StartBluetoothDevicesDiscoveryOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StartBluetoothDevicesDiscovery(conf,id); - } - public void StartCompassCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StartCompassOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StartCompassOptionList.ContainsKey(id)){ - var item = StartCompassOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StartCompassOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StartCompass(string conf, string callbackId); - #else - private void WX_StartCompass(string conf, string callbackId){} - #endif - - private Dictionary StartCompassOptionList; - public void StartCompass(StartCompassOption option) - { - if(StartCompassOptionList == null){ - StartCompassOptionList = new Dictionary(); - } - string id = GetCallbackId(StartCompassOptionList); - var callback = new StartCompassOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StartCompassOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StartCompass(conf,id); - } - public void StartDeviceMotionListeningCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StartDeviceMotionListeningOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StartDeviceMotionListeningOptionList.ContainsKey(id)){ - var item = StartDeviceMotionListeningOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StartDeviceMotionListeningOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StartDeviceMotionListening(string conf, string callbackId); - #else - private void WX_StartDeviceMotionListening(string conf, string callbackId){} - #endif - - private Dictionary StartDeviceMotionListeningOptionList; - public void StartDeviceMotionListening(StartDeviceMotionListeningOption option) - { - if(StartDeviceMotionListeningOptionList == null){ - StartDeviceMotionListeningOptionList = new Dictionary(); - } - string id = GetCallbackId(StartDeviceMotionListeningOptionList); - var callback = new StartDeviceMotionListeningOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StartDeviceMotionListeningOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StartDeviceMotionListening(conf,id); - } - public void StartGyroscopeCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StartGyroscopeOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StartGyroscopeOptionList.ContainsKey(id)){ - var item = StartGyroscopeOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StartGyroscopeOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StartGyroscope(string conf, string callbackId); - #else - private void WX_StartGyroscope(string conf, string callbackId){} - #endif - - private Dictionary StartGyroscopeOptionList; - public void StartGyroscope(StartGyroscopeOption option) - { - if(StartGyroscopeOptionList == null){ - StartGyroscopeOptionList = new Dictionary(); - } - string id = GetCallbackId(StartGyroscopeOptionList); - var callback = new StartGyroscopeOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StartGyroscopeOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StartGyroscope(conf,id); - } - public void StopAccelerometerCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StopAccelerometerOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StopAccelerometerOptionList.ContainsKey(id)){ - var item = StopAccelerometerOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StopAccelerometerOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StopAccelerometer(string conf, string callbackId); - #else - private void WX_StopAccelerometer(string conf, string callbackId){} - #endif - - private Dictionary StopAccelerometerOptionList; - public void StopAccelerometer(StopAccelerometerOption option) - { - if(StopAccelerometerOptionList == null){ - StopAccelerometerOptionList = new Dictionary(); - } - string id = GetCallbackId(StopAccelerometerOptionList); - var callback = new StopAccelerometerOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StopAccelerometerOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StopAccelerometer(conf,id); - } - public void StopBeaconDiscoveryCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StopBeaconDiscoveryOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StopBeaconDiscoveryOptionList.ContainsKey(id)){ - var item = StopBeaconDiscoveryOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StopBeaconDiscoveryOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StopBeaconDiscovery(string conf, string callbackId); - #else - private void WX_StopBeaconDiscovery(string conf, string callbackId){} - #endif - - private Dictionary StopBeaconDiscoveryOptionList; - public void StopBeaconDiscovery(StopBeaconDiscoveryOption option) - { - if(StopBeaconDiscoveryOptionList == null){ - StopBeaconDiscoveryOptionList = new Dictionary(); - } - string id = GetCallbackId(StopBeaconDiscoveryOptionList); - var callback = new StopBeaconDiscoveryOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StopBeaconDiscoveryOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StopBeaconDiscovery(conf,id); - } - public void StopBluetoothDevicesDiscoveryCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StopBluetoothDevicesDiscoveryOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StopBluetoothDevicesDiscoveryOptionList.ContainsKey(id)){ - var item = StopBluetoothDevicesDiscoveryOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StopBluetoothDevicesDiscoveryOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StopBluetoothDevicesDiscovery(string conf, string callbackId); - #else - private void WX_StopBluetoothDevicesDiscovery(string conf, string callbackId){} - #endif - - private Dictionary StopBluetoothDevicesDiscoveryOptionList; - public void StopBluetoothDevicesDiscovery(StopBluetoothDevicesDiscoveryOption option) - { - if(StopBluetoothDevicesDiscoveryOptionList == null){ - StopBluetoothDevicesDiscoveryOptionList = new Dictionary(); - } - string id = GetCallbackId(StopBluetoothDevicesDiscoveryOptionList); - var callback = new StopBluetoothDevicesDiscoveryOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StopBluetoothDevicesDiscoveryOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StopBluetoothDevicesDiscovery(conf,id); - } - public void StopCompassCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StopCompassOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StopCompassOptionList.ContainsKey(id)){ - var item = StopCompassOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StopCompassOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StopCompass(string conf, string callbackId); - #else - private void WX_StopCompass(string conf, string callbackId){} - #endif - - private Dictionary StopCompassOptionList; - public void StopCompass(StopCompassOption option) - { - if(StopCompassOptionList == null){ - StopCompassOptionList = new Dictionary(); - } - string id = GetCallbackId(StopCompassOptionList); - var callback = new StopCompassOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StopCompassOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StopCompass(conf,id); - } - public void StopDeviceMotionListeningCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StopDeviceMotionListeningOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StopDeviceMotionListeningOptionList.ContainsKey(id)){ - var item = StopDeviceMotionListeningOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StopDeviceMotionListeningOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StopDeviceMotionListening(string conf, string callbackId); - #else - private void WX_StopDeviceMotionListening(string conf, string callbackId){} - #endif - - private Dictionary StopDeviceMotionListeningOptionList; - public void StopDeviceMotionListening(StopDeviceMotionListeningOption option) - { - if(StopDeviceMotionListeningOptionList == null){ - StopDeviceMotionListeningOptionList = new Dictionary(); - } - string id = GetCallbackId(StopDeviceMotionListeningOptionList); - var callback = new StopDeviceMotionListeningOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StopDeviceMotionListeningOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StopDeviceMotionListening(conf,id); - } - public void StopFaceDetectCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StopFaceDetectOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StopFaceDetectOptionList.ContainsKey(id)){ - var item = StopFaceDetectOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StopFaceDetectOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StopFaceDetect(string conf, string callbackId); - #else - private void WX_StopFaceDetect(string conf, string callbackId){} - #endif - - private Dictionary StopFaceDetectOptionList; - public void StopFaceDetect(StopFaceDetectOption option) - { - if(StopFaceDetectOptionList == null){ - StopFaceDetectOptionList = new Dictionary(); - } - string id = GetCallbackId(StopFaceDetectOptionList); - var callback = new StopFaceDetectOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StopFaceDetectOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StopFaceDetect(conf,id); - } - public void StopGyroscopeCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StopGyroscopeOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StopGyroscopeOptionList.ContainsKey(id)){ - var item = StopGyroscopeOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StopGyroscopeOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StopGyroscope(string conf, string callbackId); - #else - private void WX_StopGyroscope(string conf, string callbackId){} - #endif - - private Dictionary StopGyroscopeOptionList; - public void StopGyroscope(StopGyroscopeOption option) - { - if(StopGyroscopeOptionList == null){ - StopGyroscopeOptionList = new Dictionary(); - } - string id = GetCallbackId(StopGyroscopeOptionList); - var callback = new StopGyroscopeOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StopGyroscopeOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StopGyroscope(conf,id); - } - public void UpdateKeyboardCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && UpdateKeyboardOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(UpdateKeyboardOptionList.ContainsKey(id)){ - var item = UpdateKeyboardOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - UpdateKeyboardOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_UpdateKeyboard(string conf, string callbackId); - #else - private void WX_UpdateKeyboard(string conf, string callbackId){} - #endif - - private Dictionary UpdateKeyboardOptionList; - public void UpdateKeyboard(UpdateKeyboardOption option) - { - if(UpdateKeyboardOptionList == null){ - UpdateKeyboardOptionList = new Dictionary(); - } - string id = GetCallbackId(UpdateKeyboardOptionList); - var callback = new UpdateKeyboardOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - UpdateKeyboardOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_UpdateKeyboard(conf,id); - } - public void UpdateShareMenuCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && UpdateShareMenuOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(UpdateShareMenuOptionList.ContainsKey(id)){ - var item = UpdateShareMenuOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - UpdateShareMenuOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_UpdateShareMenu(string conf, string callbackId); - #else - private void WX_UpdateShareMenu(string conf, string callbackId){} - #endif - - private Dictionary UpdateShareMenuOptionList; - public void UpdateShareMenu(UpdateShareMenuOption option) - { - if(UpdateShareMenuOptionList == null){ - UpdateShareMenuOptionList = new Dictionary(); - } - string id = GetCallbackId(UpdateShareMenuOptionList); - var callback = new UpdateShareMenuOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - UpdateShareMenuOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_UpdateShareMenu(conf,id); - } - public void UpdateVoIPChatMuteConfigCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && UpdateVoIPChatMuteConfigOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(UpdateVoIPChatMuteConfigOptionList.ContainsKey(id)){ - var item = UpdateVoIPChatMuteConfigOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - UpdateVoIPChatMuteConfigOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_UpdateVoIPChatMuteConfig(string conf, string callbackId); - #else - private void WX_UpdateVoIPChatMuteConfig(string conf, string callbackId){} - #endif - - private Dictionary UpdateVoIPChatMuteConfigOptionList; - public void UpdateVoIPChatMuteConfig(UpdateVoIPChatMuteConfigOption option) - { - if(UpdateVoIPChatMuteConfigOptionList == null){ - UpdateVoIPChatMuteConfigOptionList = new Dictionary(); - } - string id = GetCallbackId(UpdateVoIPChatMuteConfigOptionList); - var callback = new UpdateVoIPChatMuteConfigOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - UpdateVoIPChatMuteConfigOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_UpdateVoIPChatMuteConfig(conf,id); - } - public void UpdateWeChatAppCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && UpdateWeChatAppOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(UpdateWeChatAppOptionList.ContainsKey(id)){ - var item = UpdateWeChatAppOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - UpdateWeChatAppOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_UpdateWeChatApp(string conf, string callbackId); - #else - private void WX_UpdateWeChatApp(string conf, string callbackId){} - #endif - - private Dictionary UpdateWeChatAppOptionList; - public void UpdateWeChatApp(UpdateWeChatAppOption option) - { - if(UpdateWeChatAppOptionList == null){ - UpdateWeChatAppOptionList = new Dictionary(); - } - string id = GetCallbackId(UpdateWeChatAppOptionList); - var callback = new UpdateWeChatAppOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - UpdateWeChatAppOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_UpdateWeChatApp(conf,id); - } - public void VibrateLongCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && VibrateLongOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(VibrateLongOptionList.ContainsKey(id)){ - var item = VibrateLongOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - VibrateLongOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_VibrateLong(string conf, string callbackId); - #else - private void WX_VibrateLong(string conf, string callbackId){} - #endif - - private Dictionary VibrateLongOptionList; - public void VibrateLong(VibrateLongOption option) - { - if(VibrateLongOptionList == null){ - VibrateLongOptionList = new Dictionary(); - } - string id = GetCallbackId(VibrateLongOptionList); - var callback = new VibrateLongOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - VibrateLongOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_VibrateLong(conf,id); - } - public void VibrateShortCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && VibrateShortOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(VibrateShortOptionList.ContainsKey(id)){ - var item = VibrateShortOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - VibrateShortOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_VibrateShort(string conf, string callbackId); - #else - private void WX_VibrateShort(string conf, string callbackId){} - #endif - - private Dictionary VibrateShortOptionList; - public void VibrateShort(VibrateShortOption option) - { - if(VibrateShortOptionList == null){ - VibrateShortOptionList = new Dictionary(); - } - string id = GetCallbackId(VibrateShortOptionList); - var callback = new VibrateShortOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - VibrateShortOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_VibrateShort(conf,id); - } - public void WriteBLECharacteristicValueCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && WriteBLECharacteristicValueOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(WriteBLECharacteristicValueOptionList.ContainsKey(id)){ - var item = WriteBLECharacteristicValueOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - WriteBLECharacteristicValueOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_WriteBLECharacteristicValue(string conf, string callbackId); - #else - private void WX_WriteBLECharacteristicValue(string conf, string callbackId){} - #endif - - private Dictionary WriteBLECharacteristicValueOptionList; - public void WriteBLECharacteristicValue(WriteBLECharacteristicValueOption option) - { - if(WriteBLECharacteristicValueOptionList == null){ - WriteBLECharacteristicValueOptionList = new Dictionary(); - } - string id = GetCallbackId(WriteBLECharacteristicValueOptionList); - var callback = new WriteBLECharacteristicValueOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - WriteBLECharacteristicValueOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_WriteBLECharacteristicValue(conf,id); - } - public void StartGameLiveCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && StartGameLiveOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(StartGameLiveOptionList.ContainsKey(id)){ - var item = StartGameLiveOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - StartGameLiveOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_StartGameLive(string conf, string callbackId); - #else - private void WX_StartGameLive(string conf, string callbackId){} - #endif - - private Dictionary StartGameLiveOptionList; - public void StartGameLive(StartGameLiveOption option) - { - if(StartGameLiveOptionList == null){ - StartGameLiveOptionList = new Dictionary(); - } - string id = GetCallbackId(StartGameLiveOptionList); - var callback = new StartGameLiveOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - StartGameLiveOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_StartGameLive(conf,id); - } - public void CheckGameLiveEnabledCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && CheckGameLiveEnabledOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(CheckGameLiveEnabledOptionList.ContainsKey(id)){ - var item = CheckGameLiveEnabledOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - CheckGameLiveEnabledOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_CheckGameLiveEnabled(string conf, string callbackId); - #else - private void WX_CheckGameLiveEnabled(string conf, string callbackId){} - #endif - - private Dictionary CheckGameLiveEnabledOptionList; - public void CheckGameLiveEnabled(CheckGameLiveEnabledOption option) - { - if(CheckGameLiveEnabledOptionList == null){ - CheckGameLiveEnabledOptionList = new Dictionary(); - } - string id = GetCallbackId(CheckGameLiveEnabledOptionList); - var callback = new CheckGameLiveEnabledOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - CheckGameLiveEnabledOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_CheckGameLiveEnabled(conf,id); - } - public void GetUserCurrentGameliveInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetUserCurrentGameliveInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetUserCurrentGameliveInfoOptionList.ContainsKey(id)){ - var item = GetUserCurrentGameliveInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetUserCurrentGameliveInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetUserCurrentGameliveInfo(string conf, string callbackId); - #else - private void WX_GetUserCurrentGameliveInfo(string conf, string callbackId){} - #endif - - private Dictionary GetUserCurrentGameliveInfoOptionList; - public void GetUserCurrentGameliveInfo(GetUserCurrentGameliveInfoOption option) - { - if(GetUserCurrentGameliveInfoOptionList == null){ - GetUserCurrentGameliveInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetUserCurrentGameliveInfoOptionList); - var callback = new GetUserCurrentGameliveInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetUserCurrentGameliveInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetUserCurrentGameliveInfo(conf,id); - } - public void GetUserRecentGameLiveInfoCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetUserRecentGameLiveInfoOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetUserRecentGameLiveInfoOptionList.ContainsKey(id)){ - var item = GetUserRecentGameLiveInfoOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetUserRecentGameLiveInfoOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetUserRecentGameLiveInfo(string conf, string callbackId); - #else - private void WX_GetUserRecentGameLiveInfo(string conf, string callbackId){} - #endif - - private Dictionary GetUserRecentGameLiveInfoOptionList; - public void GetUserRecentGameLiveInfo(GetUserRecentGameLiveInfoOption option) - { - if(GetUserRecentGameLiveInfoOptionList == null){ - GetUserRecentGameLiveInfoOptionList = new Dictionary(); - } - string id = GetCallbackId(GetUserRecentGameLiveInfoOptionList); - var callback = new GetUserRecentGameLiveInfoOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetUserRecentGameLiveInfoOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetUserRecentGameLiveInfo(conf,id); - } - public void GetUserGameLiveDetailsCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && GetUserGameLiveDetailsOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(GetUserGameLiveDetailsOptionList.ContainsKey(id)){ - var item = GetUserGameLiveDetailsOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - GetUserGameLiveDetailsOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_GetUserGameLiveDetails(string conf, string callbackId); - #else - private void WX_GetUserGameLiveDetails(string conf, string callbackId){} - #endif - - private Dictionary GetUserGameLiveDetailsOptionList; - public void GetUserGameLiveDetails(GetUserGameLiveDetailsOption option) - { - if(GetUserGameLiveDetailsOptionList == null){ - GetUserGameLiveDetailsOptionList = new Dictionary(); - } - string id = GetCallbackId(GetUserGameLiveDetailsOptionList); - var callback = new GetUserGameLiveDetailsOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - GetUserGameLiveDetailsOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_GetUserGameLiveDetails(conf,id); - } - public void OpenChannelsLiveCollectionCallback(string msg) { - if (!string.IsNullOrEmpty(msg) && OpenChannelsLiveCollectionOptionList != null) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var type = jsCallback.type; - var res = jsCallback.res; - if(OpenChannelsLiveCollectionOptionList.ContainsKey(id)){ - var item = OpenChannelsLiveCollectionOptionList[id]; - if(type == "complete"){ - item.complete?.Invoke(JsonMapper.ToObject(res)); - item.complete = null; - }else{ - if(type == "success"){ - item.success?.Invoke(JsonMapper.ToObject(res)); - } - else if(type == "fail"){ - item.fail?.Invoke(JsonMapper.ToObject(res)); - } - item.success = null; - item.fail = null; - } - if(item.complete == null && item.success == null && item.fail == null){ - OpenChannelsLiveCollectionOptionList.Remove(id); - } - } - } - } - - #if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WX_OpenChannelsLiveCollection(string conf, string callbackId); - #else - private void WX_OpenChannelsLiveCollection(string conf, string callbackId){} - #endif - - private Dictionary OpenChannelsLiveCollectionOptionList; - public void OpenChannelsLiveCollection(OpenChannelsLiveCollectionOption option) - { - if(OpenChannelsLiveCollectionOptionList == null){ - OpenChannelsLiveCollectionOptionList = new Dictionary(); - } - string id = GetCallbackId(OpenChannelsLiveCollectionOptionList); - var callback = new OpenChannelsLiveCollectionOption(){ - success = option.success, - fail = option.fail, - complete = option.complete - }; - OpenChannelsLiveCollectionOptionList.Add( id, callback ); - var succ = option.success; - var fail = option.fail; - var comp = option.complete; - option.success = null; - option.fail = null; - option.complete = null; - var conf = JsonMapper.ToJson(option); - option.success = succ; - option.fail = fail; - option.complete = comp; - WX_OpenChannelsLiveCollection(conf,id); - } - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_RemoveStorageSync(string key); - - public void RemoveStorageSync(string key) - { - - WX_RemoveStorageSync(key); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_ReportEvent(string eventId,string data); - - public void ReportEvent(string eventId,T data) - { - - WX_ReportEvent(eventId,JsonMapper.ToJson(data)); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_ReportMonitor(string name,double value); - - public void ReportMonitor(string name,double value) - { - - WX_ReportMonitor(name,value); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_ReportPerformance(double id,double value,string dimensions); - - public void ReportPerformance(double id,double value,string dimensions) - { - - WX_ReportPerformance(id,value,dimensions); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_ReportUserBehaviorBranchAnalytics(string option); - - public void ReportUserBehaviorBranchAnalytics(ReportUserBehaviorBranchAnalyticsOption option) - { - - WX_ReportUserBehaviorBranchAnalytics(JsonMapper.ToJson(option)); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_ReserveChannelsLive(string option); - - public void ReserveChannelsLive(ReserveChannelsLiveOption option) - { - - WX_ReserveChannelsLive(JsonMapper.ToJson(option)); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_RevokeBufferURL(string url); - - public void RevokeBufferURL(string url) - { - - WX_RevokeBufferURL(url); - } -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - - private static extern void WX_SetPreferredFramesPerSecond(double fps); -#else - private static void WX_SetPreferredFramesPerSecond(double fps) { Application.targetFrameRate = (int)(fps); } -#endif - public void SetPreferredFramesPerSecond(double fps) - { - - WX_SetPreferredFramesPerSecond(fps); - } -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WX_SetStorageSync(string key,string data,bool encrypt); - - public void SetStorageSync(string key,T data,bool encrypt) - { - - WX_SetStorageSync(key,JsonMapper.ToJson(data),encrypt); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_ShareAppMessage(string option); - - public void ShareAppMessage(ShareAppMessageOption option) - { - - WX_ShareAppMessage(JsonMapper.ToJson(option)); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_TriggerGC(); - - public void TriggerGC() - { - WX_TriggerGC(); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_StopDownloadTexture(); - - public void StopDownloadTexture() - { - WX_StopDownloadTexture(); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_StarDownloadTexture(); - - public void StarDownloadTexture() - { - WX_StarDownloadTexture(); - } - - public void _OnAccelerometerChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnAccelerometerChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnAccelerometerChange(); - private Action OnAccelerometerChangeAction; - public void OnAccelerometerChange(Action result) - { - if(OnAccelerometerChangeAction == null){ - WX_OnAccelerometerChange(); - } - OnAccelerometerChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffAccelerometerChange(); - public void OffAccelerometerChange(Action result) - { - if(result == null){ - OnAccelerometerChangeAction = null; - }else{ - OnAccelerometerChangeAction-=result; - } - if(OnAccelerometerChangeAction == null){ - WX_OffAccelerometerChange(); - } - } - public void _OnAudioInterruptionBeginCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnAudioInterruptionBeginAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnAudioInterruptionBegin(); - private Action OnAudioInterruptionBeginAction; - public void OnAudioInterruptionBegin(Action res) - { - if(OnAudioInterruptionBeginAction == null){ - WX_OnAudioInterruptionBegin(); - } - OnAudioInterruptionBeginAction+=res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffAudioInterruptionBegin(); - public void OffAudioInterruptionBegin(Action res) - { - if(res == null){ - OnAudioInterruptionBeginAction = null; - }else{ - OnAudioInterruptionBeginAction-=res; - } - if(OnAudioInterruptionBeginAction == null){ - WX_OffAudioInterruptionBegin(); - } - } - public void _OnAudioInterruptionEndCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnAudioInterruptionEndAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnAudioInterruptionEnd(); - private Action OnAudioInterruptionEndAction; - public void OnAudioInterruptionEnd(Action res) - { - if(OnAudioInterruptionEndAction == null){ - WX_OnAudioInterruptionEnd(); - } - OnAudioInterruptionEndAction+=res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffAudioInterruptionEnd(); - public void OffAudioInterruptionEnd(Action res) - { - if(res == null){ - OnAudioInterruptionEndAction = null; - }else{ - OnAudioInterruptionEndAction-=res; - } - if(OnAudioInterruptionEndAction == null){ - WX_OffAudioInterruptionEnd(); - } - } - public void _OnBLECharacteristicValueChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBLECharacteristicValueChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBLECharacteristicValueChange(); - private Action OnBLECharacteristicValueChangeAction; - public void OnBLECharacteristicValueChange(Action result) - { - if(OnBLECharacteristicValueChangeAction == null){ - WX_OnBLECharacteristicValueChange(); - } - OnBLECharacteristicValueChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBLECharacteristicValueChange(); - public void OffBLECharacteristicValueChange(Action result) - { - if(result == null){ - OnBLECharacteristicValueChangeAction = null; - }else{ - OnBLECharacteristicValueChangeAction-=result; - } - if(OnBLECharacteristicValueChangeAction == null){ - WX_OffBLECharacteristicValueChange(); - } - } - public void _OnBLEConnectionStateChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBLEConnectionStateChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBLEConnectionStateChange(); - private Action OnBLEConnectionStateChangeAction; - public void OnBLEConnectionStateChange(Action result) - { - if(OnBLEConnectionStateChangeAction == null){ - WX_OnBLEConnectionStateChange(); - } - OnBLEConnectionStateChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBLEConnectionStateChange(); - public void OffBLEConnectionStateChange(Action result) - { - if(result == null){ - OnBLEConnectionStateChangeAction = null; - }else{ - OnBLEConnectionStateChangeAction-=result; - } - if(OnBLEConnectionStateChangeAction == null){ - WX_OffBLEConnectionStateChange(); - } - } - public void _OnBLEMTUChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBLEMTUChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBLEMTUChange(); - private Action OnBLEMTUChangeAction; - public void OnBLEMTUChange(Action result) - { - if(OnBLEMTUChangeAction == null){ - WX_OnBLEMTUChange(); - } - OnBLEMTUChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBLEMTUChange(); - public void OffBLEMTUChange(Action result) - { - if(result == null){ - OnBLEMTUChangeAction = null; - }else{ - OnBLEMTUChangeAction-=result; - } - if(OnBLEMTUChangeAction == null){ - WX_OffBLEMTUChange(); - } - } - public void _OnBLEPeripheralConnectionStateChangedCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBLEPeripheralConnectionStateChangedAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBLEPeripheralConnectionStateChanged(); - private Action OnBLEPeripheralConnectionStateChangedAction; - public void OnBLEPeripheralConnectionStateChanged(Action result) - { - if(OnBLEPeripheralConnectionStateChangedAction == null){ - WX_OnBLEPeripheralConnectionStateChanged(); - } - OnBLEPeripheralConnectionStateChangedAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBLEPeripheralConnectionStateChanged(); - public void OffBLEPeripheralConnectionStateChanged(Action result) - { - if(result == null){ - OnBLEPeripheralConnectionStateChangedAction = null; - }else{ - OnBLEPeripheralConnectionStateChangedAction-=result; - } - if(OnBLEPeripheralConnectionStateChangedAction == null){ - WX_OffBLEPeripheralConnectionStateChanged(); - } - } - public void _OnBeaconServiceChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBeaconServiceChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBeaconServiceChange(); - private Action OnBeaconServiceChangeAction; - public void OnBeaconServiceChange(Action result) - { - if(OnBeaconServiceChangeAction == null){ - WX_OnBeaconServiceChange(); - } - OnBeaconServiceChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBeaconServiceChange(); - public void OffBeaconServiceChange(Action result) - { - if(result == null){ - OnBeaconServiceChangeAction = null; - }else{ - OnBeaconServiceChangeAction-=result; - } - if(OnBeaconServiceChangeAction == null){ - WX_OffBeaconServiceChange(); - } - } - public void _OnBeaconUpdateCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBeaconUpdateAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBeaconUpdate(); - private Action OnBeaconUpdateAction; - public void OnBeaconUpdate(Action result) - { - if(OnBeaconUpdateAction == null){ - WX_OnBeaconUpdate(); - } - OnBeaconUpdateAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBeaconUpdate(); - public void OffBeaconUpdate(Action result) - { - if(result == null){ - OnBeaconUpdateAction = null; - }else{ - OnBeaconUpdateAction-=result; - } - if(OnBeaconUpdateAction == null){ - WX_OffBeaconUpdate(); - } - } - public void _OnBluetoothAdapterStateChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBluetoothAdapterStateChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBluetoothAdapterStateChange(); - private Action OnBluetoothAdapterStateChangeAction; - public void OnBluetoothAdapterStateChange(Action result) - { - if(OnBluetoothAdapterStateChangeAction == null){ - WX_OnBluetoothAdapterStateChange(); - } - OnBluetoothAdapterStateChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBluetoothAdapterStateChange(); - public void OffBluetoothAdapterStateChange(Action result) - { - if(result == null){ - OnBluetoothAdapterStateChangeAction = null; - }else{ - OnBluetoothAdapterStateChangeAction-=result; - } - if(OnBluetoothAdapterStateChangeAction == null){ - WX_OffBluetoothAdapterStateChange(); - } - } - public void _OnBluetoothDeviceFoundCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnBluetoothDeviceFoundAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnBluetoothDeviceFound(); - private Action OnBluetoothDeviceFoundAction; - public void OnBluetoothDeviceFound(Action result) - { - if(OnBluetoothDeviceFoundAction == null){ - WX_OnBluetoothDeviceFound(); - } - OnBluetoothDeviceFoundAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffBluetoothDeviceFound(); - public void OffBluetoothDeviceFound(Action result) - { - if(result == null){ - OnBluetoothDeviceFoundAction = null; - }else{ - OnBluetoothDeviceFoundAction-=result; - } - if(OnBluetoothDeviceFoundAction == null){ - WX_OffBluetoothDeviceFound(); - } - } - public void _OnCompassChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnCompassChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnCompassChange(); - private Action OnCompassChangeAction; - public void OnCompassChange(Action result) - { - if(OnCompassChangeAction == null){ - WX_OnCompassChange(); - } - OnCompassChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffCompassChange(); - public void OffCompassChange(Action result) - { - if(result == null){ - OnCompassChangeAction = null; - }else{ - OnCompassChangeAction-=result; - } - if(OnCompassChangeAction == null){ - WX_OffCompassChange(); - } - } - public void _OnDeviceMotionChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnDeviceMotionChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnDeviceMotionChange(); - private Action OnDeviceMotionChangeAction; - public void OnDeviceMotionChange(Action result) - { - if(OnDeviceMotionChangeAction == null){ - WX_OnDeviceMotionChange(); - } - OnDeviceMotionChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffDeviceMotionChange(); - public void OffDeviceMotionChange(Action result) - { - if(result == null){ - OnDeviceMotionChangeAction = null; - }else{ - OnDeviceMotionChangeAction-=result; - } - if(OnDeviceMotionChangeAction == null){ - WX_OffDeviceMotionChange(); - } - } - public void _OnDeviceOrientationChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnDeviceOrientationChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnDeviceOrientationChange(); - private Action OnDeviceOrientationChangeAction; - public void OnDeviceOrientationChange(Action result) - { - if(OnDeviceOrientationChangeAction == null){ - WX_OnDeviceOrientationChange(); - } - OnDeviceOrientationChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffDeviceOrientationChange(); - public void OffDeviceOrientationChange(Action result) - { - if(result == null){ - OnDeviceOrientationChangeAction = null; - }else{ - OnDeviceOrientationChangeAction-=result; - } - if(OnDeviceOrientationChangeAction == null){ - WX_OffDeviceOrientationChange(); - } - } - public void _OnErrorCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnErrorAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnError(); - private Action OnErrorAction; - public void OnError(Action result) - { - if(OnErrorAction == null){ - WX_OnError(); - } - OnErrorAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffError(); - public void OffError(Action result) - { - if(result == null){ - OnErrorAction = null; - }else{ - OnErrorAction-=result; - } - if(OnErrorAction == null){ - WX_OffError(); - } - } - public void _OnGyroscopeChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnGyroscopeChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnGyroscopeChange(); - private Action OnGyroscopeChangeAction; - public void OnGyroscopeChange(Action result) - { - if(OnGyroscopeChangeAction == null){ - WX_OnGyroscopeChange(); - } - OnGyroscopeChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffGyroscopeChange(); - public void OffGyroscopeChange(Action result) - { - if(result == null){ - OnGyroscopeChangeAction = null; - }else{ - OnGyroscopeChangeAction-=result; - } - if(OnGyroscopeChangeAction == null){ - WX_OffGyroscopeChange(); - } - } - public void _OnHideCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnHideAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnHide(); - private Action OnHideAction; - public void OnHide(Action res) - { - if(OnHideAction == null){ - WX_OnHide(); - } - OnHideAction+=res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffHide(); - public void OffHide(Action res) - { - if(res == null){ - OnHideAction = null; - }else{ - OnHideAction-=res; - } - if(OnHideAction == null){ - WX_OffHide(); - } - } - public void _OnInteractiveStorageModifiedCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnInteractiveStorageModifiedAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnInteractiveStorageModified(); - private Action OnInteractiveStorageModifiedAction; - public void OnInteractiveStorageModified(Action res) - { - if(OnInteractiveStorageModifiedAction == null){ - WX_OnInteractiveStorageModified(); - } - OnInteractiveStorageModifiedAction+=res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffInteractiveStorageModified(); - public void OffInteractiveStorageModified(Action res) - { - if(res == null){ - OnInteractiveStorageModifiedAction = null; - }else{ - OnInteractiveStorageModifiedAction-=res; - } - if(OnInteractiveStorageModifiedAction == null){ - WX_OffInteractiveStorageModified(); - } - } - public void _OnKeyDownCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnKeyDownAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnKeyDown(); - private Action OnKeyDownAction; - public void OnKeyDown(Action result) - { - if(OnKeyDownAction == null){ - WX_OnKeyDown(); - } - OnKeyDownAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffKeyDown(); - public void OffKeyDown(Action result) - { - if(result == null){ - OnKeyDownAction = null; - }else{ - OnKeyDownAction-=result; - } - if(OnKeyDownAction == null){ - WX_OffKeyDown(); - } - } - public void _OnKeyUpCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnKeyUpAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnKeyUp(); - private Action OnKeyUpAction; - public void OnKeyUp(Action result) - { - if(OnKeyUpAction == null){ - WX_OnKeyUp(); - } - OnKeyUpAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffKeyUp(); - public void OffKeyUp(Action result) - { - if(result == null){ - OnKeyUpAction = null; - }else{ - OnKeyUpAction-=result; - } - if(OnKeyUpAction == null){ - WX_OffKeyUp(); - } - } - public void _OnKeyboardCompleteCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnKeyboardCompleteAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnKeyboardComplete(); - private Action OnKeyboardCompleteAction; - public void OnKeyboardComplete(Action result) - { - if(OnKeyboardCompleteAction == null){ - WX_OnKeyboardComplete(); - } - OnKeyboardCompleteAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffKeyboardComplete(); - public void OffKeyboardComplete(Action result) - { - if(result == null){ - OnKeyboardCompleteAction = null; - }else{ - OnKeyboardCompleteAction-=result; - } - if(OnKeyboardCompleteAction == null){ - WX_OffKeyboardComplete(); - } - } - public void _OnKeyboardConfirmCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnKeyboardConfirmAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnKeyboardConfirm(); - private Action OnKeyboardConfirmAction; - public void OnKeyboardConfirm(Action result) - { - if(OnKeyboardConfirmAction == null){ - WX_OnKeyboardConfirm(); - } - OnKeyboardConfirmAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffKeyboardConfirm(); - public void OffKeyboardConfirm(Action result) - { - if(result == null){ - OnKeyboardConfirmAction = null; - }else{ - OnKeyboardConfirmAction-=result; - } - if(OnKeyboardConfirmAction == null){ - WX_OffKeyboardConfirm(); - } - } - public void _OnKeyboardHeightChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnKeyboardHeightChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnKeyboardHeightChange(); - private Action OnKeyboardHeightChangeAction; - public void OnKeyboardHeightChange(Action result) - { - if(OnKeyboardHeightChangeAction == null){ - WX_OnKeyboardHeightChange(); - } - OnKeyboardHeightChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffKeyboardHeightChange(); - public void OffKeyboardHeightChange(Action result) - { - if(result == null){ - OnKeyboardHeightChangeAction = null; - }else{ - OnKeyboardHeightChangeAction-=result; - } - if(OnKeyboardHeightChangeAction == null){ - WX_OffKeyboardHeightChange(); - } - } - public void _OnKeyboardInputCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnKeyboardInputAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnKeyboardInput(); - private Action OnKeyboardInputAction; - public void OnKeyboardInput(Action result) - { - if(OnKeyboardInputAction == null){ - WX_OnKeyboardInput(); - } - OnKeyboardInputAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffKeyboardInput(); - public void OffKeyboardInput(Action result) - { - if(result == null){ - OnKeyboardInputAction = null; - }else{ - OnKeyboardInputAction-=result; - } - if(OnKeyboardInputAction == null){ - WX_OffKeyboardInput(); - } - } - public void _OnMemoryWarningCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnMemoryWarningAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnMemoryWarning(); - private Action OnMemoryWarningAction; - public void OnMemoryWarning(Action result) - { - if(OnMemoryWarningAction == null){ - WX_OnMemoryWarning(); - } - OnMemoryWarningAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffMemoryWarning(); - public void OffMemoryWarning(Action result) - { - if(result == null){ - OnMemoryWarningAction = null; - }else{ - OnMemoryWarningAction-=result; - } - if(OnMemoryWarningAction == null){ - WX_OffMemoryWarning(); - } - } - public void _OnMessageCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnMessageAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnMessage(); - private Action OnMessageAction; - public void OnMessage(Action res) - { - if(OnMessageAction == null){ - WX_OnMessage(); - } - OnMessageAction+=res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffMessage(); - public void OffMessage(Action res) - { - if(res == null){ - OnMessageAction = null; - }else{ - OnMessageAction-=res; - } - if(OnMessageAction == null){ - WX_OffMessage(); - } - } - public void _OnNetworkStatusChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnNetworkStatusChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnNetworkStatusChange(); - private Action OnNetworkStatusChangeAction; - public void OnNetworkStatusChange(Action result) - { - if(OnNetworkStatusChangeAction == null){ - WX_OnNetworkStatusChange(); - } - OnNetworkStatusChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffNetworkStatusChange(); - public void OffNetworkStatusChange(Action result) - { - if(result == null){ - OnNetworkStatusChangeAction = null; - }else{ - OnNetworkStatusChangeAction-=result; - } - if(OnNetworkStatusChangeAction == null){ - WX_OffNetworkStatusChange(); - } - } - public void _OnNetworkWeakChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnNetworkWeakChangeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnNetworkWeakChange(); - private Action OnNetworkWeakChangeAction; - public void OnNetworkWeakChange(Action result) - { - if(OnNetworkWeakChangeAction == null){ - WX_OnNetworkWeakChange(); - } - OnNetworkWeakChangeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffNetworkWeakChange(); - public void OffNetworkWeakChange(Action result) - { - if(result == null){ - OnNetworkWeakChangeAction = null; - }else{ - OnNetworkWeakChangeAction-=result; - } - if(OnNetworkWeakChangeAction == null){ - WX_OffNetworkWeakChange(); - } - } - public void _OnShareMessageToFriendCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnShareMessageToFriendAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnShareMessageToFriend(); - private Action OnShareMessageToFriendAction; - public void OnShareMessageToFriend(Action result) - { - if(OnShareMessageToFriendAction == null){ - WX_OnShareMessageToFriend(); - } - OnShareMessageToFriendAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffShareMessageToFriend(); - public void OffShareMessageToFriend(Action result) - { - if(result == null){ - OnShareMessageToFriendAction = null; - }else{ - OnShareMessageToFriendAction-=result; - } - if(OnShareMessageToFriendAction == null){ - WX_OffShareMessageToFriend(); - } - } - public void _OnShowCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnShowAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnShow(); - private Action OnShowAction; - public void OnShow(Action result) - { - if(OnShowAction == null){ - WX_OnShow(); - } - OnShowAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffShow(); - public void OffShow(Action result) - { - if(result == null){ - OnShowAction = null; - }else{ - OnShowAction-=result; - } - if(OnShowAction == null){ - WX_OffShow(); - } - } - public void _OnSocketCloseCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnSocketCloseAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnSocketClose(); - private Action OnSocketCloseAction; - public void OnSocketClose(Action result) - { - if(OnSocketCloseAction == null){ - WX_OnSocketClose(); - } - OnSocketCloseAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffSocketClose(); - public void OffSocketClose(Action result) - { - if(result == null){ - OnSocketCloseAction = null; - }else{ - OnSocketCloseAction-=result; - } - if(OnSocketCloseAction == null){ - WX_OffSocketClose(); - } - } - public void _OnSocketErrorCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnSocketErrorAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnSocketError(); - private Action OnSocketErrorAction; - public void OnSocketError(Action result) - { - if(OnSocketErrorAction == null){ - WX_OnSocketError(); - } - OnSocketErrorAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffSocketError(); - public void OffSocketError(Action result) - { - if(result == null){ - OnSocketErrorAction = null; - }else{ - OnSocketErrorAction-=result; - } - if(OnSocketErrorAction == null){ - WX_OffSocketError(); - } - } - public void _OnSocketMessageCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnSocketMessageAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnSocketMessage(); - private Action OnSocketMessageAction; - public void OnSocketMessage(Action result) - { - if(OnSocketMessageAction == null){ - WX_OnSocketMessage(); - } - OnSocketMessageAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffSocketMessage(); - public void OffSocketMessage(Action result) - { - if(result == null){ - OnSocketMessageAction = null; - }else{ - OnSocketMessageAction-=result; - } - if(OnSocketMessageAction == null){ - WX_OffSocketMessage(); - } - } - public void _OnSocketOpenCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnSocketOpenAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnSocketOpen(); - private Action OnSocketOpenAction; - public void OnSocketOpen(Action result) - { - if(OnSocketOpenAction == null){ - WX_OnSocketOpen(); - } - OnSocketOpenAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffSocketOpen(); - public void OffSocketOpen(Action result) - { - if(result == null){ - OnSocketOpenAction = null; - }else{ - OnSocketOpenAction-=result; - } - if(OnSocketOpenAction == null){ - WX_OffSocketOpen(); - } - } - public void _OnTouchCancelCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnTouchCancelAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnTouchCancel(); - private Action OnTouchCancelAction; - public void OnTouchCancel(Action result) - { - if(OnTouchCancelAction == null){ - WX_OnTouchCancel(); - } - OnTouchCancelAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffTouchCancel(); - public void OffTouchCancel(Action result) - { - if(result == null){ - OnTouchCancelAction = null; - }else{ - OnTouchCancelAction-=result; - } - if(OnTouchCancelAction == null){ - WX_OffTouchCancel(); - } - } - public void _OnTouchEndCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnTouchEndAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnTouchEnd(); - private Action OnTouchEndAction; - public void OnTouchEnd(Action result) - { - if(OnTouchEndAction == null){ - WX_OnTouchEnd(); - } - OnTouchEndAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffTouchEnd(); - public void OffTouchEnd(Action result) - { - if(result == null){ - OnTouchEndAction = null; - }else{ - OnTouchEndAction-=result; - } - if(OnTouchEndAction == null){ - WX_OffTouchEnd(); - } - } - public void _OnTouchMoveCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnTouchMoveAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnTouchMove(); - private Action OnTouchMoveAction; - public void OnTouchMove(Action result) - { - if(OnTouchMoveAction == null){ - WX_OnTouchMove(); - } - OnTouchMoveAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffTouchMove(); - public void OffTouchMove(Action result) - { - if(result == null){ - OnTouchMoveAction = null; - }else{ - OnTouchMoveAction-=result; - } - if(OnTouchMoveAction == null){ - WX_OffTouchMove(); - } - } - public void _OnTouchStartCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnTouchStartAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnTouchStart(); - private Action OnTouchStartAction; - public void OnTouchStart(Action result) - { - if(OnTouchStartAction == null){ - WX_OnTouchStart(); - } - OnTouchStartAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffTouchStart(); - public void OffTouchStart(Action result) - { - if(result == null){ - OnTouchStartAction = null; - }else{ - OnTouchStartAction-=result; - } - if(OnTouchStartAction == null){ - WX_OffTouchStart(); - } - } - public void _OnUnhandledRejectionCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnUnhandledRejectionAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnUnhandledRejection(); - private Action OnUnhandledRejectionAction; - public void OnUnhandledRejection(Action result) - { - if(OnUnhandledRejectionAction == null){ - WX_OnUnhandledRejection(); - } - OnUnhandledRejectionAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffUnhandledRejection(); - public void OffUnhandledRejection(Action result) - { - if(result == null){ - OnUnhandledRejectionAction = null; - }else{ - OnUnhandledRejectionAction-=result; - } - if(OnUnhandledRejectionAction == null){ - WX_OffUnhandledRejection(); - } - } - public void _OnUserCaptureScreenCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnUserCaptureScreenAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnUserCaptureScreen(); - private Action OnUserCaptureScreenAction; - public void OnUserCaptureScreen(Action res) - { - if(OnUserCaptureScreenAction == null){ - WX_OnUserCaptureScreen(); - } - OnUserCaptureScreenAction+=res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffUserCaptureScreen(); - public void OffUserCaptureScreen(Action res) - { - if(res == null){ - OnUserCaptureScreenAction = null; - }else{ - OnUserCaptureScreenAction-=res; - } - if(OnUserCaptureScreenAction == null){ - WX_OffUserCaptureScreen(); - } - } - public void _OnVoIPChatInterruptedCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnVoIPChatInterruptedAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnVoIPChatInterrupted(); - private Action OnVoIPChatInterruptedAction; - public void OnVoIPChatInterrupted(Action result) - { - if(OnVoIPChatInterruptedAction == null){ - WX_OnVoIPChatInterrupted(); - } - OnVoIPChatInterruptedAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffVoIPChatInterrupted(); - public void OffVoIPChatInterrupted(Action result) - { - if(result == null){ - OnVoIPChatInterruptedAction = null; - }else{ - OnVoIPChatInterruptedAction-=result; - } - if(OnVoIPChatInterruptedAction == null){ - WX_OffVoIPChatInterrupted(); - } - } - public void _OnVoIPChatMembersChangedCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnVoIPChatMembersChangedAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnVoIPChatMembersChanged(); - private Action OnVoIPChatMembersChangedAction; - public void OnVoIPChatMembersChanged(Action result) - { - if(OnVoIPChatMembersChangedAction == null){ - WX_OnVoIPChatMembersChanged(); - } - OnVoIPChatMembersChangedAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffVoIPChatMembersChanged(); - public void OffVoIPChatMembersChanged(Action result) - { - if(result == null){ - OnVoIPChatMembersChangedAction = null; - }else{ - OnVoIPChatMembersChangedAction-=result; - } - if(OnVoIPChatMembersChangedAction == null){ - WX_OffVoIPChatMembersChanged(); - } - } - public void _OnVoIPChatSpeakersChangedCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnVoIPChatSpeakersChangedAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnVoIPChatSpeakersChanged(); - private Action OnVoIPChatSpeakersChangedAction; - public void OnVoIPChatSpeakersChanged(Action result) - { - if(OnVoIPChatSpeakersChangedAction == null){ - WX_OnVoIPChatSpeakersChanged(); - } - OnVoIPChatSpeakersChangedAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffVoIPChatSpeakersChanged(); - public void OffVoIPChatSpeakersChanged(Action result) - { - if(result == null){ - OnVoIPChatSpeakersChangedAction = null; - }else{ - OnVoIPChatSpeakersChangedAction-=result; - } - if(OnVoIPChatSpeakersChangedAction == null){ - WX_OffVoIPChatSpeakersChanged(); - } - } - public void _OnVoIPChatStateChangedCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnVoIPChatStateChangedAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnVoIPChatStateChanged(); - private Action OnVoIPChatStateChangedAction; - public void OnVoIPChatStateChanged(Action result) - { - if(OnVoIPChatStateChangedAction == null){ - WX_OnVoIPChatStateChanged(); - } - OnVoIPChatStateChangedAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffVoIPChatStateChanged(); - public void OffVoIPChatStateChanged(Action result) - { - if(result == null){ - OnVoIPChatStateChangedAction = null; - }else{ - OnVoIPChatStateChangedAction-=result; - } - if(OnVoIPChatStateChangedAction == null){ - WX_OffVoIPChatStateChanged(); - } - } - public void _OnWindowResizeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnWindowResizeAction?.Invoke(res); - } - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnWindowResize(); - private Action OnWindowResizeAction; - public void OnWindowResize(Action result) - { - if(OnWindowResizeAction == null){ - WX_OnWindowResize(); - } - OnWindowResizeAction+=result; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffWindowResize(); - public void OffWindowResize(Action result) - { - if(result == null){ - OnWindowResizeAction = null; - }else{ - OnWindowResizeAction-=result; - } - if(OnWindowResizeAction == null){ - WX_OffWindowResize(); - } - } - - public void _OnAddToFavoritesCallback(string msg){ - OnAddToFavoritesAction?.Invoke((OnAddToFavoritesCallbackResult param) => - { - if (param == null) - { - param = new OnAddToFavoritesCallbackResult(); - } - WX_OnAddToFavorites_Resolve(JsonMapper.ToJson(param)); - }); - - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnAddToFavorites_Resolve(string conf); - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnAddToFavorites(); - private Action> OnAddToFavoritesAction; - public void OnAddToFavorites(Action> callback) - { - OnAddToFavoritesAction=callback; - WX_OnAddToFavorites(); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffAddToFavorites(); - public void OffAddToFavorites(Action> callback) - { - if(callback == null){ - OnAddToFavoritesAction = null; - }else{ - OnAddToFavoritesAction-=callback; - } - if(OnAddToFavoritesAction == null){ - WX_OffAddToFavorites(); - } - } - public void _OnCopyUrlCallback(string msg){ - OnCopyUrlAction?.Invoke((OnCopyUrlCallbackResult param) => - { - if (param == null) - { - param = new OnCopyUrlCallbackResult(); - } - WX_OnCopyUrl_Resolve(JsonMapper.ToJson(param)); - }); - - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnCopyUrl_Resolve(string conf); - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnCopyUrl(); - private Action> OnCopyUrlAction; - public void OnCopyUrl(Action> callback) - { - OnCopyUrlAction=callback; - WX_OnCopyUrl(); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffCopyUrl(); - public void OffCopyUrl(Action> callback) - { - if(callback == null){ - OnCopyUrlAction = null; - }else{ - OnCopyUrlAction-=callback; - } - if(OnCopyUrlAction == null){ - WX_OffCopyUrl(); - } - } - public void _OnHandoffCallback(string msg){ - OnHandoffAction?.Invoke((OnHandoffCallbackResult param) => - { - if (param == null) - { - param = new OnHandoffCallbackResult(); - } - WX_OnHandoff_Resolve(JsonMapper.ToJson(param)); - }); - - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnHandoff_Resolve(string conf); - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnHandoff(); - private Action> OnHandoffAction; - public void OnHandoff(Action> callback) - { - OnHandoffAction=callback; - WX_OnHandoff(); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffHandoff(); - public void OffHandoff(Action> callback) - { - if(callback == null){ - OnHandoffAction = null; - }else{ - OnHandoffAction-=callback; - } - if(OnHandoffAction == null){ - WX_OffHandoff(); - } - } - public void _OnShareTimelineCallback(string msg){ - OnShareTimelineAction?.Invoke((OnShareTimelineCallbackResult param) => - { - if (param == null) - { - param = new OnShareTimelineCallbackResult(); - } - WX_OnShareTimeline_Resolve(JsonMapper.ToJson(param)); - }); - - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnShareTimeline_Resolve(string conf); - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnShareTimeline(); - private Action> OnShareTimelineAction; - public void OnShareTimeline(Action> callback) - { - OnShareTimelineAction=callback; - WX_OnShareTimeline(); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffShareTimeline(); - public void OffShareTimeline(Action> callback) - { - if(callback == null){ - OnShareTimelineAction = null; - }else{ - OnShareTimelineAction-=callback; - } - if(OnShareTimelineAction == null){ - WX_OffShareTimeline(); - } - } - public void _OnGameLiveStateChangeCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var res = JsonMapper.ToObject(msg); - OnGameLiveStateChangeAction?.Invoke(res,(OnGameLiveStateChangeCallbackResponse param) => - { - if (param == null) - { - param = new OnGameLiveStateChangeCallbackResponse(); - } - WX_OnGameLiveStateChange_Resolve(JsonMapper.ToJson(param)); - }); - } - - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnGameLiveStateChange_Resolve(string conf); - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OnGameLiveStateChange(); - private Action> OnGameLiveStateChangeAction; - public void OnGameLiveStateChange(Action> callback) - { - OnGameLiveStateChangeAction=callback; - WX_OnGameLiveStateChange(); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WX_OffGameLiveStateChange(); - public void OffGameLiveStateChange(Action> callback) - { - if(callback == null){ - OnGameLiveStateChangeAction = null; - }else{ - OnGameLiveStateChangeAction-=callback; - } - if(OnGameLiveStateChangeAction == null){ - WX_OffGameLiveStateChange(); - } - } - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern bool WX_SetHandoffQuery(string query); - public bool SetHandoffQuery(string query) - { - var res = WX_SetHandoffQuery(query); - return res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetAccountInfoSync(); - public AccountInfo GetAccountInfoSync() - { - var res = WX_GetAccountInfoSync(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetBatteryInfoSync(); - public GetBatteryInfoSyncResult GetBatteryInfoSync() - { - var res = WX_GetBatteryInfoSync(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetEnterOptionsSync(); - public EnterOptionsGame GetEnterOptionsSync() - { - var res = WX_GetEnterOptionsSync(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetExptInfoSync(string keys); - public T GetExptInfoSync(string[] keys) - { - var res = WX_GetExptInfoSync(JsonMapper.ToJson(keys)); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetExtConfigSync(); - public T GetExtConfigSync() - { - var res = WX_GetExtConfigSync(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetLaunchOptionsSync(); - public LaunchOptionsGame GetLaunchOptionsSync() - { - var res = WX_GetLaunchOptionsSync(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetMenuButtonBoundingClientRect(); - public ClientRect GetMenuButtonBoundingClientRect() - { - var res = WX_GetMenuButtonBoundingClientRect(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetStorageInfoSync(); - public GetStorageInfoSyncOption GetStorageInfoSync() - { - var res = WX_GetStorageInfoSync(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetSystemInfoSync(); - public SystemInfo GetSystemInfoSync() - { - var res = WX_GetSystemInfoSync(); - return JsonMapper.ToObject(res); - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern bool WX_SetCursor(string path,double x,double y); - public bool SetCursor(string path,double x,double y) - { - var res = WX_SetCursor(path,x,y); - return res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern bool WX_SetMessageToFriendQuery(string option); - public bool SetMessageToFriendQuery(SetMessageToFriendQueryOption option) - { - var res = WX_SetMessageToFriendQuery(JsonMapper.ToJson(option)); - return res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern double WX_GetTextLineHeight(string option); - public double GetTextLineHeight(GetTextLineHeightOption option) - { - var res = WX_GetTextLineHeight(JsonMapper.ToJson(option)); - return res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_LoadFont(string path); - public string LoadFont(string path) - { - var res = WX_LoadFont(path); - return res; - } - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetGameLiveState(); - public GameLiveState GetGameLiveState() - { - var res = WX_GetGameLiveState(); - return JsonMapper.ToObject(res); - } - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern string WX_GetUpdateManager(); - private Dictionary UpdateManagerList = new Dictionary(); - public UpdateManager GetUpdateManager() - { - var id = WX_GetUpdateManager(); - var obj = new UpdateManager(id); - UpdateManagerList.Add(id,obj); - return obj; - } - - -#if UNITY_WEBGL -[DllImport("__Internal")] -#endif -private static extern void WX_ApplyUpdate(string id); -public void ApplyUpdate(string id){ - WX_ApplyUpdate(id); -} - -public void _OnCheckForUpdateCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var res = jsCallback.res; - if(!OnCheckForUpdateActionList.ContainsKey(id)){ - return; - } - var result = JsonMapper.ToObject(msg); - OnCheckForUpdateActionList[id]?.Invoke(result); - } -} -#if UNITY_WEBGL -[DllImport("__Internal")] -#endif -private static extern void WX_OnCheckForUpdate(string id); -private Dictionary> OnCheckForUpdateActionList; -public void OnCheckForUpdate(string id,Action callback){ - if(OnCheckForUpdateActionList == null){ - OnCheckForUpdateActionList = new Dictionary>(); - } - if(OnCheckForUpdateActionList.ContainsKey(id)){ - OnCheckForUpdateActionList[id] += callback; - }else{ - OnCheckForUpdateActionList.Add(id,callback); - WX_OnCheckForUpdate(id); - } -} - -public void _OnUpdateFailedCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var res = jsCallback.res; - if(!OnUpdateFailedActionList.ContainsKey(id)){ - return; - } - var result = JsonMapper.ToObject(msg); - OnUpdateFailedActionList[id]?.Invoke(result); - } -} -#if UNITY_WEBGL -[DllImport("__Internal")] -#endif -private static extern void WX_OnUpdateFailed(string id); -private Dictionary> OnUpdateFailedActionList; -public void OnUpdateFailed(string id,Action callback){ - if(OnUpdateFailedActionList == null){ - OnUpdateFailedActionList = new Dictionary>(); - } - if(OnUpdateFailedActionList.ContainsKey(id)){ - OnUpdateFailedActionList[id] += callback; - }else{ - OnUpdateFailedActionList.Add(id,callback); - WX_OnUpdateFailed(id); - } -} - -public void _OnUpdateReadyCallback(string msg){ - if (!string.IsNullOrEmpty(msg)) - { - var jsCallback = JsonUtility.FromJson(msg); - var id = jsCallback.callbackId; - var res = jsCallback.res; - if(!OnUpdateReadyActionList.ContainsKey(id)){ - return; - } - var result = JsonMapper.ToObject(msg); - OnUpdateReadyActionList[id]?.Invoke(result); - } -} -#if UNITY_WEBGL -[DllImport("__Internal")] -#endif -private static extern void WX_OnUpdateReady(string id); -private Dictionary> OnUpdateReadyActionList; -public void OnUpdateReady(string id,Action callback){ - if(OnUpdateReadyActionList == null){ - OnUpdateReadyActionList = new Dictionary>(); - } - if(OnUpdateReadyActionList.ContainsKey(id)){ - OnUpdateReadyActionList[id] += callback; - }else{ - OnUpdateReadyActionList.Add(id,callback); - WX_OnUpdateReady(id); - } -} - - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/WXSDKManagerHandler.cs.meta b/Assets/WX-WASM-SDK/WXSDKManagerHandler.cs.meta deleted file mode 100644 index 492d3205..00000000 --- a/Assets/WX-WASM-SDK/WXSDKManagerHandler.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d69a97e1cab30b641814629086c0000a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXShortAudio.cs b/Assets/WX-WASM-SDK/WXShortAudio.cs deleted file mode 100644 index 213fb956..00000000 --- a/Assets/WX-WASM-SDK/WXShortAudio.cs +++ /dev/null @@ -1,108 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Runtime.InteropServices; - -namespace WeChatWASM -{ - /// - /// 适合几秒短音频播放 - /// - public class WXShortAudioPlayer - { - - private static WXShortAudioPlayer instance = null; - - public static WXShortAudioPlayer Instance - { - get - { - if (instance == null) - { - instance = new WXShortAudioPlayer(); - } - return instance; - } - } - - /// - /// 提前调用这个会预先去下载音频,减少延迟 - /// - /// 音频列表,填Assets下的路径,如【”/audio/1.mp3“】 - public void PreLoadAudio(string[] audios) - { - WXPreLoadShortAudio(string.Join(",",audios)); - } - - /// - /// 播放短音频直接调用这个就好,调用的话会停止掉其他通过WXShortAudioPlayer播放的短音频,而从头播放这个音频 - /// - /// 音频,填Assets下的路径,如”/audio/1.mp3” - /// 音量,1最大,0最小 - /// 是否循环 - public void StopOthersAndPlay(string audio,float volume, bool loop =false) - { - WXStopOthersAndPlay(audio,loop,volume); - } - - /// - /// 停止短音频播放 - /// - /// 音频,填Assets下的路径,如”/audio/1.mp3” - public void Stop(string audio) - { - WXShortAudioPlayerStop(audio); - } - - /// - /// 销毁短音频,节省内存 - /// - /// - public void Destroy(string audio) - { - WXShortAudioPlayerDestroy(audio); - } - - - #region C#调用JS桥接方法 -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXPreLoadShortAudio(string audio); -#else - private static void WXPreLoadShortAudio(string audio) { - - } -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXStopOthersAndPlay(string audio,bool loop, float volume=1.0f); -#else - private static void WXStopOthersAndPlay(string audio, bool loop, float volume = 1.0f) - { - Debug.Log(audio+" , play"); - } -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXShortAudioPlayerStop(string audio); -#else - private static void WXShortAudioPlayerStop(string audio) - { - - } -#endif - -#if UNITY_WEBGL && !UNITY_EDITOR - [DllImport("__Internal")] - private static extern void WXShortAudioPlayerDestroy(string audio); -#else - private static void WXShortAudioPlayerDestroy(string audio) - { - - } -#endif - #endregion - } - -} diff --git a/Assets/WX-WASM-SDK/WXShortAudio.cs.meta b/Assets/WX-WASM-SDK/WXShortAudio.cs.meta deleted file mode 100644 index 560b0592..00000000 --- a/Assets/WX-WASM-SDK/WXShortAudio.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: de6dfb89f38d1424181c73fdfb256ec2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXTouchInputOverride.cs b/Assets/WX-WASM-SDK/WXTouchInputOverride.cs deleted file mode 100644 index ce699fd9..00000000 --- a/Assets/WX-WASM-SDK/WXTouchInputOverride.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.EventSystems; -using WeChatWASM; -using Touch = UnityEngine.Touch; -class TouchData -{ - public Touch touch; - public long timeStamp; -} - -/** - * 由于Unity WebGL发布的多点触控存在问题, 导致在微信中多点触控存在粘连的情况 - * 所以需要使用WX的触控接口重新覆盖Unity的BaseInput关于触控方面的接口 - * 通过设置StandaloneInputModule.inputOverride的方式来实现 -*/ -[RequireComponent(typeof(StandaloneInputModule))] -public class WXTouchInputOverride : BaseInput -{ - private bool _isInitWechatSDK; - private readonly List _touches = new List(); - private StandaloneInputModule _standaloneInputModule = null; - - protected override void Awake() - { - base.Awake(); - _standaloneInputModule = GetComponent(); - } - - protected override void OnEnable() - { - base.OnEnable(); - InitWechatTouchEvents(); - if (_standaloneInputModule) - { - _standaloneInputModule.inputOverride = this; - } - } - - protected override void OnDisable() - { - base.OnDisable(); - UnregisterWechatTouchEvents(); - if (_standaloneInputModule) - { - _standaloneInputModule.inputOverride = null; - } - } - - private void InitWechatTouchEvents() - { - if (!_isInitWechatSDK) - { - WX.InitSDK((code) => - { - _isInitWechatSDK = true; - RegisterWechatTouchEvents(); - }); - } - else - { - RegisterWechatTouchEvents(); - } - } - private void RegisterWechatTouchEvents() - { - WX.OnTouchStart(OnWxTouchStart); - WX.OnTouchMove(OnWxTouchMove); - WX.OnTouchEnd(OnWxTouchEnd); - } - - private void UnregisterWechatTouchEvents() - { - WX.OffTouchStart(OnWxTouchStart); - WX.OffTouchMove(OnWxTouchMove); - WX.OffTouchEnd(OnWxTouchEnd); - } - - private void OnWxTouchStart(OnTouchStartCallbackResult touchEvent) - { - foreach (var wxTouch in touchEvent.changedTouches) - { - var data = FindOrCreateTouchData(wxTouch.identifier); - data.touch.phase = TouchPhase.Began; - data.touch.position = new Vector2(wxTouch.clientX, wxTouch.clientY); - data.touch.rawPosition = data.touch.position; - data.timeStamp = touchEvent.timeStamp; - // Debug.Log($"OnWxTouchStart:{wxTouch.identifier}, {data.touch.phase}"); - } - } - - private void OnWxTouchMove(OnTouchStartCallbackResult touchEvent) - { - foreach (var wxTouch in touchEvent.changedTouches) - { - var data = FindOrCreateTouchData(wxTouch.identifier); - UpdateTouchData(data, new Vector2(wxTouch.clientX, wxTouch.clientY), touchEvent.timeStamp, TouchPhase.Moved); - } - } - - private void OnWxTouchEnd(OnTouchStartCallbackResult touchEvent) - { - foreach (var wxTouch in touchEvent.changedTouches) - { - var data = FindOrCreateTouchData(wxTouch.identifier); - UpdateTouchData(data, new Vector2(wxTouch.clientX, wxTouch.clientY), touchEvent.timeStamp, TouchPhase.Ended); - } - } - - private void Update() - { - foreach (var t in _touches) - { - if (t.touch.phase == TouchPhase.Began) - { - t.touch.phase = TouchPhase.Stationary; - } - } - RemoveEndedTouches(); - } - private void RemoveEndedTouches() - { - - if (_touches.Count > 0) - { - _touches.RemoveAll(touchData => - { - var touch = touchData.touch; - return (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled); - }); - } - } - - private TouchData FindOrCreateTouchData(int identifier) - { - foreach (var touchData in _touches) - { - var touch = touchData.touch; - if (touch.fingerId == identifier) - { - return touchData; - } - } - var data = new TouchData(); - data.touch.pressure = 1.0f; - data.touch.maximumPossiblePressure = 1.0f; - data.touch.type = TouchType.Direct; - data.touch.tapCount = 1; - data.touch.fingerId = identifier; - data.touch.radius = 0; - data.touch.radiusVariance = 0; - data.touch.altitudeAngle = 0; - data.touch.azimuthAngle = 0; - data.touch.deltaTime = 0; - _touches.Add(data); - return data; - } - - private static void UpdateTouchData(TouchData data, Vector2 pos, long timeStamp, TouchPhase phase) - { - data.touch.phase = phase; - data.touch.deltaPosition = pos - data.touch.position; - data.touch.position = pos; - data.touch.deltaTime = (timeStamp - data.timeStamp) / 1000000.0f; - } - - public override bool touchSupported - { - get - { - return true; - } - } - - public override int touchCount - { - get { return _touches.Count; } - } - - public override Touch GetTouch(int index) - { - return _touches[index].touch; - } -} diff --git a/Assets/WX-WASM-SDK/WXTouchInputOverride.cs.meta b/Assets/WX-WASM-SDK/WXTouchInputOverride.cs.meta deleted file mode 100644 index 117e9019..00000000 --- a/Assets/WX-WASM-SDK/WXTouchInputOverride.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8f7d99c061e4f4349a170f22b98bd499 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXUDPSocketManager.cs b/Assets/WX-WASM-SDK/WXUDPSocketManager.cs deleted file mode 100644 index 34188f3b..00000000 --- a/Assets/WX-WASM-SDK/WXUDPSocketManager.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace WeChatWASM -{ - /* - * Use Example: - * WeChatWASM.UDPClient udpclient = new WeChatWASM.UDPClient("119.28.188.49", 7890); - udpclient.SetCallBack((bytes) => - { - Debug.Log($"Udp OnMessage {bytes.Length}"); - }, - (closeReason) => - { - Debug.LogError($"Udp OnClose {closeReason}"); - }, - (errorMessage) => - { - Debug.LogError($"Udp OnError {errorMessage}"); - } - ); - var bytes = System.Text.Encoding.UTF8.GetBytes("Hello World"); - udpclient.Send(bytes, 0, bytes.Length); - */ - public class UDPClient - { - public int socketId = 0; - private Action udpMessageCallback; - private Action udpCloseCallback; - private Action udpErrorCallback; - public UDPClient(string ip, int remotePort, int localPort = 0) - { - socketId = WeChatWASM.WX.CreateUDPSocket(ip, remotePort, localPort); - UDPSocketManager.Instance.AddClient(this); - } - public void SetCallBack(Action udpMessageCallback, - Action udpCloseCallback, - Action udpErrorCallback) - { - this.udpMessageCallback = udpMessageCallback; - this.udpCloseCallback = udpCloseCallback; - this.udpErrorCallback = udpErrorCallback; - } - public void Send(byte[] buffer, int offset, int length) - { - WeChatWASM.WX.SendUDPSocket(socketId, buffer, offset, length); - } - - public void OnMessage(byte[] data) - { - if (this.udpMessageCallback != null) this.udpMessageCallback(data); - } - - public void OnClose(string reason) - { - if (this.udpCloseCallback != null) this.udpCloseCallback(reason); - } - - public void OnError(string errorMessage) - { - if (this.udpErrorCallback != null) this.udpErrorCallback(errorMessage); - } - public void Destroy() - { - WeChatWASM.WX.CloseUDPSocket(this.socketId); - UDPSocketManager.Instance.DeleteClient(this); - } - - } - - - public class UDPSocketManager - { - private Dictionary instances = new Dictionary(); - public static UDPSocketManager Instance = new UDPSocketManager(); - public UDPSocketManager() - { - } - public void OnMessage(int socketId, byte[] data) - { - { - UDPClient client; - if (instances.TryGetValue(socketId, out client)) - { - client.OnMessage(data); - } - else - { - Debug.LogError($"UDPClient not found {socketId}"); - } - } - } - public void OnClose(int socketId, string closeReason) - { - UDPClient client; - if (instances.TryGetValue(socketId, out client)) - { - client.OnClose(closeReason); - } - else - { - Debug.LogError($"UDPClient not found {socketId}"); - } - - } - - public void OnError(int socketId, string errorMessage) - { - UDPClient client; - if (instances.TryGetValue(socketId, out client)) - { - client.OnError(errorMessage); - } - else - { - Debug.LogError($"UDPClient not found {socketId}"); - } - } - public void AddClient(UDPClient client) - { - instances.Add(client.socketId, client); - } - public void DeleteClient(UDPClient client) - { - if (instances.ContainsKey(client.socketId)) - { - instances.Remove(client.socketId); - } - } - } -} diff --git a/Assets/WX-WASM-SDK/WXUDPSocketManager.cs.meta b/Assets/WX-WASM-SDK/WXUDPSocketManager.cs.meta deleted file mode 100644 index 58ed6571..00000000 --- a/Assets/WX-WASM-SDK/WXUDPSocketManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6e1df66d774cb46a99fc9a959cc3c66d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXUserInfoButton.cs b/Assets/WX-WASM-SDK/WXUserInfoButton.cs deleted file mode 100644 index 4f06fa43..00000000 --- a/Assets/WX-WASM-SDK/WXUserInfoButton.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Collections.Generic; - -namespace WeChatWASM -{ - public class WXUserInfoButton - { - private readonly string instanceId; - - private Action onTopCallback; - - public static Dictionary Dict = new Dictionary(); - - #region C#调用JS桥接方法 - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXUserInfoButtonDestroy(string id); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXUserInfoButtonHide(string id); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXUserInfoButtonOffTap(string id); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXUserInfoButtonOnTap(string id); - - #if UNITY_WEBGL - [DllImport("__Internal")] - #endif - private static extern void WXUserInfoButtonShow(string id); - - - #endregion - - - public WXUserInfoButton(string id) - { - instanceId = id; - } - - public void InvokeCallback(WXUserInfoResponse res) - { - onTopCallback?.Invoke(res); - } - - - #region 调用方法 - - /// - /// 销毁用户信息按钮 - /// - public void Destroy() - { - WXUserInfoButtonDestroy(instanceId); - if (Dict.ContainsKey(instanceId)) { - Dict.Remove(instanceId); - } - - } - - /// - /// 隐藏用户信息按钮。 - /// - public void Hide() - { - WXUserInfoButtonHide(instanceId); - } - - /// - /// 取消监听用户信息按钮的点击事件 - /// - public void OffTap() - { - WXUserInfoButtonOffTap(instanceId); - onTopCallback = null; - } - - /// - /// 监听用户信息按钮的点击事件 - /// - /// - public void OnTap(Action action) - { - onTopCallback = action; - WXUserInfoButtonOnTap(instanceId); - } - - /// - /// 显示用户信息按钮 - /// - public void Show() - { - WXUserInfoButtonShow(instanceId); - } - - #endregion - - } -} diff --git a/Assets/WX-WASM-SDK/WXUserInfoButton.cs.meta b/Assets/WX-WASM-SDK/WXUserInfoButton.cs.meta deleted file mode 100644 index a0b87663..00000000 --- a/Assets/WX-WASM-SDK/WXUserInfoButton.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a8e12eb4b08671f4388af583cfe500df -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/WXVideo.cs b/Assets/WX-WASM-SDK/WXVideo.cs deleted file mode 100644 index be1458f5..00000000 --- a/Assets/WX-WASM-SDK/WXVideo.cs +++ /dev/null @@ -1,599 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using UnityEngine; - -namespace WeChatWASM -{ - public class WXVideo - { - - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoPlay(string id); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoAddListener(string id, string key); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoDestroy(string id); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoExitFullScreen(string id); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoPause(string id); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoRequestFullScreen(string id,int direction); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoSeek(string id, int time); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoStop(string id); - -#if UNITY_WEBGL - [DllImport("__Internal")] -#endif - private static extern void WXVideoRemoveListener(string id, string key); - - - -#if UNITY_WEBGL && !UNITY_EDITOR - private static readonly bool isWebGLPlayer = true; -#else - private static readonly bool isWebGLPlayer = false; -#endif - - - private bool isWaitingPlay = false; - private bool isWaitingStop = false; - private bool isWaitingPause = false; - private bool _isPlaying = false; - - private Action _onPlay = null; - private Action _onPause = null; - private Action _onEnded = null; - private Action _onTimeUpdate = null; - private Action _onProgress = null; - - private Action _onError = null; - private Action _onWaiting = null; - private Action _onSeeking = null; - private Action _onSeeked = null; - - private WXCreateVideoParam param; - - - public string instanceId; - - //内部使用,请不要访问这个 - public static Dictionary _Dict = new Dictionary(); - - public WXVideo(string id, WXCreateVideoParam param) - { - instanceId = id; - this.param = param; - _Dict.Add(id, this); - - OnPlay(() => { - _isPlaying = true; - }); - - - OnEnded(() => { - _isPlaying = false; - }); - - OnPause(() => { - _isPlaying = false; - }); - -#if UNITY_EDITOR - _isPlaying = param.autoplay; -#endif - } - - - /// - /// 内部函数,请不要调用 - /// - /// - public void _HandleCallBack(WXVideoCallback res) - { - switch (res.errMsg) - { - case "onPlay": - _onPlay?.Invoke(); - break; - case "onPause": - _onPause?.Invoke(); - break; - case "onEnded": - _onEnded?.Invoke(); - break; - case "onTimeUpdate": - _onTimeUpdate?.Invoke(new WXVideoTimeUpdate() { - position = res.position, - duration = res.duration - }); - break; - case "onProgress": - _onProgress?.Invoke(new WXVideoProgress() { - buffered = res.buffered, - duration = res.duration - }); - break; - case "onError": - _onError?.Invoke(); - break; - case "onWaiting": - _onWaiting?.Invoke(); - break; - case "onSeeking": - _onSeeking?.Invoke(); - break; - case "onSeeked": - _onSeeked?.Invoke(); - break; - } - - } - - /// - /// 是否正在播放 - /// - public bool isPlaying - { - get - { - return _isPlaying; - } - } - - /// - /// 播放视频 - /// - public void Play() - { - if (isWebGLPlayer) - { - if (!isWaitingPlay) - { - isWaitingPlay = true; - WXSDKManagerHandler.Instance.StartCoroutine(DoPlay()); - } - return; - } - - - Debug.Log(param.src + " 视频播放了,这里就不真的播放了。"); - _HandleCallBack(new WXVideoCallback() { - errMsg= "onPlay" - }); - - } - - private IEnumerator DoPlay() - { - //这里unity音频调用太频繁,延迟0.1秒后再执行 - yield return new WaitForSeconds(0.1f); - WXVideoPlay(instanceId); - isWaitingPlay = false; - } - - /// - /// 监听视频播放事件 - /// - public void OnPlay(Action action) - { - - if (_onPlay == null) - { - if (isWebGLPlayer) - { - WXVideoAddListener(instanceId, "onPlay"); - } - } - _onPlay += action; - } - - - /// - /// 取消监听视频播放事件,action 为空表示移除全部事件监听 - /// - public void OffPlay(Action action = null) - { - if (action == null) - { - _onPlay = null; - } - else - { - _onPlay -= action; - } - if (_onPlay == null) - { - if (isWebGLPlayer) - { - WXVideoRemoveListener(instanceId, "offPlay"); - } - } - - } - - - /// - /// 监听视频播放到末尾事件 - /// - public void OnEnded(Action action) - { - - if (_onEnded == null) - { - if (isWebGLPlayer) - { - WXVideoAddListener(instanceId, "onEnded"); - } - - } - _onEnded += action; - } - - - /// - /// 取消监听视频播放到末尾事件 - /// - public void OffEnded(Action action = null) - { - if (action == null) - { - _onEnded = null; - } - else - { - _onEnded -= action; - } - if (_onEnded == null) - { - if (isWebGLPlayer) - { - WXVideoRemoveListener(instanceId, "offEnded"); - } - - } - } - - - /// - /// 监听视频错误事件 - /// - public void OnError(Action action) - { - - if (_onError == null) - { - if (isWebGLPlayer) - { - WXVideoAddListener(instanceId, "onError"); - } - - } - _onError += action; - } - - - /// - /// 取消监听视频错误事件,action 为空表示移除全部事件监听 - /// - public void OffError(Action action = null) - { - if (action == null) - { - _onError = null; - } - else - { - _onError -= action; - } - if (_onError == null) - { - if (isWebGLPlayer) - { - WXVideoRemoveListener(instanceId, "offError"); - } - } - } - - /// - /// 监听视频暂停事件 - /// - public void OnPause(Action action) - { - - if (_onPause == null) - { - if (isWebGLPlayer) - { - WXVideoAddListener(instanceId, "onPause"); - } - } - _onPause += action; - } - - /// - /// 取消监听视频暂停事件,action 为空表示移除全部事件监听 - /// - public void OffPause(Action action = null) - { - if (action == null) - { - _onPause = null; - } - else - { - _onPause -= action; - } - if (_onPause == null) - { - if (isWebGLPlayer) - { - WXVideoRemoveListener(instanceId, "offPause"); - } - } - } - - /// - /// 监听视频由于需要缓冲下一帧而停止时触发 - /// - public void OnWaiting(Action action) - { - - if (_onWaiting == null) - { - if (isWebGLPlayer) - { - WXVideoAddListener(instanceId, "onWaiting"); - } - - } - _onWaiting += action; - } - - /// - /// 取消监听视频由于需要缓冲下一帧而停止时触发,action 为空表示移除全部事件监听 - /// - public void OffWaiting(Action action = null) - { - if (action == null) - { - _onWaiting = null; - } - else - { - _onWaiting -= action; - } - if (_onWaiting == null) - { - if (isWebGLPlayer) - { - WXVideoRemoveListener(instanceId, "offWaiting"); - } - - } - } - - /// - /// 销毁当前实例 - /// - public void Destroy() - { - if (isWebGLPlayer) - { - WXVideoDestroy(instanceId); - } - else - { - Debug.Log(param.src + " 视频销毁!"); - } - _Dict.Remove(instanceId); - } - - /// - /// 视频退出全屏 - /// - public void ExitFullScreen() { - if (isWebGLPlayer) - { - WXVideoExitFullScreen(instanceId); - } - else - { - Debug.Log(param.src + " 视频退出全屏!"); - } - } - - /// - /// 暂停 - /// - public void Pause() - { - if (isWebGLPlayer) - { - if (!isWaitingPause) - { - isWaitingPause = true; - WXSDKManagerHandler.Instance.StartCoroutine(DoPause()); - } - return; - } - Debug.Log(param.src + " 视频暂停了"); - - _HandleCallBack(new WXVideoCallback() - { - errMsg = "onPause" - }); - } - - IEnumerator DoPause() - { - //这里调用太频繁,延迟0.1秒后再执行 - yield return new WaitForSeconds(0.1f); - WXVideoPause(instanceId); - isWaitingPause = false; - } - - /// - /// 视频全屏 - /// - /// 设置全屏时视频的方向 0: 正常竖向, 90: 屏幕逆时针90度 . -90: 屏幕顺时针90度 - public void RequestFullScreen(int direction) { - if (isWebGLPlayer) - { - WXVideoRequestFullScreen(instanceId, direction); - } - else - { - Debug.Log(param.src + " 视频全屏!"); - } - } - - /// - /// 视频跳转 - /// - /// 视频跳转到指定位置,单位为 s 秒 - public void Seek(int time) - { - WXVideoSeek(instanceId, time); - } - - - /// - /// 停止视频 - /// - public void Stop() - { - if (isWebGLPlayer) - { - if (!isWaitingStop) - { - isWaitingStop = true; - WXSDKManagerHandler.Instance.StartCoroutine(DoStop()); - } - return; - } - Debug.Log(param.src + " 音频停止了"); - - } - - IEnumerator DoStop() - { - //这里unity调用太频繁,延迟0.1秒后再执行 - yield return new WaitForSeconds(0.1f); - WXVideoStop(instanceId); - isWaitingStop = false; - } - - - /// - /// 监听视频播放进度更新事件 - /// - /// - public void OnTimeUpdate(Action action) - { - - if (_onTimeUpdate == null) - { - if (isWebGLPlayer) - { - WXVideoAddListener(instanceId, "onTimeUpdate"); - } - - } - _onTimeUpdate += action; - } - - /// - /// 取消监听视频播放进度更新事件,action 为空表示移除全部事件监听 - /// - public void OffTimeUpdate(Action action = null) - { - if (action == null) - { - _onTimeUpdate = null; - } - else - { - _onTimeUpdate -= action; - } - if (_onTimeUpdate == null) - { - if (isWebGLPlayer) - { - WXVideoRemoveListener(instanceId, "offTimeUpdate"); - } - - } - } - - /// - /// 监听视频下载(缓冲)事件 - /// - /// - public void OnProgress(Action action) - { - - if (_onTimeUpdate == null) - { - if (isWebGLPlayer) - { - WXVideoAddListener(instanceId, "onProgress"); - } - - } - _onProgress += action; - } - - /// - /// 取消监听视频下载(缓冲)事件 ,action 为空表示移除全部事件监听 - /// - public void OffProgress(Action action = null) - { - if (action == null) - { - _onProgress = null; - } - else - { - _onProgress -= action; - } - if (_onProgress == null) - { - if (isWebGLPlayer) - { - WXVideoRemoveListener(instanceId, "offProgress"); - } - - } - } - - } -} diff --git a/Assets/WX-WASM-SDK/WXVideo.cs.meta b/Assets/WX-WASM-SDK/WXVideo.cs.meta deleted file mode 100644 index 1c367578..00000000 --- a/Assets/WX-WASM-SDK/WXVideo.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9e73acf67b64e4760b040fea16f6d905 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/interface.cs b/Assets/WX-WASM-SDK/interface.cs deleted file mode 100644 index 171a7f1b..00000000 --- a/Assets/WX-WASM-SDK/interface.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace WeChatWASM -{ - public interface IWXAdResizable - { - void OnResizeCallback(WXADResizeResponse res); - } - - public interface IWXAdVideoCloseable - { - void OnCloseCallback(WXRewardedVideoAdOnCloseResponse res); - } - - public interface IWXADCloseable - { - void OnCloseCallback(); - } - -} diff --git a/Assets/WX-WASM-SDK/interface.cs.meta b/Assets/WX-WASM-SDK/interface.cs.meta deleted file mode 100644 index 4cfb31ca..00000000 --- a/Assets/WX-WASM-SDK/interface.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dfebd6fc3df4bd3449f429c1912980fd -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default.meta b/Assets/WX-WASM-SDK/wechat-default.meta deleted file mode 100644 index 284d1f57..00000000 --- a/Assets/WX-WASM-SDK/wechat-default.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 441db82a4430749b580e1e13cf101df4 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/check-version.js b/Assets/WX-WASM-SDK/wechat-default/check-version.js deleted file mode 100644 index b87e6bad..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/check-version.js +++ /dev/null @@ -1,109 +0,0 @@ -const { version, SDKVersion, platform, renderer, system } = - wx.getSystemInfoSync() - -function compareVersion(v1, v2) { - return ( - v1 - .split(".") - .map((v) => v.padStart(2, "0")) - .join("") >= - v2 - .split(".") - .map((v) => v.padStart(2, "0")) - .join("") - ) -} - -const isPc = platform === "windows" -const isIOS = platform === "ios" -const isDevtools = platform === "devtools" -const isMobile = !isPc && !isDevtools -// 是否iOSH5模式 -const isH5Renderer = isMobile && renderer === "h5" -// 操作系统版本号 -const systemVersionArr = system ? system.split(" ") : [] -const systemVersion = systemVersionArr.length - ? systemVersionArr[systemVersionArr.length - 1] - : "" - -// pc微信版本号不一致,需要>=3.3 -const isPcWeChatVersionValid = compareVersion(version, "3.3") -// 支持unity小游戏,需要基础库>=2.14.0,但低版本基础库iOS存在诸多问题,将版本最低版本提高到2.17.0 -const isLibVersionValid = compareVersion(SDKVersion, "2.17.0") -// 如果是iOSH5,基础库需要>=2.19.1 -const isH5LibVersionValid = compareVersion(SDKVersion, "2.19.1") -// iOSH5模式,支持wss的基础库版本>=2.21.1 -const isWssLibVersionValid = compareVersion(SDKVersion, "2.21.1") -// 压缩纹理需要iOS系统版本>=14.0,检测到不支持压缩纹理时会提示升级系统 -const isIOSH5SystemVersionValid = compareVersion(systemVersion, "14.0") -// iOS系统版本>=15支持webgl2 -const isIOSWebgl2SystemVersionValid = compareVersion(systemVersion, "15.0") -// 是否用了webgl2 -const isWebgl2 = () => GameGlobal.managerConfig.contextConfig.contextType === 2 - -// 是否能以iOSH5模式运行 -const canUseH5Renderer = (GameGlobal.canUseH5Renderer = - isH5Renderer && isH5LibVersionValid) - -// pc微信版本不满足要求 -const isPcInvalid = isPc && !isPcWeChatVersionValid -// 移动设备基础库版本或客户端版本不支持运行unity小游戏 -const isMobileInvalid = isMobile && !isLibVersionValid -// 基础库不支持iOSH5 -const isIOSH5Invalid = isH5Renderer && !isH5LibVersionValid - -// 视情况添加,没用到对应能力就不需要判断 -// 是否用了wss -const useWss = false -// 是否只能iOS高档机运行 -const disableFallback = false -// iOSH5模式基础库不支持wss -const isWssNotEnable = canUseH5Renderer && !isWssLibVersionValid && useWss -// 压缩纹理需要iOS系统版本>=14.0,检测到不支持压缩纹理时会提示升级系统 -const isH5SystemVersionInvalid = - canUseH5Renderer && !isIOSH5SystemVersionValid && disableFallback -// 是否支持webgl2 -const isWebgl2SystemVersionInvalid = () => isIOS && isWebgl2() && !isIOSWebgl2SystemVersionValid - -/** - * 判断环境是否可使用coverview - * coverview实际需要基础库版本>=2.16.1,但因为移动端要>=2.17.0才能运行,所以移动端基本都支持coverview - * - * @export - * @returns - */ -export function canUseCoverview() { - return isMobile || isDevtools -} - -export default () => { - return new Promise((resolve, reject) => { - if (!isDevtools) { - if ( - isPcInvalid || - isMobileInvalid || - isIOSH5Invalid || - isWssNotEnable || - isH5SystemVersionInvalid || - isWebgl2SystemVersionInvalid() - ) { - wx.showModal({ - title: "提示", - content: (isH5SystemVersionInvalid || isWebgl2SystemVersionInvalid()) - ? "当前操作系统版本过低\n请更新iOS系统后进行游戏" - : "当前微信版本过低\n请更新微信后进行游戏", - showCancel: false, - success(res) { - if (res.confirm) { - wx.exitMiniProgram({ - success: (res) => {}, - }) - } - }, - }) - return resolve(false) - } - } - return resolve(true) - }) -} diff --git a/Assets/WX-WASM-SDK/wechat-default/check-version.js.meta b/Assets/WX-WASM-SDK/wechat-default/check-version.js.meta deleted file mode 100644 index c0fb4590..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/check-version.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f2435018f50157e49a041697bca78e2e -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/data-package.meta b/Assets/WX-WASM-SDK/wechat-default/data-package.meta deleted file mode 100644 index d8f63d44..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/data-package.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7853b49d4f1ca428f87b695a5c2e29db -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/data-package/game.js.meta b/Assets/WX-WASM-SDK/wechat-default/data-package/game.js.meta deleted file mode 100644 index de31716d..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/data-package/game.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 68e4f05d516554e138ae74c60ad5d79e -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/event-emitter.meta b/Assets/WX-WASM-SDK/wechat-default/event-emitter.meta deleted file mode 100644 index 1d1b43e7..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/event-emitter.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8844a2cd559bd442ca594c13633eaf53 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/event-emitter/index.js b/Assets/WX-WASM-SDK/wechat-default/event-emitter/index.js deleted file mode 100755 index 6ea485c4..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/event-emitter/index.js +++ /dev/null @@ -1,336 +0,0 @@ -'use strict'; - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; - -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private - */ -function Events() {} - -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} - -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; -}; - -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if ('undefined' !== typeof module) { - module.exports = EventEmitter; -} diff --git a/Assets/WX-WASM-SDK/wechat-default/event-emitter/index.js.meta b/Assets/WX-WASM-SDK/wechat-default/event-emitter/index.js.meta deleted file mode 100644 index d971b352..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/event-emitter/index.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 61c2c6b180ac937499a68595ac56f61d -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/game.js b/Assets/WX-WASM-SDK/wechat-default/game.js deleted file mode 100644 index 589c10da..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/game.js +++ /dev/null @@ -1,184 +0,0 @@ -import './weapp-adapter' -import unityNamespace from './unity-namespace' -import './$GAME_NAME.wasm.framework.unityweb' -import "./unity-sdk/index.js" -import checkVersion, {canUseCoverview} from './check-version' -import "texture-config.js"; -import {launchEventType} from './plugin-config' - -function checkUpdate() { - const updateManager = wx.getUpdateManager() - - updateManager.onCheckForUpdate(function (res) { - // 请求完新版本信息的回调 - // console.log(res.hasUpdate) - }) - - updateManager.onUpdateReady(function () { - wx.showModal({ - title: '更新提示', - content: '新版本已经准备好,是否重启应用?', - success: function (res) { - if (res.confirm) { - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 - updateManager.applyUpdate() - } - } - }) - }) - - updateManager.onUpdateFailed(function () { - // 新版本下载失败 - }) -} - -if ($NEED_CHECK_UPDATE) { - checkUpdate() -} - -let managerConfig = { - DATA_FILE_MD5: "$DATA_MD5", - CODE_FILE_MD5: "$CODE_MD5", - GAME_NAME: "$GAME_NAME", - APPID: "$APP_ID", - // DATA_FILE_SIZE: "$DATA_FILE_SIZE", - LOADING_VIDEO_URL: "$LOADING_VIDEO_URL", - DATA_CDN: "$DEPLOY_URL", - // 资源包是否作为小游戏分包加载 - loadDataPackageFromSubpackage: $LOAD_DATA_FROM_SUBPACKAGE, - - // 需要在网络空闲时预加载的资源,支持如下形式的路径 - preloadDataList: [ - // 'DATA_CDN/StreamingAssets/WebGL/textures_8d265a9dfd6cb7669cdb8b726f0afb1e', - // '/WebGL/sounds_97cd953f8494c3375312e75a29c34fc2' - "$PRELOAD_LIST" - ], - contextConfig: { - contextType: $WEBGL_VERSION // 1=>webgl1 2=>webgl2 3=>auto - } -}; - -GameGlobal.managerConfig = managerConfig; - -// 版本检查 -checkVersion().then(enable => { - if (enable) { - const UnityManager = requirePlugin('UnityPlugin', { - enableRequireHostModule: true, - customEnv: { - wx, - unityNamespace, - document, - canvas - } - }).default - - // JS堆栈能显示更完整 - Error.stackTraceLimit = Infinity; - // 是否使用coverview作为启动页 - let USE_COVER_VIEW - if (canUseCoverview()) { - USE_COVER_VIEW = true - } else { - USE_COVER_VIEW = false - } - if (USE_COVER_VIEW) { - managerConfig = { - ...managerConfig, - useCoverView: true, - // callmain结束后立即隐藏封面视频 - hideAfterCallmain: $HIDE_AFTER_CALLMAIN, - loadingPageConfig: { - // 背景图或背景视频,两者都填时,先展示背景图,视频可播放后,播放视频 - backgroundImage: '$BACKGROUND_IMAGE', // 不使用默认背景图可将此图片删除 - backgroundVideo: '$LOADING_VIDEO_URL', - // 以下是默认值 - barWidth: $LOADING_BAR_WIDTH, // 加载进度条宽度,默认240 - totalLaunchTime: 15000, // 默认总启动耗时,即加载动画默认播放时间,可根据游戏实际情况进行调整 - textDuration: 1500, // 当downloadingText有多个文案时,每个文案展示时间 - firstStartText: '首次加载请耐心等待', // 首次启动时提示文案 - downloadingText: ['正在加载资源'], // 加载阶段循环展示的文案 - compilingText: '编译中', // 编译阶段文案 - initText: '初始化中', // 初始化阶段文案 - completeText: '开始游戏', // 初始化完成 - } - } - GameGlobal.managerConfig = managerConfig; - } - - const gameManager = new UnityManager(managerConfig); - - gameManager.onLaunchProgress((e) => { - // e: LaunchEvent - // interface LaunchEvent { - // type: LaunchEventType; - // data: { - // costTimeMs: number; // 阶段耗时 - // runTimeMs: number; // 总耗时 - // loadDataPackageFromSubpackage: boolean; // 首包资源是否通过小游戏分包加载 - // isVisible: boolean; // 当前是否处于前台,onShow/onHide - // useCodeSplit: boolean; // 是否使用代码分包 - // isHighPerformance: boolean; // 是否iOS高性能模式 - // needDownloadDataPackage: boolean; // 本次启动是否需要下载资源包 - // }; - // } - if (e.type === launchEventType.launchPlugin) { - - } - if (e.type === launchEventType.loadWasm) { - - } - if (e.type === launchEventType.compileWasm) { - - } - if (e.type === launchEventType.loadAssets) { - - } - if (e.type === launchEventType.readAssets) { - - } - if (e.type === launchEventType.prepareGame) { - - } - }) - - gameManager.assetPath = (managerConfig.DATA_CDN|| '').replace(/\/$/,'') + '/Assets'; - - gameManager.onModulePrepared(() => { - for(let key in unityNamespace) { - if (!GameGlobal.hasOwnProperty(key)) { - GameGlobal[key] = unityNamespace[key] - } else { - } - } - }) - - - // 上报初始化信息 - const systeminfo = wx.getSystemInfoSync(); - let bootinfo = { - 'renderer':systeminfo.renderer || '', - 'abi': systeminfo.ebi || '', - 'brand': systeminfo.brand, - 'model':systeminfo.model, - 'platform':systeminfo.platform, - 'system':systeminfo.system, - 'version':systeminfo.version, - 'SDKVersion':systeminfo.SDKVersion, - 'benchmarkLevel':systeminfo.benchmarkLevel, - }; - wx.getRealtimeLogManager().info('game starting', bootinfo); - wx.getLogManager().info('game starting', bootinfo); - console.info('game starting', bootinfo); - - // 默认上报小游戏实时日志与用户反馈日志(所有error日志+小程序框架异常) - wx.onError((result) => {gameManager.printErr(result.message)}); - gameManager.onLogError = function(err){ - GameGlobal.realtimeLogManager.error(err) - GameGlobal.logmanager.warn(err) - } - gameManager.startGame(); - - GameGlobal.manager = gameManager; - } -}) diff --git a/Assets/WX-WASM-SDK/wechat-default/game.js.meta b/Assets/WX-WASM-SDK/wechat-default/game.js.meta deleted file mode 100644 index b2bfeaeb..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/game.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 374c9e40888ef204cad2ac5a98620475 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/game.json b/Assets/WX-WASM-SDK/wechat-default/game.json deleted file mode 100644 index 26bc8b96..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/game.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceOrientation": "$ORIENTATION", - "openDataContext": "open-data", - "subpackages": [ - { - "name": "wasmcode", - "root": "wasmcode/" - }, - { - "name": "data-package", - "root": "data-package/" - } - ], - "plugins": { - "UnityPlugin": { - "version": "1.0.78", - "provider": "wxe5a48f1ed5f544b7", - "contexts": [ - { - "type": "isolatedContext" - } - ] - } - }, - "workers": "workers" -} diff --git a/Assets/WX-WASM-SDK/wechat-default/game.json.meta b/Assets/WX-WASM-SDK/wechat-default/game.json.meta deleted file mode 100644 index 453c4918..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/game.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b0cac4d65901a0449b128827d2928cbf -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/images.meta b/Assets/WX-WASM-SDK/wechat-default/images.meta deleted file mode 100644 index ba3979ab..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/images.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5ec3406b06e384867959b72e1169a954 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/images/background.jpg b/Assets/WX-WASM-SDK/wechat-default/images/background.jpg deleted file mode 100644 index 9893bd55..00000000 Binary files a/Assets/WX-WASM-SDK/wechat-default/images/background.jpg and /dev/null differ diff --git a/Assets/WX-WASM-SDK/wechat-default/images/background.jpg.meta b/Assets/WX-WASM-SDK/wechat-default/images/background.jpg.meta deleted file mode 100644 index 57c35fbd..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/images/background.jpg.meta +++ /dev/null @@ -1,92 +0,0 @@ -fileFormatVersion: 2 -guid: f6e6fd15ec66f4eb18f7baad107d43ac -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapU: 0 - wrapV: 0 - wrapW: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - applyGammaDecoding: 0 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/images/unity_logo.png b/Assets/WX-WASM-SDK/wechat-default/images/unity_logo.png deleted file mode 100644 index 7c2f889d..00000000 Binary files a/Assets/WX-WASM-SDK/wechat-default/images/unity_logo.png and /dev/null differ diff --git a/Assets/WX-WASM-SDK/wechat-default/images/unity_logo.png.meta b/Assets/WX-WASM-SDK/wechat-default/images/unity_logo.png.meta deleted file mode 100644 index 8ddaa2b4..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/images/unity_logo.png.meta +++ /dev/null @@ -1,92 +0,0 @@ -fileFormatVersion: 2 -guid: 4e4582c0bfeb342ef9563a64a9c5cf17 -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapU: 0 - wrapV: 0 - wrapW: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - applyGammaDecoding: 0 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data.meta b/Assets/WX-WASM-SDK/wechat-default/open-data.meta deleted file mode 100644 index 37a1d0d2..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 414bed8b7549c42ce80b837a5d80739d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/index.js b/Assets/WX-WASM-SDK/wechat-default/open-data/index.js deleted file mode 100755 index 23ecb884..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/index.js +++ /dev/null @@ -1,61 +0,0 @@ -//绘制引擎文档可以参考 https://wechat-miniprogram.github.io/minigame-canvas-engine/ -import Layout from './open-data-js-sdk/minigame-canvas-engine/index'; -import SDK from "./open-data-js-sdk/index"; - -function main({x /*屏幕左上角横坐标*/, y/*屏幕左上角纵坐标*/, width/*渲染区域宽度大小*/, height/*渲染区域高度大小*/, devicePixelRatio/*像素密度比*/}){ - //这里写你的业务逻辑,unity里面调用 WX.ShowOpenData 会自动执行到这里,WX.HideOpenData会自动销毁 - - - //以下是demo可以删除掉, 体验demo可以参考 https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/tree/main/Demo/Ranking/MiniGame/minigame - - // demo开始 - let template = ` - - - -`; - let style = { - container: { - width: 200, - height: 100, - backgroundColor: '#ffffff', - justContent: 'center', - alignItems: 'center', - }, - testText: { - color: '#ffffff', - width: 200, - height: 50, - lineHeight: 50, - fontSize: 20, - textAlign: 'center', - backgroundColor: '#ffff00', - }, - // 文字的最终颜色为#ff0000 - redText: { - color: '#ff0000', - } - }; - Layout.init(template, style); - const list = Layout.getElementsById('testText'); - let id = 0; - list.forEach(item => { - item.on('click', (e) => { - console.log(e, item); - list[0].value = "hhh"+(++id); - }); - }); - let canvas = wx.getSharedCanvas(); - let ctx = canvas.getContext('2d'); - Layout.updateViewPort({ - width: width / devicePixelRatio, - height: height / devicePixelRatio, - x: x / devicePixelRatio, - y: y / devicePixelRatio - }); - Layout.layout(ctx); - - // demo结束 -} - -SDK.start(main); diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/index.js.meta b/Assets/WX-WASM-SDK/wechat-default/open-data/index.js.meta deleted file mode 100644 index 3cabf5b9..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/index.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: e12275b3da9ce0f44b893dfe78939783 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk.meta b/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk.meta deleted file mode 100644 index eea01eff..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f6ecdb3dee1d94ec3935838f13f28cd4 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/index.js b/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/index.js deleted file mode 100755 index d81bf766..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/index.js +++ /dev/null @@ -1,24 +0,0 @@ -import Layout from './minigame-canvas-engine/index'; -//绘制引擎文档可以参考 https://wechat-miniprogram.github.io/minigame-canvas-engine/ -let isDestroyed = true; //是否已经被销毁 - -export default { - /** - * 初始化 - * @param fun 主逻辑开始的函数,unity里面调用 WX.ShowOpenData 会通知到这里 - */ - start(fun){ - wx.onMessage(data => { - if(data.type === "WXDestroy"){ - isDestroyed = true; - return Layout.clearAll(); - }else if(data.type === "WXRender"){ - Layout.repaint(); - if(isDestroyed){ - isDestroyed = false; - fun(data); - } - } - }); - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/index.js.meta b/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/index.js.meta deleted file mode 100644 index ff33e343..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/index.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 45e99d517a1a40e41959fd77ff2fe635 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine.meta b/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine.meta deleted file mode 100644 index c643efec..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9f7acd6e3ab964b648af408a1a7622e4 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine/index.js b/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine/index.js deleted file mode 100755 index c66039db..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine/index.js +++ /dev/null @@ -1,4767 +0,0 @@ -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EE", function() { return EE; }); -/* harmony import */ var _components_elements_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _common_pool_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); -/* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); -/* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var css_layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5); -/* harmony import */ var css_layout__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(css_layout__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _common_util_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6); -/* harmony import */ var _libs_fast_xml_parser_parser_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7); -/* harmony import */ var _libs_fast_xml_parser_parser_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_libs_fast_xml_parser_parser_js__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _common_bitMapFont__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13); -/* harmony import */ var _components_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - - - - - - // components - - // 全局事件管道 - -var EE = new tiny_emitter__WEBPACK_IMPORTED_MODULE_2___default.a(); -var imgPool = new _common_pool_js__WEBPACK_IMPORTED_MODULE_1__["default"]('imgPool'); -var canvasPool = new _common_pool_js__WEBPACK_IMPORTED_MODULE_1__["default"]('canvasPool'); -var constructorMap = { - view: _components_index_js__WEBPACK_IMPORTED_MODULE_7__["View"], - text: _components_index_js__WEBPACK_IMPORTED_MODULE_7__["Text"], - image: _components_index_js__WEBPACK_IMPORTED_MODULE_7__["Image"], - scrollview: _components_index_js__WEBPACK_IMPORTED_MODULE_7__["ScrollView"], - bitmaptext: _components_index_js__WEBPACK_IMPORTED_MODULE_7__["BitMapText"] -}; - -var create = function create(node, style) { - var _this = this; - - var _constructor = constructorMap[node.name]; - var children = node.children || []; - var attr = node.attr || {}; - var id = attr.id || ''; - var args = Object.keys(attr).reduce(function (obj, key) { - var value = attr[key]; - var attribute = key; - - if (key === 'id') { - obj.style = Object.assign(obj.style || {}, style[id] || {}); - return obj; - } - - if (key === 'class') { - obj.style = value.split(/\s+/).reduce(function (res, oneClass) { - return Object.assign(res, style[oneClass]); - }, obj.style || {}); - return obj; - } // if (/\{\{.+\}\}/.test(value)) { - // } - - - if (value === 'true') { - obj[attribute] = true; - } else if (value === 'false') { - obj[attribute] = false; - } else { - obj[attribute] = value; - } - - return obj; - }, {}); // 用于后续元素查询 - - args.idName = id; - args.className = attr["class"] || ''; - var element = new _constructor(args); - element.root = this; - children.forEach(function (childNode) { - var childElement = create.call(_this, childNode, style); - element.add(childElement); - }); - return element; -}; - -var getChildren = function getChildren(element) { - return Object.keys(element.children).map(function (id) { - return element.children[id]; - }).map(function (child) { - return { - id: child.id, - name: child.name, - style: child.style, - children: getChildren(child) - }; - }); -}; - -var renderChildren = function renderChildren(children, context) { - children.forEach(function (child) { - if (child.type === 'ScrollView') { - // ScrollView的子节点渲染交给ScrollView自己,不支持嵌套ScrollView - child.insertScrollView(context); - } else { - child.insert(context); - return renderChildren(child.children, context); - } - }); -}; - -function layoutChildren(dataArray, children) { - var _this2 = this; - - dataArray.forEach(function (data) { - var child = children.find(function (item) { - return item.id === data.id; - }); - child.layoutBox = child.layoutBox || {}; - ['left', 'top', 'width', 'height'].forEach(function (prop) { - child.layoutBox[prop] = data.layout[prop]; - }); - - if (child.parent) { - child.layoutBox.absoluteX = (child.parent.layoutBox.absoluteX || 0) + child.layoutBox.left; - child.layoutBox.absoluteY = (child.parent.layoutBox.absoluteY || 0) + child.layoutBox.top; - } else { - child.layoutBox.absoluteX = child.layoutBox.left; - child.layoutBox.absoluteY = child.layoutBox.top; - } - - child.layoutBox.originalAbsoluteY = child.layoutBox.absoluteY; // 滚动列表的画板尺寸和主画板保持一致 - - if (child.type === 'ScrollView') { - child.updateRenderPort(_this2.renderport); - } - - layoutChildren.call(_this2, data.children, child.children); - }); -} - -var updateRealLayout = function updateRealLayout(dataArray, children, scale) { - dataArray.forEach(function (data) { - var child = children.find(function (item) { - return item.id === data.id; - }); - child.realLayoutBox = child.realLayoutBox || {}; - ['left', 'top', 'width', 'height'].forEach(function (prop) { - child.realLayoutBox[prop] = data.layout[prop] * scale; - }); - - if (child.parent) { - child.realLayoutBox.realX = (child.parent.realLayoutBox.realX || 0) + child.realLayoutBox.left; - Object.defineProperty(child.realLayoutBox, 'realY', { - configurable: true, - enumerable: true, - get: function get() { - var res = (child.parent.realLayoutBox.realY || 0) + child.realLayoutBox.top; - /** - * 滚动列表事件处理 - */ - - if (child.parent && child.parent.type === 'ScrollView') { - res -= child.parent.top * scale; - } - - return res; - } - }); - } else { - child.realLayoutBox.realX = child.realLayoutBox.left; - child.realLayoutBox.realY = child.realLayoutBox.top; - } - - updateRealLayout(data.children, child.children, scale); - }); -}; - -function _getElementsById(tree) { - var list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var id = arguments.length > 2 ? arguments[2] : undefined; - Object.keys(tree.children).forEach(function (key) { - var child = tree.children[key]; - - if (child.idName === id) { - list.push(child); - } - - if (Object.keys(child.children).length) { - _getElementsById(child, list, id); - } - }); - return list; -} - -function _getElementsByClassName(tree) { - var list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var className = arguments.length > 2 ? arguments[2] : undefined; - Object.keys(tree.children).forEach(function (key) { - var child = tree.children[key]; - - if (child.className.split(/\s+/).indexOf(className) > -1) { - list.push(child); - } - - if (Object.keys(child.children).length) { - _getElementsByClassName(child, list, className); - } - }); - return list; -} - -var _Layout = /*#__PURE__*/function (_Element) { - _inherits(_Layout, _Element); - - var _super = _createSuper(_Layout); - - function _Layout() { - var _this3; - - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - style = _ref.style, - name = _ref.name; - - _classCallCheck(this, _Layout); - - _this3 = _super.call(this, { - style: style, - id: 0, - name: name - }); - _this3.hasEventHandler = false; - _this3.elementTree = null; - _this3.renderContext = null; - _this3.debugInfo = {}; - _this3.renderport = {}; - _this3.viewport = {}; - _this3.touchStart = _this3.eventHandler('touchstart').bind(_assertThisInitialized(_this3)); - _this3.touchMove = _this3.eventHandler('touchmove').bind(_assertThisInitialized(_this3)); - _this3.touchEnd = _this3.eventHandler('touchend').bind(_assertThisInitialized(_this3)); - _this3.touchCancel = _this3.eventHandler('touchcancel').bind(_assertThisInitialized(_this3)); - _this3.version = '0.0.1'; - _this3.touchMsg = {}; - _this3.hasViewPortSet = false; - _this3.realLayoutBox = { - realX: 0, - realY: 0 - }; - _this3.state = _common_util_js__WEBPACK_IMPORTED_MODULE_4__["STATE"].UNINIT; - _this3.bitMapFonts = []; - return _this3; - } - /** - * 更新被绘制canvas的窗口信息,本渲染引擎并不关心是否会和其他游戏引擎共同使用 - * 而本身又需要支持事件处理,因此,如果被渲染内容是绘制到离屏canvas,需要将最终绘制在屏幕上 - * 的绝对尺寸和位置信息更新到本渲染引擎。 - * 其中,width为物理像素宽度,height为物理像素高度,x为距离屏幕左上角的物理像素x坐标,y为距离屏幕左上角的物理像素 - * y坐标 - */ - - - _createClass(_Layout, [{ - key: "updateViewPort", - value: function updateViewPort(box) { - this.viewport.width = box.width || 0; - this.viewport.height = box.height || 0; - this.viewport.x = box.x || 0; - this.viewport.y = box.y || 0; - this.realLayoutBox = { - realX: this.viewport.x, - realY: this.viewport.y - }; - this.hasViewPortSet = true; - } - }, { - key: "init", - value: function init(template, style, attrValueProcessor) { - var start = new Date(); - /*if( parser.validate(template) === true) { //optional (it'll return an object in case it's not valid)*/ - - /*}*/ - - var parseConfig = { - attributeNamePrefix: "", - attrNodeName: "attr", - //default is 'false' - textNodeName: "#text", - ignoreAttributes: false, - ignoreNameSpace: true, - allowBooleanAttributes: true, - parseNodeValue: false, - parseAttributeValue: false, - trimValues: true, - parseTrueNumberOnly: false - }; - - if (attrValueProcessor && typeof attrValueProcessor === "function") { - parseConfig.attrValueProcessor = attrValueProcessor; - } - - var jsonObj = _libs_fast_xml_parser_parser_js__WEBPACK_IMPORTED_MODULE_5___default.a.parse(template, parseConfig, true); - var xmlTree = jsonObj.children[0]; - this.debugInfo.xmlTree = new Date() - start; // XML树生成渲染树 - - this.layoutTree = create.call(this, xmlTree, style); - this.debugInfo.layoutTree = new Date() - start; - this.add(this.layoutTree); - var elementTree = { - id: this.id, - style: { - width: this.style.width, - height: this.style.height, - flexDirection: 'row' - }, - children: getChildren(this) - }; // 计算布局树 - - css_layout__WEBPACK_IMPORTED_MODULE_3___default()(elementTree); - this.elementTree = elementTree; - this.debugInfo.renderTree = new Date() - start; - var rootEle = this.children[0]; - - if (rootEle.style.width === undefined || rootEle.style.height === undefined) { - console.error('Please set width and height property for root element'); - } else { - this.renderport.width = rootEle.style.width; - this.renderport.height = rootEle.style.height; - } - - this.state = _common_util_js__WEBPACK_IMPORTED_MODULE_4__["STATE"].INITED; - } - }, { - key: "layout", - value: function layout(context) { - var start = new Date(); - this.renderContext = context; - - if (this.renderContext) { - this.renderContext.clearRect(0, 0, this.renderport.width, this.renderport.height); - } - - if (!this.hasViewPortSet) { - console.error('Please invoke method `updateViewPort` before method `layout`'); - } - - layoutChildren.call(this, this.elementTree.children, this.children); - this.debugInfo.layoutChildren = new Date() - start; // 计算真实的物理像素位置,用于事件处理 - - updateRealLayout(this.elementTree.children, this.children, this.viewport.width / this.renderport.width); - this.debugInfo.updateRealLayout = new Date() - start; - renderChildren(this.children, context); - this.debugInfo.renderChildren = new Date() - start; - this.bindEvents(); - this.state = _common_util_js__WEBPACK_IMPORTED_MODULE_4__["STATE"].RENDERED; - } - }, { - key: "initRepaint", - value: function initRepaint() { - var _this4 = this; - - this.on('repaint', function () { - _this4.repaint(); - }); - this.EE.on('one__image__render__done', function (img) { - _this4.repaint(); - }); - } - }, { - key: "repaint", - value: function repaint() { - var start = new Date(); - Object(_common_util_js__WEBPACK_IMPORTED_MODULE_4__["repaintChildren"])(this.children); - this.emit('repaint__done'); - } - }, { - key: "getChildByPos", - value: function getChildByPos(tree, x, y) { - var list = Object.keys(tree.children); - - for (var i = 0; i < list.length; i++) { - var child = tree.children[list[i]]; - var box = child.realLayoutBox; - - if (box.realX <= x && x <= box.realX + box.width && box.realY <= y && y <= box.realY + box.height) { - if (Object.keys(child.children).length) { - return this.getChildByPos(child, x, y); - } else { - return child; - } - } - } - - return tree; - } - }, { - key: "eventHandler", - value: function eventHandler(eventName) { - return function touchEventHandler(e) { - if (!this.elementTree) { - return; - } - - var touch = e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e; - - if (!touch || !touch.pageX || !touch.pageY) { - return; - } - - if (!touch.timeStamp) { - touch.timeStamp = e.timeStamp; - } - - var item = touch && this.getChildByPos(this, touch.pageX, touch.pageY); - item && item.emit(eventName, e); - - if (eventName === 'touchstart' || eventName === 'touchend') { - this.touchMsg[eventName] = touch; - } - - if (eventName === 'touchend' && Object(_common_util_js__WEBPACK_IMPORTED_MODULE_4__["isClick"])(this.touchMsg)) { - item && item.emit('click', e); - } - }; - } - }, { - key: "bindEvents", - value: function bindEvents() { - if (this.hasEventHandler) { - return; - } - - this.hasEventHandler = true; - - if (typeof wx !== 'undefined') { - wx.onTouchStart(this.touchStart); - wx.onTouchMove(this.touchMove); - wx.onTouchEnd(this.touchEnd); - wx.onTouchCancel(this.touchCancel); - } else { - document.onmousedown = this.touchStart; - document.onmousemove = this.touchMove; - document.onmouseup = this.touchEnd; - document.onmouseleave = this.touchEnd; - } - } - }, { - key: "emit", - value: function emit(event, data) { - EE.emit(event, data); - } - }, { - key: "on", - value: function on(event, callback) { - EE.on(event, callback); - } - }, { - key: "once", - value: function once(event, callback) { - EE.once(event, callback); - } - }, { - key: "off", - value: function off(event, callback) { - EE.off(event, callback); - } - }, { - key: "getElementsById", - value: function getElementsById(id) { - return _getElementsById(this, [], id); - } - }, { - key: "getElementsByClassName", - value: function getElementsByClassName(className) { - return _getElementsByClassName(this, [], className); - } - }, { - key: "destroyAll", - value: function destroyAll(tree) { - var _this5 = this; - - if (!tree) { - tree = this; - } - - var children = tree.children; - children.forEach(function (child) { - child.destroy(); - - _this5.destroyAll(child); - - child.destroySelf && child.destroySelf(); - }); - } - }, { - key: "clear", - value: function clear() { - this.destroyAll(); - this.elementTree = null; - this.children = []; - this.layoutTree = {}; - this.state = _common_util_js__WEBPACK_IMPORTED_MODULE_4__["STATE"].CLEAR; - canvasPool.getList().forEach(function (item) { - item.context && item.context.clearRect(0, 0, item.canvas.width, item.canvas.height); - item.elements = []; - item.canvas = null; - item.context = null; - }); - - if (this.renderContext) { - this.renderContext.clearRect(0, 0, this.renderContext.canvas.width, this.renderContext.canvas.height); - } - /*['touchstart', 'touchmove', 'touchcancel', 'touchend', 'click', 'repaint'].forEach(eventName => { - this.off(eventName); - });*/ - - - this.EE.off('image__render__done'); - } - }, { - key: "clearPool", - value: function clearPool() { - imgPool.clear(); - canvasPool.clear(); - } - }, { - key: "clearAll", - value: function clearAll() { - this.clear(); - this.clearPool(); - } - }, { - key: "loadImgs", - value: function loadImgs(arr) { - arr.forEach(function (src) { - var img = Object(_common_util_js__WEBPACK_IMPORTED_MODULE_4__["createImage"])(); - imgPool.set(src, img); - - img.onload = function () { - img.loadDone = true; - }; - - img.onloadcbks = []; - img.src = src; - }); - } - }, { - key: "registBitMapFont", - value: function registBitMapFont(name, src, config) { - var font = new _common_bitMapFont__WEBPACK_IMPORTED_MODULE_6__["default"](name, src, config); - this.bitMapFonts.push(font); - } - }]); - - return _Layout; -}(_components_elements_js__WEBPACK_IMPORTED_MODULE_0__["default"]); - -var Layout = new _Layout({ - style: { - width: 0, - height: 0 - }, - name: 'layout' -}); -/* harmony default export */ __webpack_exports__["default"] = (Layout); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; }); -/* harmony import */ var _style_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - -var Emitter = __webpack_require__(3); // 全局事件管道 - - -var EE = new Emitter(); -var uuid = 0; -var dpr = 1; - -function hexToRgb(hex) { - var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - return result ? { - r: parseInt(result[1], 16), - g: parseInt(result[2], 16), - b: parseInt(result[3], 16) - } : null; -} - -function getRgba(hex, opacity) { - var rgbObj = hexToRgb(hex); - - if (opacity == undefined) { - opacity = 1; - } - - return "rgba(".concat(rgbObj.r, ", ").concat(rgbObj.g, ", ").concat(rgbObj.b, ", ").concat(opacity, ")"); -} - -var toEventName = function toEventName(event, id) { - var elementEvent = ['click', 'touchstart', 'touchmove', 'touchend', 'touchcancel']; - - if (elementEvent.indexOf(event) !== -1) { - return "element-".concat(id, "-").concat(event); - } - - return "element-".concat(id, "-").concat(event); -}; - -var Element = /*#__PURE__*/function () { - function Element(_ref) { - var _this = this; - - var _ref$style = _ref.style, - style = _ref$style === void 0 ? {} : _ref$style, - _ref$props = _ref.props, - props = _ref$props === void 0 ? {} : _ref$props, - _ref$idName = _ref.idName, - idName = _ref$idName === void 0 ? '' : _ref$idName, - _ref$className = _ref.className, - className = _ref$className === void 0 ? '' : _ref$className, - _ref$id = _ref.id, - id = _ref$id === void 0 ? ++uuid : _ref$id; - - _classCallCheck(this, Element); - - this.children = []; - this.childMap = {}; - this.parent = null; - this.parentId = 0; - this.id = id; - this.props = props; - this.idName = idName; - this.className = className; - this.style = style; - this.EE = EE; - this.root = null; - this.isDestroyed = false; - this.layoutBox = {}; - - if (style.opacity !== undefined && style.color && style.color.indexOf('#') > -1) { - style.color = getRgba(style.color, style.opacity); - } - - if (style.opacity !== undefined && style.backgroundColor && style.backgroundColor.indexOf('#') > -1) { - style.backgroundColor = getRgba(style.backgroundColor, style.opacity); - } - - for (var key in this.style) { - if (_style_js__WEBPACK_IMPORTED_MODULE_0__["scalableStyles"].indexOf(key) > -1) { - this.style[key] *= dpr; - } - } // 事件冒泡逻辑 - - - ['touchstart', 'touchmove', 'touchcancel', 'touchend', 'click'].forEach(function (eventName) { - _this.on(eventName, function (e, touchMsg) { - _this.parent && _this.parent.emit(eventName, e, touchMsg); - }); - }); - this.initRepaint(); - } - - _createClass(Element, [{ - key: "initRepaint", - value: function initRepaint() { - var _this2 = this; - - this.on('repaint', function (e) { - _this2.parent && _this2.parent.emit('repaint', e); - }); - } // 子类填充实现 - - }, { - key: "repaint", - value: function repaint() {} // 子类填充实现 - - }, { - key: "insert", - value: function insert() {} - }, { - key: "checkNeedRender", - value: function checkNeedRender() { - return true; - } // 子类填充实现 - - }, { - key: "destroy", - value: function destroy() { - var _this3 = this; - - ['touchstart', 'touchmove', 'touchcancel', 'touchend', 'click', 'repaint'].forEach(function (eventName) { - _this3.off(eventName); - }); - this.EE.off('image__render__done'); - this.isDestroyed = true; - this.EE = null; - /*this.root = null;*/ - - this.parent = null; - this.ctx = null; - this.realLayoutBox = null; - this.layoutBox = null; - this.props = null; - this.style = null; - - if (this.renderBoxes) { - this.renderBoxes = null; - } - } - }, { - key: "add", - value: function add(element) { - element.parent = this; - element.parentId = this.id; - this.children.push(element); - } - }, { - key: "emit", - value: function emit(event) { - for (var _len = arguments.length, theArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - theArgs[_key - 1] = arguments[_key]; - } - - EE.emit.apply(EE, [toEventName(event, this.id)].concat(theArgs)); - } - }, { - key: "on", - value: function on(event, callback) { - EE.on(toEventName(event, this.id), callback); - } - }, { - key: "once", - value: function once(event, callback) { - EE.once(toEventName(event, this.id), callback); - } - }, { - key: "off", - value: function off(event, callback) { - EE.off(toEventName(event, this.id), callback); - } // 方便子类实现borderRadius - - }, { - key: "roundRect", - value: function roundRect(ctx, layoutBox) { - var style = this.style || {}; - var box = layoutBox || this.layoutBox; - var w = box.width; - var h = box.height; - var r = style.borderRadius; - var x = box.absoluteX; - var y = box.absoluteY; - ctx.moveTo(x + r, y); - ctx.arcTo(x + w, y, x + w, y + h, r); - ctx.arcTo(x + w, y + h, x, y + h, r); - ctx.arcTo(x, y + h, x, y, r); - ctx.arcTo(x, y, x + w, y, r); - ctx.clip(); - } - }, { - key: "renderBorder", - value: function renderBorder(ctx, layoutBox) { - var style = this.style || {}; - - if (style.borderRadius) { - this.roundRect(ctx, layoutBox); - } - - ctx.save(); - var box = layoutBox || this.layoutBox; - var borderWidth = style.borderWidth || 0; - var borderLeftWidth = style.borderLeftWidth || 0; - var borderRightWidth = style.borderRightWidth || 0; - var borderTopWidth = style.borderTopWidth || 0; - var borderBottomWidth = style.borderBottomWidth || 0; - var radius = style.borderRadius || 0; - var borderColor = style.borderColor; - var drawX = box.absoluteX; - var drawY = box.absoluteY; - ctx.beginPath(); - - if (borderWidth && borderColor) { - ctx.lineWidth = borderWidth; - ctx.strokeStyle = borderColor; - ctx.strokeRect(drawX, drawY, box.width, box.height); - } - - if (borderTopWidth && (borderColor || style.borderTopColor)) { - ctx.lineWidth = borderTopWidth; - ctx.strokeStyle = style.borderTopColor || borderColor; - ctx.moveTo(radius ? drawX + radius : drawX, drawY + borderTopWidth / 2); - ctx.lineTo(radius ? drawX + box.width - radius : drawX + box.width, drawY + borderTopWidth / 2); - } - - if (borderBottomWidth && (borderColor || style.borderBottomColor)) { - ctx.lineWidth = borderBottomWidth; - ctx.strokeStyle = style.borderBottomColor || borderColor; - ctx.moveTo(radius ? drawX + radius : drawX, drawY + box.height - borderBottomWidth / 2); - ctx.lineTo(radius ? drawX + box.width - radius : drawX + box.width, drawY + box.height - borderBottomWidth / 2); - } - - if (borderLeftWidth && (borderColor || style.borderLeftColor)) { - ctx.lineWidth = borderLeftWidth; - ctx.strokeStyle = style.borderLeftColor || borderColor; - ctx.moveTo(drawX + borderLeftWidth / 2, radius ? drawY + radius : drawY); - ctx.lineTo(drawX + borderLeftWidth / 2, radius ? drawY + box.height - radius : drawY + box.height); - } - - if (borderRightWidth && (borderColor || style.borderRightColor)) { - ctx.lineWidth = borderRightWidth; - ctx.strokeStyle = style.borderRightColor || borderColor; - ctx.moveTo(drawX + box.width - borderRightWidth / 2, radius ? drawY + radius : drawY); - ctx.lineTo(drawX + box.width - borderRightWidth / 2, radius ? drawY + box.height - radius : drawY + box.height); - } - - ctx.closePath(); - ctx.stroke(); - ctx.restore(); - } - }]); - - return Element; -}(); - - - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scalableStyles", function() { return scalableStyles; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "textStyles", function() { return textStyles; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "layoutAffectedStyles", function() { return layoutAffectedStyles; }); -var textStyles = ['color', 'fontSize', 'textAlign', 'fontWeight', 'lineHeight', 'lineBreak']; -var scalableStyles = ['left', 'top', 'right', 'bottom', 'width', 'height', 'margin', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'padding', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'fontSize', 'lineHeight', 'borderRadius', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight']; -var layoutAffectedStyles = ['margin', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight', 'padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight', 'width', 'height']; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -function E () { - // Keep this empty so it's easier to inherit from - // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) -} - -E.prototype = { - on: function (name, callback, ctx) { - var e = this.e || (this.e = {}); - - (e[name] || (e[name] = [])).push({ - fn: callback, - ctx: ctx - }); - - return this; - }, - - once: function (name, callback, ctx) { - var self = this; - function listener () { - self.off(name, listener); - callback.apply(ctx, arguments); - }; - - listener._ = callback - return this.on(name, listener, ctx); - }, - - emit: function (name) { - var data = [].slice.call(arguments, 1); - var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); - var i = 0; - var len = evtArr.length; - - for (i; i < len; i++) { - evtArr[i].fn.apply(evtArr[i].ctx, data); - } - - return this; - }, - - off: function (name, callback) { - var e = this.e || (this.e = {}); - var evts = e[name]; - var liveEvents = []; - - if (evts && callback) { - for (var i = 0, len = evts.length; i < len; i++) { - if (evts[i].fn !== callback && evts[i].fn._ !== callback) - liveEvents.push(evts[i]); - } - } - - // Remove event from queue to prevent memory leak - // Suggested by https://github.com/lazd - // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 - - (liveEvents.length) - ? e[name] = liveEvents - : delete e[name]; - - return this; - } -}; - -module.exports = E; -module.exports.TinyEmitter = E; - - -/***/ }), -/* 4 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Pool; }); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var pools = []; - -var Pool = /*#__PURE__*/function () { - function Pool() { - var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pool'; - - _classCallCheck(this, Pool); - - var curr = pools.find(function (item) { - return item.name === name; - }); - - if (curr) { - return curr; - } - - this.name = name; - this.pool = {}; - pools.push(this); - } - - _createClass(Pool, [{ - key: "get", - value: function get(key) { - return this.pool[key]; - } - }, { - key: "set", - value: function set(key, value) { - this.pool[key] = value; - } - }, { - key: "clear", - value: function clear() { - this.pool = {}; - } - }, { - key: "getList", - value: function getList() { - return Object.values(this.pool); - } - }]); - - return Pool; -}(); - - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// UMD (Universal Module Definition) -// See https://github.com/umdjs/umd for reference -// -// This file uses the following specific UMD implementation: -// https://github.com/umdjs/umd/blob/master/returnExports.js -(function(root, factory) { - if (true) { - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -}(this, function() { - /** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -var computeLayout = (function() { - - var CSS_UNDEFINED; - - var CSS_DIRECTION_INHERIT = 'inherit'; - var CSS_DIRECTION_LTR = 'ltr'; - var CSS_DIRECTION_RTL = 'rtl'; - - var CSS_FLEX_DIRECTION_ROW = 'row'; - var CSS_FLEX_DIRECTION_ROW_REVERSE = 'row-reverse'; - var CSS_FLEX_DIRECTION_COLUMN = 'column'; - var CSS_FLEX_DIRECTION_COLUMN_REVERSE = 'column-reverse'; - - var CSS_JUSTIFY_FLEX_START = 'flex-start'; - var CSS_JUSTIFY_CENTER = 'center'; - var CSS_JUSTIFY_FLEX_END = 'flex-end'; - var CSS_JUSTIFY_SPACE_BETWEEN = 'space-between'; - var CSS_JUSTIFY_SPACE_AROUND = 'space-around'; - - var CSS_ALIGN_FLEX_START = 'flex-start'; - var CSS_ALIGN_CENTER = 'center'; - var CSS_ALIGN_FLEX_END = 'flex-end'; - var CSS_ALIGN_STRETCH = 'stretch'; - - var CSS_POSITION_RELATIVE = 'relative'; - var CSS_POSITION_ABSOLUTE = 'absolute'; - - var leading = { - 'row': 'left', - 'row-reverse': 'right', - 'column': 'top', - 'column-reverse': 'bottom' - }; - var trailing = { - 'row': 'right', - 'row-reverse': 'left', - 'column': 'bottom', - 'column-reverse': 'top' - }; - var pos = { - 'row': 'left', - 'row-reverse': 'right', - 'column': 'top', - 'column-reverse': 'bottom' - }; - var dim = { - 'row': 'width', - 'row-reverse': 'width', - 'column': 'height', - 'column-reverse': 'height' - }; - - // When transpiled to Java / C the node type has layout, children and style - // properties. For the JavaScript version this function adds these properties - // if they don't already exist. - function fillNodes(node) { - if (!node.layout || node.isDirty) { - node.layout = { - width: undefined, - height: undefined, - top: 0, - left: 0, - right: 0, - bottom: 0 - }; - } - - if (!node.style) { - node.style = {}; - } - - if (!node.children) { - node.children = []; - } - node.children.forEach(fillNodes); - return node; - } - - function isUndefined(value) { - return value === undefined; - } - - function isRowDirection(flexDirection) { - return flexDirection === CSS_FLEX_DIRECTION_ROW || - flexDirection === CSS_FLEX_DIRECTION_ROW_REVERSE; - } - - function isColumnDirection(flexDirection) { - return flexDirection === CSS_FLEX_DIRECTION_COLUMN || - flexDirection === CSS_FLEX_DIRECTION_COLUMN_REVERSE; - } - - function getLeadingMargin(node, axis) { - if (node.style.marginStart !== undefined && isRowDirection(axis)) { - return node.style.marginStart; - } - - var value = null; - switch (axis) { - case 'row': value = node.style.marginLeft; break; - case 'row-reverse': value = node.style.marginRight; break; - case 'column': value = node.style.marginTop; break; - case 'column-reverse': value = node.style.marginBottom; break; - } - - if (value !== undefined) { - return value; - } - - if (node.style.margin !== undefined) { - return node.style.margin; - } - - return 0; - } - - function getTrailingMargin(node, axis) { - if (node.style.marginEnd !== undefined && isRowDirection(axis)) { - return node.style.marginEnd; - } - - var value = null; - switch (axis) { - case 'row': value = node.style.marginRight; break; - case 'row-reverse': value = node.style.marginLeft; break; - case 'column': value = node.style.marginBottom; break; - case 'column-reverse': value = node.style.marginTop; break; - } - - if (value != null) { - return value; - } - - if (node.style.margin !== undefined) { - return node.style.margin; - } - - return 0; - } - - function getLeadingPadding(node, axis) { - if (node.style.paddingStart !== undefined && node.style.paddingStart >= 0 - && isRowDirection(axis)) { - return node.style.paddingStart; - } - - var value = null; - switch (axis) { - case 'row': value = node.style.paddingLeft; break; - case 'row-reverse': value = node.style.paddingRight; break; - case 'column': value = node.style.paddingTop; break; - case 'column-reverse': value = node.style.paddingBottom; break; - } - - if (value != null && value >= 0) { - return value; - } - - if (node.style.padding !== undefined && node.style.padding >= 0) { - return node.style.padding; - } - - return 0; - } - - function getTrailingPadding(node, axis) { - if (node.style.paddingEnd !== undefined && node.style.paddingEnd >= 0 - && isRowDirection(axis)) { - return node.style.paddingEnd; - } - - var value = null; - switch (axis) { - case 'row': value = node.style.paddingRight; break; - case 'row-reverse': value = node.style.paddingLeft; break; - case 'column': value = node.style.paddingBottom; break; - case 'column-reverse': value = node.style.paddingTop; break; - } - - if (value != null && value >= 0) { - return value; - } - - if (node.style.padding !== undefined && node.style.padding >= 0) { - return node.style.padding; - } - - return 0; - } - - function getLeadingBorder(node, axis) { - if (node.style.borderStartWidth !== undefined && node.style.borderStartWidth >= 0 - && isRowDirection(axis)) { - return node.style.borderStartWidth; - } - - var value = null; - switch (axis) { - case 'row': value = node.style.borderLeftWidth; break; - case 'row-reverse': value = node.style.borderRightWidth; break; - case 'column': value = node.style.borderTopWidth; break; - case 'column-reverse': value = node.style.borderBottomWidth; break; - } - - if (value != null && value >= 0) { - return value; - } - - if (node.style.borderWidth !== undefined && node.style.borderWidth >= 0) { - return node.style.borderWidth; - } - - return 0; - } - - function getTrailingBorder(node, axis) { - if (node.style.borderEndWidth !== undefined && node.style.borderEndWidth >= 0 - && isRowDirection(axis)) { - return node.style.borderEndWidth; - } - - var value = null; - switch (axis) { - case 'row': value = node.style.borderRightWidth; break; - case 'row-reverse': value = node.style.borderLeftWidth; break; - case 'column': value = node.style.borderBottomWidth; break; - case 'column-reverse': value = node.style.borderTopWidth; break; - } - - if (value != null && value >= 0) { - return value; - } - - if (node.style.borderWidth !== undefined && node.style.borderWidth >= 0) { - return node.style.borderWidth; - } - - return 0; - } - - function getLeadingPaddingAndBorder(node, axis) { - return getLeadingPadding(node, axis) + getLeadingBorder(node, axis); - } - - function getTrailingPaddingAndBorder(node, axis) { - return getTrailingPadding(node, axis) + getTrailingBorder(node, axis); - } - - function getBorderAxis(node, axis) { - return getLeadingBorder(node, axis) + getTrailingBorder(node, axis); - } - - function getMarginAxis(node, axis) { - return getLeadingMargin(node, axis) + getTrailingMargin(node, axis); - } - - function getPaddingAndBorderAxis(node, axis) { - return getLeadingPaddingAndBorder(node, axis) + - getTrailingPaddingAndBorder(node, axis); - } - - function getJustifyContent(node) { - if (node.style.justifyContent) { - return node.style.justifyContent; - } - return 'flex-start'; - } - - function getAlignContent(node) { - if (node.style.alignContent) { - return node.style.alignContent; - } - return 'flex-start'; - } - - function getAlignItem(node, child) { - if (child.style.alignSelf) { - return child.style.alignSelf; - } - if (node.style.alignItems) { - return node.style.alignItems; - } - return 'stretch'; - } - - function resolveAxis(axis, direction) { - if (direction === CSS_DIRECTION_RTL) { - if (axis === CSS_FLEX_DIRECTION_ROW) { - return CSS_FLEX_DIRECTION_ROW_REVERSE; - } else if (axis === CSS_FLEX_DIRECTION_ROW_REVERSE) { - return CSS_FLEX_DIRECTION_ROW; - } - } - - return axis; - } - - function resolveDirection(node, parentDirection) { - var direction; - if (node.style.direction) { - direction = node.style.direction; - } else { - direction = CSS_DIRECTION_INHERIT; - } - - if (direction === CSS_DIRECTION_INHERIT) { - direction = (parentDirection === undefined ? CSS_DIRECTION_LTR : parentDirection); - } - - return direction; - } - - function getFlexDirection(node) { - if (node.style.flexDirection) { - return node.style.flexDirection; - } - return CSS_FLEX_DIRECTION_COLUMN; - } - - function getCrossFlexDirection(flexDirection, direction) { - if (isColumnDirection(flexDirection)) { - return resolveAxis(CSS_FLEX_DIRECTION_ROW, direction); - } else { - return CSS_FLEX_DIRECTION_COLUMN; - } - } - - function getPositionType(node) { - if (node.style.position) { - return node.style.position; - } - return 'relative'; - } - - function isFlex(node) { - return ( - getPositionType(node) === CSS_POSITION_RELATIVE && - node.style.flex > 0 - ); - } - - function isFlexWrap(node) { - return node.style.flexWrap === 'wrap'; - } - - function getDimWithMargin(node, axis) { - return node.layout[dim[axis]] + getMarginAxis(node, axis); - } - - function isDimDefined(node, axis) { - return node.style[dim[axis]] !== undefined && node.style[dim[axis]] >= 0; - } - - function isPosDefined(node, pos) { - return node.style[pos] !== undefined; - } - - function isMeasureDefined(node) { - return node.style.measure !== undefined; - } - - function getPosition(node, pos) { - if (node.style[pos] !== undefined) { - return node.style[pos]; - } - return 0; - } - - function boundAxis(node, axis, value) { - var min = { - 'row': node.style.minWidth, - 'row-reverse': node.style.minWidth, - 'column': node.style.minHeight, - 'column-reverse': node.style.minHeight - }[axis]; - - var max = { - 'row': node.style.maxWidth, - 'row-reverse': node.style.maxWidth, - 'column': node.style.maxHeight, - 'column-reverse': node.style.maxHeight - }[axis]; - - var boundValue = value; - if (max !== undefined && max >= 0 && boundValue > max) { - boundValue = max; - } - if (min !== undefined && min >= 0 && boundValue < min) { - boundValue = min; - } - return boundValue; - } - - function fmaxf(a, b) { - if (a > b) { - return a; - } - return b; - } - - // When the user specifically sets a value for width or height - function setDimensionFromStyle(node, axis) { - // The parent already computed us a width or height. We just skip it - if (node.layout[dim[axis]] !== undefined) { - return; - } - // We only run if there's a width or height defined - if (!isDimDefined(node, axis)) { - return; - } - - // The dimensions can never be smaller than the padding and border - node.layout[dim[axis]] = fmaxf( - boundAxis(node, axis, node.style[dim[axis]]), - getPaddingAndBorderAxis(node, axis) - ); - } - - function setTrailingPosition(node, child, axis) { - child.layout[trailing[axis]] = node.layout[dim[axis]] - - child.layout[dim[axis]] - child.layout[pos[axis]]; - } - - // If both left and right are defined, then use left. Otherwise return - // +left or -right depending on which is defined. - function getRelativePosition(node, axis) { - if (node.style[leading[axis]] !== undefined) { - return getPosition(node, leading[axis]); - } - return -getPosition(node, trailing[axis]); - } - - function layoutNodeImpl(node, parentMaxWidth, /*css_direction_t*/parentDirection) { - var/*css_direction_t*/ direction = resolveDirection(node, parentDirection); - var/*(c)!css_flex_direction_t*//*(java)!int*/ mainAxis = resolveAxis(getFlexDirection(node), direction); - var/*(c)!css_flex_direction_t*//*(java)!int*/ crossAxis = getCrossFlexDirection(mainAxis, direction); - var/*(c)!css_flex_direction_t*//*(java)!int*/ resolvedRowAxis = resolveAxis(CSS_FLEX_DIRECTION_ROW, direction); - - // Handle width and height style attributes - setDimensionFromStyle(node, mainAxis); - setDimensionFromStyle(node, crossAxis); - - // Set the resolved resolution in the node's layout - node.layout.direction = direction; - - // The position is set by the parent, but we need to complete it with a - // delta composed of the margin and left/top/right/bottom - node.layout[leading[mainAxis]] += getLeadingMargin(node, mainAxis) + - getRelativePosition(node, mainAxis); - node.layout[trailing[mainAxis]] += getTrailingMargin(node, mainAxis) + - getRelativePosition(node, mainAxis); - node.layout[leading[crossAxis]] += getLeadingMargin(node, crossAxis) + - getRelativePosition(node, crossAxis); - node.layout[trailing[crossAxis]] += getTrailingMargin(node, crossAxis) + - getRelativePosition(node, crossAxis); - - // Inline immutable values from the target node to avoid excessive method - // invocations during the layout calculation. - var/*int*/ childCount = node.children.length; - var/*float*/ paddingAndBorderAxisResolvedRow = getPaddingAndBorderAxis(node, resolvedRowAxis); - - if (isMeasureDefined(node)) { - var/*bool*/ isResolvedRowDimDefined = !isUndefined(node.layout[dim[resolvedRowAxis]]); - - var/*float*/ width = CSS_UNDEFINED; - if (isDimDefined(node, resolvedRowAxis)) { - width = node.style.width; - } else if (isResolvedRowDimDefined) { - width = node.layout[dim[resolvedRowAxis]]; - } else { - width = parentMaxWidth - - getMarginAxis(node, resolvedRowAxis); - } - width -= paddingAndBorderAxisResolvedRow; - - // We only need to give a dimension for the text if we haven't got any - // for it computed yet. It can either be from the style attribute or because - // the element is flexible. - var/*bool*/ isRowUndefined = !isDimDefined(node, resolvedRowAxis) && !isResolvedRowDimDefined; - var/*bool*/ isColumnUndefined = !isDimDefined(node, CSS_FLEX_DIRECTION_COLUMN) && - isUndefined(node.layout[dim[CSS_FLEX_DIRECTION_COLUMN]]); - - // Let's not measure the text if we already know both dimensions - if (isRowUndefined || isColumnUndefined) { - var/*css_dim_t*/ measureDim = node.style.measure( - /*(c)!node->context,*/ - /*(java)!layoutContext.measureOutput,*/ - width - ); - if (isRowUndefined) { - node.layout.width = measureDim.width + - paddingAndBorderAxisResolvedRow; - } - if (isColumnUndefined) { - node.layout.height = measureDim.height + - getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_COLUMN); - } - } - if (childCount === 0) { - return; - } - } - - var/*bool*/ isNodeFlexWrap = isFlexWrap(node); - - var/*css_justify_t*/ justifyContent = getJustifyContent(node); - - var/*float*/ leadingPaddingAndBorderMain = getLeadingPaddingAndBorder(node, mainAxis); - var/*float*/ leadingPaddingAndBorderCross = getLeadingPaddingAndBorder(node, crossAxis); - var/*float*/ paddingAndBorderAxisMain = getPaddingAndBorderAxis(node, mainAxis); - var/*float*/ paddingAndBorderAxisCross = getPaddingAndBorderAxis(node, crossAxis); - - var/*bool*/ isMainDimDefined = !isUndefined(node.layout[dim[mainAxis]]); - var/*bool*/ isCrossDimDefined = !isUndefined(node.layout[dim[crossAxis]]); - var/*bool*/ isMainRowDirection = isRowDirection(mainAxis); - - var/*int*/ i; - var/*int*/ ii; - var/*css_node_t**/ child; - var/*(c)!css_flex_direction_t*//*(java)!int*/ axis; - - var/*css_node_t**/ firstAbsoluteChild = null; - var/*css_node_t**/ currentAbsoluteChild = null; - - var/*float*/ definedMainDim = CSS_UNDEFINED; - if (isMainDimDefined) { - definedMainDim = node.layout[dim[mainAxis]] - paddingAndBorderAxisMain; - } - - // We want to execute the next two loops one per line with flex-wrap - var/*int*/ startLine = 0; - var/*int*/ endLine = 0; - // var/*int*/ nextOffset = 0; - var/*int*/ alreadyComputedNextLayout = 0; - // We aggregate the total dimensions of the container in those two variables - var/*float*/ linesCrossDim = 0; - var/*float*/ linesMainDim = 0; - var/*int*/ linesCount = 0; - while (endLine < childCount) { - // Layout non flexible children and count children by type - - // mainContentDim is accumulation of the dimensions and margin of all the - // non flexible children. This will be used in order to either set the - // dimensions of the node if none already exist, or to compute the - // remaining space left for the flexible children. - var/*float*/ mainContentDim = 0; - - // There are three kind of children, non flexible, flexible and absolute. - // We need to know how many there are in order to distribute the space. - var/*int*/ flexibleChildrenCount = 0; - var/*float*/ totalFlexible = 0; - var/*int*/ nonFlexibleChildrenCount = 0; - - // Use the line loop to position children in the main axis for as long - // as they are using a simple stacking behaviour. Children that are - // immediately stacked in the initial loop will not be touched again - // in . - var/*bool*/ isSimpleStackMain = - (isMainDimDefined && justifyContent === CSS_JUSTIFY_FLEX_START) || - (!isMainDimDefined && justifyContent !== CSS_JUSTIFY_CENTER); - var/*int*/ firstComplexMain = (isSimpleStackMain ? childCount : startLine); - - // Use the initial line loop to position children in the cross axis for - // as long as they are relatively positioned with alignment STRETCH or - // FLEX_START. Children that are immediately stacked in the initial loop - // will not be touched again in . - var/*bool*/ isSimpleStackCross = true; - var/*int*/ firstComplexCross = childCount; - - var/*css_node_t**/ firstFlexChild = null; - var/*css_node_t**/ currentFlexChild = null; - - var/*float*/ mainDim = leadingPaddingAndBorderMain; - var/*float*/ crossDim = 0; - - var/*float*/ maxWidth; - for (i = startLine; i < childCount; ++i) { - child = node.children[i]; - child.lineIndex = linesCount; - - child.nextAbsoluteChild = null; - child.nextFlexChild = null; - - var/*css_align_t*/ alignItem = getAlignItem(node, child); - - // Pre-fill cross axis dimensions when the child is using stretch before - // we call the recursive layout pass - if (alignItem === CSS_ALIGN_STRETCH && - getPositionType(child) === CSS_POSITION_RELATIVE && - isCrossDimDefined && - !isDimDefined(child, crossAxis)) { - child.layout[dim[crossAxis]] = fmaxf( - boundAxis(child, crossAxis, node.layout[dim[crossAxis]] - - paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)), - // You never want to go smaller than padding - getPaddingAndBorderAxis(child, crossAxis) - ); - } else if (getPositionType(child) === CSS_POSITION_ABSOLUTE) { - // Store a private linked list of absolutely positioned children - // so that we can efficiently traverse them later. - if (firstAbsoluteChild === null) { - firstAbsoluteChild = child; - } - if (currentAbsoluteChild !== null) { - currentAbsoluteChild.nextAbsoluteChild = child; - } - currentAbsoluteChild = child; - - // Pre-fill dimensions when using absolute position and both offsets for the axis are defined (either both - // left and right or top and bottom). - for (ii = 0; ii < 2; ii++) { - axis = (ii !== 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN; - if (!isUndefined(node.layout[dim[axis]]) && - !isDimDefined(child, axis) && - isPosDefined(child, leading[axis]) && - isPosDefined(child, trailing[axis])) { - child.layout[dim[axis]] = fmaxf( - boundAxis(child, axis, node.layout[dim[axis]] - - getPaddingAndBorderAxis(node, axis) - - getMarginAxis(child, axis) - - getPosition(child, leading[axis]) - - getPosition(child, trailing[axis])), - // You never want to go smaller than padding - getPaddingAndBorderAxis(child, axis) - ); - } - } - } - - var/*float*/ nextContentDim = 0; - - // It only makes sense to consider a child flexible if we have a computed - // dimension for the node. - if (isMainDimDefined && isFlex(child)) { - flexibleChildrenCount++; - totalFlexible += child.style.flex; - - // Store a private linked list of flexible children so that we can - // efficiently traverse them later. - if (firstFlexChild === null) { - firstFlexChild = child; - } - if (currentFlexChild !== null) { - currentFlexChild.nextFlexChild = child; - } - currentFlexChild = child; - - // Even if we don't know its exact size yet, we already know the padding, - // border and margin. We'll use this partial information, which represents - // the smallest possible size for the child, to compute the remaining - // available space. - nextContentDim = getPaddingAndBorderAxis(child, mainAxis) + - getMarginAxis(child, mainAxis); - - } else { - maxWidth = CSS_UNDEFINED; - if (!isMainRowDirection) { - if (isDimDefined(node, resolvedRowAxis)) { - maxWidth = node.layout[dim[resolvedRowAxis]] - - paddingAndBorderAxisResolvedRow; - } else { - maxWidth = parentMaxWidth - - getMarginAxis(node, resolvedRowAxis) - - paddingAndBorderAxisResolvedRow; - } - } - - // This is the main recursive call. We layout non flexible children. - if (alreadyComputedNextLayout === 0) { - layoutNode(/*(java)!layoutContext, */child, maxWidth, direction); - } - - // Absolute positioned elements do not take part of the layout, so we - // don't use them to compute mainContentDim - if (getPositionType(child) === CSS_POSITION_RELATIVE) { - nonFlexibleChildrenCount++; - // At this point we know the final size and margin of the element. - nextContentDim = getDimWithMargin(child, mainAxis); - } - } - - // The element we are about to add would make us go to the next line - if (isNodeFlexWrap && - isMainDimDefined && - mainContentDim + nextContentDim > definedMainDim && - // If there's only one element, then it's bigger than the content - // and needs its own line - i !== startLine) { - nonFlexibleChildrenCount--; - alreadyComputedNextLayout = 1; - break; - } - - // Disable simple stacking in the main axis for the current line as - // we found a non-trivial child. The remaining children will be laid out - // in . - if (isSimpleStackMain && - (getPositionType(child) !== CSS_POSITION_RELATIVE || isFlex(child))) { - isSimpleStackMain = false; - firstComplexMain = i; - } - - // Disable simple stacking in the cross axis for the current line as - // we found a non-trivial child. The remaining children will be laid out - // in . - if (isSimpleStackCross && - (getPositionType(child) !== CSS_POSITION_RELATIVE || - (alignItem !== CSS_ALIGN_STRETCH && alignItem !== CSS_ALIGN_FLEX_START) || - isUndefined(child.layout[dim[crossAxis]]))) { - isSimpleStackCross = false; - firstComplexCross = i; - } - - if (isSimpleStackMain) { - child.layout[pos[mainAxis]] += mainDim; - if (isMainDimDefined) { - setTrailingPosition(node, child, mainAxis); - } - - mainDim += getDimWithMargin(child, mainAxis); - crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis))); - } - - if (isSimpleStackCross) { - child.layout[pos[crossAxis]] += linesCrossDim + leadingPaddingAndBorderCross; - if (isCrossDimDefined) { - setTrailingPosition(node, child, crossAxis); - } - } - - alreadyComputedNextLayout = 0; - mainContentDim += nextContentDim; - endLine = i + 1; - } - - // Layout flexible children and allocate empty space - - // In order to position the elements in the main axis, we have two - // controls. The space between the beginning and the first element - // and the space between each two elements. - var/*float*/ leadingMainDim = 0; - var/*float*/ betweenMainDim = 0; - - // The remaining available space that needs to be allocated - var/*float*/ remainingMainDim = 0; - if (isMainDimDefined) { - remainingMainDim = definedMainDim - mainContentDim; - } else { - remainingMainDim = fmaxf(mainContentDim, 0) - mainContentDim; - } - - // If there are flexible children in the mix, they are going to fill the - // remaining space - if (flexibleChildrenCount !== 0) { - var/*float*/ flexibleMainDim = remainingMainDim / totalFlexible; - var/*float*/ baseMainDim; - var/*float*/ boundMainDim; - - // If the flex share of remaining space doesn't meet min/max bounds, - // remove this child from flex calculations. - currentFlexChild = firstFlexChild; - while (currentFlexChild !== null) { - baseMainDim = flexibleMainDim * currentFlexChild.style.flex + - getPaddingAndBorderAxis(currentFlexChild, mainAxis); - boundMainDim = boundAxis(currentFlexChild, mainAxis, baseMainDim); - - if (baseMainDim !== boundMainDim) { - remainingMainDim -= boundMainDim; - totalFlexible -= currentFlexChild.style.flex; - } - - currentFlexChild = currentFlexChild.nextFlexChild; - } - flexibleMainDim = remainingMainDim / totalFlexible; - - // The non flexible children can overflow the container, in this case - // we should just assume that there is no space available. - if (flexibleMainDim < 0) { - flexibleMainDim = 0; - } - - currentFlexChild = firstFlexChild; - while (currentFlexChild !== null) { - // At this point we know the final size of the element in the main - // dimension - currentFlexChild.layout[dim[mainAxis]] = boundAxis(currentFlexChild, mainAxis, - flexibleMainDim * currentFlexChild.style.flex + - getPaddingAndBorderAxis(currentFlexChild, mainAxis) - ); - - maxWidth = CSS_UNDEFINED; - if (isDimDefined(node, resolvedRowAxis)) { - maxWidth = node.layout[dim[resolvedRowAxis]] - - paddingAndBorderAxisResolvedRow; - } else if (!isMainRowDirection) { - maxWidth = parentMaxWidth - - getMarginAxis(node, resolvedRowAxis) - - paddingAndBorderAxisResolvedRow; - } - - // And we recursively call the layout algorithm for this child - layoutNode(/*(java)!layoutContext, */currentFlexChild, maxWidth, direction); - - child = currentFlexChild; - currentFlexChild = currentFlexChild.nextFlexChild; - child.nextFlexChild = null; - } - - // We use justifyContent to figure out how to allocate the remaining - // space available - } else if (justifyContent !== CSS_JUSTIFY_FLEX_START) { - if (justifyContent === CSS_JUSTIFY_CENTER) { - leadingMainDim = remainingMainDim / 2; - } else if (justifyContent === CSS_JUSTIFY_FLEX_END) { - leadingMainDim = remainingMainDim; - } else if (justifyContent === CSS_JUSTIFY_SPACE_BETWEEN) { - remainingMainDim = fmaxf(remainingMainDim, 0); - if (flexibleChildrenCount + nonFlexibleChildrenCount - 1 !== 0) { - betweenMainDim = remainingMainDim / - (flexibleChildrenCount + nonFlexibleChildrenCount - 1); - } else { - betweenMainDim = 0; - } - } else if (justifyContent === CSS_JUSTIFY_SPACE_AROUND) { - // Space on the edges is half of the space between elements - betweenMainDim = remainingMainDim / - (flexibleChildrenCount + nonFlexibleChildrenCount); - leadingMainDim = betweenMainDim / 2; - } - } - - // Position elements in the main axis and compute dimensions - - // At this point, all the children have their dimensions set. We need to - // find their position. In order to do that, we accumulate data in - // variables that are also useful to compute the total dimensions of the - // container! - mainDim += leadingMainDim; - - for (i = firstComplexMain; i < endLine; ++i) { - child = node.children[i]; - - if (getPositionType(child) === CSS_POSITION_ABSOLUTE && - isPosDefined(child, leading[mainAxis])) { - // In case the child is position absolute and has left/top being - // defined, we override the position to whatever the user said - // (and margin/border). - child.layout[pos[mainAxis]] = getPosition(child, leading[mainAxis]) + - getLeadingBorder(node, mainAxis) + - getLeadingMargin(child, mainAxis); - } else { - // If the child is position absolute (without top/left) or relative, - // we put it at the current accumulated offset. - child.layout[pos[mainAxis]] += mainDim; - - // Define the trailing position accordingly. - if (isMainDimDefined) { - setTrailingPosition(node, child, mainAxis); - } - - // Now that we placed the element, we need to update the variables - // We only need to do that for relative elements. Absolute elements - // do not take part in that phase. - if (getPositionType(child) === CSS_POSITION_RELATIVE) { - // The main dimension is the sum of all the elements dimension plus - // the spacing. - mainDim += betweenMainDim + getDimWithMargin(child, mainAxis); - // The cross dimension is the max of the elements dimension since there - // can only be one element in that cross dimension. - crossDim = fmaxf(crossDim, boundAxis(child, crossAxis, getDimWithMargin(child, crossAxis))); - } - } - } - - var/*float*/ containerCrossAxis = node.layout[dim[crossAxis]]; - if (!isCrossDimDefined) { - containerCrossAxis = fmaxf( - // For the cross dim, we add both sides at the end because the value - // is aggregate via a max function. Intermediate negative values - // can mess this computation otherwise - boundAxis(node, crossAxis, crossDim + paddingAndBorderAxisCross), - paddingAndBorderAxisCross - ); - } - - // Position elements in the cross axis - for (i = firstComplexCross; i < endLine; ++i) { - child = node.children[i]; - - if (getPositionType(child) === CSS_POSITION_ABSOLUTE && - isPosDefined(child, leading[crossAxis])) { - // In case the child is absolutely positionned and has a - // top/left/bottom/right being set, we override all the previously - // computed positions to set it correctly. - child.layout[pos[crossAxis]] = getPosition(child, leading[crossAxis]) + - getLeadingBorder(node, crossAxis) + - getLeadingMargin(child, crossAxis); - - } else { - var/*float*/ leadingCrossDim = leadingPaddingAndBorderCross; - - // For a relative children, we're either using alignItems (parent) or - // alignSelf (child) in order to determine the position in the cross axis - if (getPositionType(child) === CSS_POSITION_RELATIVE) { - /*eslint-disable */ - // This variable is intentionally re-defined as the code is transpiled to a block scope language - var/*css_align_t*/ alignItem = getAlignItem(node, child); - /*eslint-enable */ - if (alignItem === CSS_ALIGN_STRETCH) { - // You can only stretch if the dimension has not already been set - // previously. - if (isUndefined(child.layout[dim[crossAxis]])) { - child.layout[dim[crossAxis]] = fmaxf( - boundAxis(child, crossAxis, containerCrossAxis - - paddingAndBorderAxisCross - getMarginAxis(child, crossAxis)), - // You never want to go smaller than padding - getPaddingAndBorderAxis(child, crossAxis) - ); - } - } else if (alignItem !== CSS_ALIGN_FLEX_START) { - // The remaining space between the parent dimensions+padding and child - // dimensions+margin. - var/*float*/ remainingCrossDim = containerCrossAxis - - paddingAndBorderAxisCross - getDimWithMargin(child, crossAxis); - - if (alignItem === CSS_ALIGN_CENTER) { - leadingCrossDim += remainingCrossDim / 2; - } else { // CSS_ALIGN_FLEX_END - leadingCrossDim += remainingCrossDim; - } - } - } - - // And we apply the position - child.layout[pos[crossAxis]] += linesCrossDim + leadingCrossDim; - - // Define the trailing position accordingly. - if (isCrossDimDefined) { - setTrailingPosition(node, child, crossAxis); - } - } - } - - linesCrossDim += crossDim; - linesMainDim = fmaxf(linesMainDim, mainDim); - linesCount += 1; - startLine = endLine; - } - - // - // - // Note(prenaux): More than one line, we need to layout the crossAxis - // according to alignContent. - // - // Note that we could probably remove and handle the one line case - // here too, but for the moment this is safer since it won't interfere with - // previously working code. - // - // See specs: - // http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/#layout-algorithm - // section 9.4 - // - if (linesCount > 1 && isCrossDimDefined) { - var/*float*/ nodeCrossAxisInnerSize = node.layout[dim[crossAxis]] - - paddingAndBorderAxisCross; - var/*float*/ remainingAlignContentDim = nodeCrossAxisInnerSize - linesCrossDim; - - var/*float*/ crossDimLead = 0; - var/*float*/ currentLead = leadingPaddingAndBorderCross; - - var/*css_align_t*/ alignContent = getAlignContent(node); - if (alignContent === CSS_ALIGN_FLEX_END) { - currentLead += remainingAlignContentDim; - } else if (alignContent === CSS_ALIGN_CENTER) { - currentLead += remainingAlignContentDim / 2; - } else if (alignContent === CSS_ALIGN_STRETCH) { - if (nodeCrossAxisInnerSize > linesCrossDim) { - crossDimLead = (remainingAlignContentDim / linesCount); - } - } - - var/*int*/ endIndex = 0; - for (i = 0; i < linesCount; ++i) { - var/*int*/ startIndex = endIndex; - - // compute the line's height and find the endIndex - var/*float*/ lineHeight = 0; - for (ii = startIndex; ii < childCount; ++ii) { - child = node.children[ii]; - if (getPositionType(child) !== CSS_POSITION_RELATIVE) { - continue; - } - if (child.lineIndex !== i) { - break; - } - if (!isUndefined(child.layout[dim[crossAxis]])) { - lineHeight = fmaxf( - lineHeight, - child.layout[dim[crossAxis]] + getMarginAxis(child, crossAxis) - ); - } - } - endIndex = ii; - lineHeight += crossDimLead; - - for (ii = startIndex; ii < endIndex; ++ii) { - child = node.children[ii]; - if (getPositionType(child) !== CSS_POSITION_RELATIVE) { - continue; - } - - var/*css_align_t*/ alignContentAlignItem = getAlignItem(node, child); - if (alignContentAlignItem === CSS_ALIGN_FLEX_START) { - child.layout[pos[crossAxis]] = currentLead + getLeadingMargin(child, crossAxis); - } else if (alignContentAlignItem === CSS_ALIGN_FLEX_END) { - child.layout[pos[crossAxis]] = currentLead + lineHeight - getTrailingMargin(child, crossAxis) - child.layout[dim[crossAxis]]; - } else if (alignContentAlignItem === CSS_ALIGN_CENTER) { - var/*float*/ childHeight = child.layout[dim[crossAxis]]; - child.layout[pos[crossAxis]] = currentLead + (lineHeight - childHeight) / 2; - } else if (alignContentAlignItem === CSS_ALIGN_STRETCH) { - child.layout[pos[crossAxis]] = currentLead + getLeadingMargin(child, crossAxis); - // TODO(prenaux): Correctly set the height of items with undefined - // (auto) crossAxis dimension. - } - } - - currentLead += lineHeight; - } - } - - var/*bool*/ needsMainTrailingPos = false; - var/*bool*/ needsCrossTrailingPos = false; - - // If the user didn't specify a width or height, and it has not been set - // by the container, then we set it via the children. - if (!isMainDimDefined) { - node.layout[dim[mainAxis]] = fmaxf( - // We're missing the last padding at this point to get the final - // dimension - boundAxis(node, mainAxis, linesMainDim + getTrailingPaddingAndBorder(node, mainAxis)), - // We can never assign a width smaller than the padding and borders - paddingAndBorderAxisMain - ); - - if (mainAxis === CSS_FLEX_DIRECTION_ROW_REVERSE || - mainAxis === CSS_FLEX_DIRECTION_COLUMN_REVERSE) { - needsMainTrailingPos = true; - } - } - - if (!isCrossDimDefined) { - node.layout[dim[crossAxis]] = fmaxf( - // For the cross dim, we add both sides at the end because the value - // is aggregate via a max function. Intermediate negative values - // can mess this computation otherwise - boundAxis(node, crossAxis, linesCrossDim + paddingAndBorderAxisCross), - paddingAndBorderAxisCross - ); - - if (crossAxis === CSS_FLEX_DIRECTION_ROW_REVERSE || - crossAxis === CSS_FLEX_DIRECTION_COLUMN_REVERSE) { - needsCrossTrailingPos = true; - } - } - - // Set trailing position if necessary - if (needsMainTrailingPos || needsCrossTrailingPos) { - for (i = 0; i < childCount; ++i) { - child = node.children[i]; - - if (needsMainTrailingPos) { - setTrailingPosition(node, child, mainAxis); - } - - if (needsCrossTrailingPos) { - setTrailingPosition(node, child, crossAxis); - } - } - } - - // Calculate dimensions for absolutely positioned elements - currentAbsoluteChild = firstAbsoluteChild; - while (currentAbsoluteChild !== null) { - // Pre-fill dimensions when using absolute position and both offsets for - // the axis are defined (either both left and right or top and bottom). - for (ii = 0; ii < 2; ii++) { - axis = (ii !== 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN; - - if (!isUndefined(node.layout[dim[axis]]) && - !isDimDefined(currentAbsoluteChild, axis) && - isPosDefined(currentAbsoluteChild, leading[axis]) && - isPosDefined(currentAbsoluteChild, trailing[axis])) { - currentAbsoluteChild.layout[dim[axis]] = fmaxf( - boundAxis(currentAbsoluteChild, axis, node.layout[dim[axis]] - - getBorderAxis(node, axis) - - getMarginAxis(currentAbsoluteChild, axis) - - getPosition(currentAbsoluteChild, leading[axis]) - - getPosition(currentAbsoluteChild, trailing[axis]) - ), - // You never want to go smaller than padding - getPaddingAndBorderAxis(currentAbsoluteChild, axis) - ); - } - - if (isPosDefined(currentAbsoluteChild, trailing[axis]) && - !isPosDefined(currentAbsoluteChild, leading[axis])) { - currentAbsoluteChild.layout[leading[axis]] = - node.layout[dim[axis]] - - currentAbsoluteChild.layout[dim[axis]] - - getPosition(currentAbsoluteChild, trailing[axis]); - } - } - - child = currentAbsoluteChild; - currentAbsoluteChild = currentAbsoluteChild.nextAbsoluteChild; - child.nextAbsoluteChild = null; - } - } - - function layoutNode(node, parentMaxWidth, parentDirection) { - node.shouldUpdate = true; - - var direction = node.style.direction || CSS_DIRECTION_LTR; - var skipLayout = - !node.isDirty && - node.lastLayout && - node.lastLayout.requestedHeight === node.layout.height && - node.lastLayout.requestedWidth === node.layout.width && - node.lastLayout.parentMaxWidth === parentMaxWidth && - node.lastLayout.direction === direction; - - if (skipLayout) { - node.layout.width = node.lastLayout.width; - node.layout.height = node.lastLayout.height; - node.layout.top = node.lastLayout.top; - node.layout.left = node.lastLayout.left; - } else { - if (!node.lastLayout) { - node.lastLayout = {}; - } - - node.lastLayout.requestedWidth = node.layout.width; - node.lastLayout.requestedHeight = node.layout.height; - node.lastLayout.parentMaxWidth = parentMaxWidth; - node.lastLayout.direction = direction; - - // Reset child layouts - node.children.forEach(function(child) { - child.layout.width = undefined; - child.layout.height = undefined; - child.layout.top = 0; - child.layout.left = 0; - }); - - layoutNodeImpl(node, parentMaxWidth, parentDirection); - - node.lastLayout.width = node.layout.width; - node.lastLayout.height = node.layout.height; - node.lastLayout.top = node.layout.top; - node.lastLayout.left = node.layout.left; - } - } - - return { - layoutNodeImpl: layoutNodeImpl, - computeLayout: layoutNode, - fillNodes: fillNodes - }; -})(); - -// This module export is only used for the purposes of unit testing this file. When -// the library is packaged this file is included within css-layout.js which forms -// the public API. -if (true) { - module.exports = computeLayout; -} - - - return function(node) { - /*eslint-disable */ - // disabling ESLint because this code relies on the above include - computeLayout.fillNodes(node); - computeLayout.computeLayout(node); - /*eslint-enable */ - }; -})); - - -/***/ }), -/* 6 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "none", function() { return none; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isClick", function() { return isClick; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCanvas", function() { return createCanvas; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImage", function() { return createImage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDpr", function() { return getDpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STATE", function() { return STATE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repaintChildren", function() { return repaintChildren; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repaintTree", function() { return repaintTree; }); -function throttle(fn, threshhold, scope) { - threshhold || (threshhold = 250); - var last, deferTimer; - return function () { - var context = scope || this; - var now = +new Date(), - args = arguments; - - if (last && now < last + threshhold) { - // hold on to it - clearTimeout(deferTimer); - deferTimer = setTimeout(function () { - last = now; - fn.apply(context, args); - }, threshhold); - } else { - last = now; - fn.apply(context, args); - } - }; -} -/* istanbul ignore next */ - -function none() {} -/** - * 根据触摸时长和触摸位置变化来判断是否属于点击事件 - */ - -function isClick(touchMsg) { - var start = touchMsg.touchstart; - var end = touchMsg.touchend; - - if (!start || !end || !start.timeStamp || !end.timeStamp || start.pageX === undefined || start.pageY === undefined || end.pageX === undefined || end.pageY === undefined) { - return false; - } - - var startPosX = start.pageX; - var startPosY = start.pageY; - var endPosX = end.pageX; - var endPosY = end.pageY; - var touchTimes = end.timeStamp - start.timeStamp; - return !!(Math.abs(endPosY - startPosY) < 30 && Math.abs(endPosX - startPosX) < 30 && touchTimes < 300); -} -function createCanvas() { - /* istanbul ignore if*/ - if (typeof wx !== "undefined") { - return wx.createCanvas(); - } else { - return document.createElement('canvas'); - } -} -function createImage() { - /* istanbul ignore if*/ - if (typeof wx !== "undefined") { - return wx.createImage(); - } else { - return document.createElement('img'); - } -} -function getDpr() { - /* istanbul ignore if*/ - if (typeof wx !== "undefined") { - return wx.getSystemInfoSync().devicePixelRatio; - } else { - return window.devicePixelRatio; - } -} -var STATE = { - "UNINIT": "UNINIT", - "INITED": "INITED", - "RENDERED": "RENDERED", - "CLEAR": "CLEAR" -}; -var repaintChildren = function repaintChildren(children) { - children.forEach(function (child) { - child.repaint(); - repaintChildren(child.children); - }); -}; -var repaintTree = function repaintTree(tree) { - tree.repaint(); - tree.children.forEach(function (child) { - child.repaint(); - repaintTree(child); - }); -}; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var nodeToJson = __webpack_require__(8); - -var xmlToNodeobj = __webpack_require__(10); - -var x2xmlnode = __webpack_require__(10); - -var buildOptions = __webpack_require__(9).buildOptions; - -var validator = __webpack_require__(12); - -exports.parse = function (xmlData, options, validationOption) { - if (validationOption) { - if (validationOption === true) validationOption = {}; - var result = validator.validate(xmlData, validationOption); - - if (result !== true) { - throw Error(result.err.msg); - } - } - - options = buildOptions(options, x2xmlnode.defaultOptions, x2xmlnode.props); - return nodeToJson.convertToJson(xmlToNodeobj.getTraversalObj(xmlData, options), options); -}; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(9); - -var convertToJson = function convertToJson(node, options) { - var jObj = { - name: node.tagname - }; //when no child node or attr is present - - if ((!node.child || util.isEmptyObject(node.child)) && (!node.attrsMap || util.isEmptyObject(node.attrsMap))) { - return util.isExist(node.val) && !!node.val ? node.val : jObj; - } else { - //otherwise create a textnode if node has some text - if (util.isExist(node.val)) { - if (!(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) { - if (options.arrayMode === "strict") { - jObj[options.textNodeName] = [node.val]; - } else { - jObj[options.textNodeName] = node.val; - } - } - } - } - - util.merge(jObj, node.attrsMap, options.arrayMode); - jObj.children = []; - node.children.forEach(function (child) { - jObj.children.push(convertToJson(child, options)); - }); // const keys = Object.keys(node.child); - // for (let index = 0; index < keys.length; index++) { - // var tagname = keys[index]; - // if (node.child[tagname] && node.child[tagname].length > 1) { - // jObj[tagname] = []; - // for (var tag in node.child[tagname]) { - // jObj[tagname].push(convertToJson(node.child[tagname][tag], options)); - // } - // } else { - // if(options.arrayMode === true){ - // const result = convertToJson(node.child[tagname][0], options) - // if(typeof result === 'object') - // jObj[tagname] = [ result ]; - // else - // jObj[tagname] = result; - // }else if(options.arrayMode === "strict"){ - // jObj[tagname] = [convertToJson(node.child[tagname][0], options) ]; - // }else{ - // jObj[tagname] = convertToJson(node.child[tagname][0], options); - // } - // } - // } - //add value - - return jObj; -}; - -exports.convertToJson = convertToJson; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var getAllMatches = function getAllMatches(string, regex) { - var matches = []; - var match = regex.exec(string); - - while (match) { - var allmatches = []; - var len = match.length; - - for (var index = 0; index < len; index++) { - allmatches.push(match[index]); - } - - matches.push(allmatches); - match = regex.exec(string); - } - - return matches; -}; - -var doesMatch = function doesMatch(string, regex) { - var match = regex.exec(string); - return !(match === null || typeof match === 'undefined'); -}; - -var doesNotMatch = function doesNotMatch(string, regex) { - return !doesMatch(string, regex); -}; - -exports.isExist = function (v) { - return typeof v !== 'undefined'; -}; - -exports.isEmptyObject = function (obj) { - return Object.keys(obj).length === 0; -}; -/** - * Copy all the properties of a into b. - * @param {*} target - * @param {*} a - */ - - -exports.merge = function (target, a, arrayMode) { - if (a) { - var keys = Object.keys(a); // will return an array of own properties - - var len = keys.length; //don't make it inline - - for (var i = 0; i < len; i++) { - if (arrayMode === 'strict') { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } - } -}; -/* exports.merge =function (b,a){ - return Object.assign(b,a); -} */ - - -exports.getValue = function (v) { - if (exports.isExist(v)) { - return v; - } else { - return ''; - } -}; // const fakeCall = function(a) {return a;}; -// const fakeCallNoReturn = function() {}; - - -exports.buildOptions = function (options, defaultOptions, props) { - var newOptions = {}; - - if (!options) { - return defaultOptions; //if there are not options - } - - for (var i = 0; i < props.length; i++) { - if (options[props[i]] !== undefined) { - newOptions[props[i]] = options[props[i]]; - } else { - newOptions[props[i]] = defaultOptions[props[i]]; - } - } - - return newOptions; -}; - -exports.doesMatch = doesMatch; -exports.doesNotMatch = doesNotMatch; -exports.getAllMatches = getAllMatches; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(9); - -var buildOptions = __webpack_require__(9).buildOptions; - -var xmlNode = __webpack_require__(11); - -var TagType = { - OPENING: 1, - CLOSING: 2, - SELF: 3, - CDATA: 4 -}; -var regx = '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|(([\\w:\\-._]*:)?([\\w:\\-._]+))([^>]*)>|((\\/)(([\\w:\\-._]*:)?([\\w:\\-._]+))\\s*>))([^<]*)'; //const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g"); -//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g"); -//polyfill - -if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; -} - -if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; -} - -var defaultOptions = { - attributeNamePrefix: '@_', - attrNodeName: false, - textNodeName: '#text', - ignoreAttributes: true, - ignoreNameSpace: false, - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseNodeValue: true, - parseAttributeValue: false, - arrayMode: false, - trimValues: true, - //Trim string values of tag and attributes - cdataTagName: false, - cdataPositionChar: '\\c', - localeRange: '', - tagValueProcessor: function tagValueProcessor(a) { - return a; - }, - attrValueProcessor: function attrValueProcessor(a) { - return a; - }, - stopNodes: [] //decodeStrict: false, - -}; -exports.defaultOptions = defaultOptions; -var props = ['attributeNamePrefix', 'attrNodeName', 'textNodeName', 'ignoreAttributes', 'ignoreNameSpace', 'allowBooleanAttributes', 'parseNodeValue', 'parseAttributeValue', 'arrayMode', 'trimValues', 'cdataTagName', 'cdataPositionChar', 'localeRange', 'tagValueProcessor', 'attrValueProcessor', 'parseTrueNumberOnly', 'stopNodes']; -exports.props = props; - -var getTraversalObj = function getTraversalObj(xmlData, options) { - options = buildOptions(options, defaultOptions, props); //xmlData = xmlData.replace(/\r?\n/g, " ");//make it single line - - xmlData = xmlData.replace(//g, ''); //Remove comments - - var xmlObj = new xmlNode('!xml'); - var currentNode = xmlObj; - regx = regx.replace(/\[\\w/g, '[' + options.localeRange + '\\w'); - var tagsRegx = new RegExp(regx, 'g'); - var tag = tagsRegx.exec(xmlData); - var nextTag = tagsRegx.exec(xmlData); - - while (tag) { - var tagType = checkForTagType(tag); - - if (tagType === TagType.CLOSING) { - //add parsed data to parent node - if (currentNode.parent && tag[14]) { - currentNode.parent.val = util.getValue(currentNode.parent.val) + '' + processTagValue(tag, options, currentNode.parent.tagname); - } - - if (options.stopNodes.length && options.stopNodes.includes(currentNode.tagname)) { - currentNode.child = []; - - if (currentNode.attrsMap == undefined) { - currentNode.attrsMap = {}; - } - - currentNode.val = xmlData.substr(currentNode.startIndex + 1, tag.index - currentNode.startIndex - 1); - } - - currentNode = currentNode.parent; - } else if (tagType === TagType.CDATA) { - if (options.cdataTagName) { - //add cdata node - var childNode = new xmlNode(options.cdataTagName, currentNode, tag[3]); - childNode.attrsMap = buildAttributesMap(tag[8], options); - currentNode.addChild(childNode); //for backtracking - - currentNode.val = util.getValue(currentNode.val) + options.cdataPositionChar; //add rest value to parent node - - if (tag[14]) { - currentNode.val += processTagValue(tag, options); - } - } else { - currentNode.val = (currentNode.val || '') + (tag[3] || '') + processTagValue(tag, options); - } - } else if (tagType === TagType.SELF) { - if (currentNode && tag[14]) { - currentNode.val = util.getValue(currentNode.val) + '' + processTagValue(tag, options); - } - - var _childNode = new xmlNode(options.ignoreNameSpace ? tag[7] : tag[5], currentNode, ''); - - if (tag[8] && tag[8].length > 0) { - tag[8] = tag[8].substr(0, tag[8].length - 1); - } - - _childNode.attrsMap = buildAttributesMap(tag[8], options); - currentNode.addChild(_childNode); - } else { - //TagType.OPENING - var _childNode2 = new xmlNode(options.ignoreNameSpace ? tag[7] : tag[5], currentNode, processTagValue(tag, options)); - - if (options.stopNodes.length && options.stopNodes.includes(_childNode2.tagname)) { - _childNode2.startIndex = tag.index + tag[1].length; - } - - _childNode2.attrsMap = buildAttributesMap(tag[8], options); - currentNode.addChild(_childNode2); - currentNode = _childNode2; - } - - tag = nextTag; - nextTag = tagsRegx.exec(xmlData); - } - - return xmlObj; -}; - -function processTagValue(parsedTags, options, parentTagName) { - var tagName = parsedTags[7] || parentTagName; - var val = parsedTags[14]; - - if (val) { - if (options.trimValues) { - val = val.trim(); - } - - val = options.tagValueProcessor(val, tagName); - val = parseValue(val, options.parseNodeValue, options.parseTrueNumberOnly); - } - - return val; -} - -function checkForTagType(match) { - if (match[4] === ']]>') { - return TagType.CDATA; - } else if (match[10] === '/') { - return TagType.CLOSING; - } else if (typeof match[8] !== 'undefined' && match[8].substr(match[8].length - 1) === '/') { - return TagType.SELF; - } else { - return TagType.OPENING; - } -} - -function resolveNameSpace(tagname, options) { - if (options.ignoreNameSpace) { - var tags = tagname.split(':'); - var prefix = tagname.charAt(0) === '/' ? '/' : ''; - - if (tags[0] === 'xmlns') { - return ''; - } - - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - - return tagname; -} - -function parseValue(val, shouldParse, parseTrueNumberOnly) { - if (shouldParse && typeof val === 'string') { - var parsed; - - if (val.trim() === '' || isNaN(val)) { - parsed = val === 'true' ? true : val === 'false' ? false : val; - } else { - if (val.indexOf('0x') !== -1) { - //support hexa decimal - parsed = Number.parseInt(val, 16); - } else if (val.indexOf('.') !== -1) { - parsed = Number.parseFloat(val); - } else { - parsed = Number.parseInt(val, 10); - } - - if (parseTrueNumberOnly) { - parsed = String(parsed) === val ? parsed : val; - } - } - - return parsed; - } else { - if (util.isExist(val)) { - return val; - } else { - return ''; - } - } -} //TODO: change regex to capture NS -//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm"); - - -var attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])(.*?)\\3)?', 'g'); - -function buildAttributesMap(attrStr, options) { - if (!options.ignoreAttributes && typeof attrStr === 'string') { - attrStr = attrStr.replace(/\r?\n/g, ' '); //attrStr = attrStr || attrStr.trim(); - - var matches = util.getAllMatches(attrStr, attrsRegx); - var len = matches.length; //don't make it inline - - var attrs = {}; - - for (var i = 0; i < len; i++) { - var attrName = resolveNameSpace(matches[i][1], options); - - if (attrName.length) { - if (matches[i][4] !== undefined) { - if (options.trimValues) { - matches[i][4] = matches[i][4].trim(); - } - - matches[i][4] = options.attrValueProcessor(matches[i][4], attrName); - attrs[options.attributeNamePrefix + attrName] = parseValue(matches[i][4], options.parseAttributeValue, options.parseTrueNumberOnly); - } else if (options.allowBooleanAttributes) { - attrs[options.attributeNamePrefix + attrName] = true; - } - } - } - - if (!Object.keys(attrs).length) { - return; - } - - if (options.attrNodeName) { - var attrCollection = {}; - attrCollection[options.attrNodeName] = attrs; - return attrCollection; - } - - return attrs; - } -} - -exports.getTraversalObj = getTraversalObj; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function (tagname, parent, val) { - this.tagname = tagname; - this.parent = parent; - this.child = {}; //child tags - - this.attrsMap = {}; //attributes map - - this.children = []; - this.val = val; //text only - - this.addChild = function (child) { - this.children.push(child); - - if (Array.isArray(this.child[child.tagname])) { - //already presents - this.child[child.tagname].push(child); - } else { - this.child[child.tagname] = [child]; - } - }; -}; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(9); - -var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - localeRange: 'a-zA-Z' -}; -var props = ['allowBooleanAttributes', 'localeRange']; //const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g"); - -exports.validate = function (xmlData, options) { - options = util.buildOptions(options, defaultOptions, props); //xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line - //xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag - //xmlData = xmlData.replace(/()/g,"");//Remove DOCTYPE - - var tags = []; - var tagFound = false; - - if (xmlData[0] === "\uFEFF") { - // check for byte order mark (BOM) - xmlData = xmlData.substr(1); - } - - var regxAttrName = new RegExp('^[_w][\\w\\-.:]*$'.replace('_w', '_' + options.localeRange)); - var regxTagName = new RegExp('^([w]|_)[\\w.\\-_:]*'.replace('([w', '([' + options.localeRange)); - - for (var i = 0; i < xmlData.length; i++) { - if (xmlData[i] === '<') { - //starting of tag - //read until you reach to '>' avoiding any '>' in attribute value - i++; - - if (xmlData[i] === '?') { - i = readPI(xmlData, ++i); - - if (i.err) { - return i; - } - } else if (xmlData[i] === '!') { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - var closingTag = false; - - if (xmlData[i] === '/') { - //closing tag - closingTag = true; - i++; - } //read tagname - - - var tagName = ''; - - for (; i < xmlData.length && xmlData[i] !== '>' && xmlData[i] !== ' ' && xmlData[i] !== '\t' && xmlData[i] !== '\n' && xmlData[i] !== '\r'; i++) { - tagName += xmlData[i]; - } - - tagName = tagName.trim(); //console.log(tagName); - - if (tagName[tagName.length - 1] === '/') { - //self closing tag without attributes - tagName = tagName.substring(0, tagName.length - 1); - continue; - } - - if (!validateTagName(tagName, regxTagName)) { - return { - err: { - code: 'InvalidTag', - msg: 'Tag ' + tagName + ' is an invalid name.' - } - }; - } - - var result = readAttributeStr(xmlData, i); - - if (result === false) { - return { - err: { - code: 'InvalidAttr', - msg: 'Attributes for "' + tagName + '" have open quote.' - } - }; - } - - var attrStr = result.value; - i = result.index; - - if (attrStr[attrStr.length - 1] === '/') { - //self closing tag - attrStr = attrStr.substring(0, attrStr.length - 1); - var isValid = validateAttributeString(attrStr, options, regxAttrName); - - if (isValid === true) { - tagFound = true; //continue; //text may presents after self closing tag - } else { - return isValid; - } - } else if (closingTag) { - if (!result.tagClosed) { - return { - err: { - code: 'InvalidTag', - msg: 'closing tag "' + tagName + "\" don't have proper closing." - } - }; - } else if (attrStr.trim().length > 0) { - return { - err: { - code: 'InvalidTag', - msg: 'closing tag "' + tagName + "\" can't have attributes or invalid starting." - } - }; - } else { - var otg = tags.pop(); - - if (tagName !== otg) { - return { - err: { - code: 'InvalidTag', - msg: 'closing tag ' + otg + ' is expected inplace of ' + tagName + '.' - } - }; - } - } - } else { - var _isValid = validateAttributeString(attrStr, options, regxAttrName); - - if (_isValid !== true) { - return _isValid; - } - - tags.push(tagName); - tagFound = true; - } //skip tag text value - //It may include comments and CDATA value - - - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === '<') { - if (xmlData[i + 1] === '!') { - //comment or CADATA - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - break; - } - } - } //end of reading tag text value - - - if (xmlData[i] === '<') { - i--; - } - } - } else { - if (xmlData[i] === ' ' || xmlData[i] === '\t' || xmlData[i] === '\n' || xmlData[i] === '\r') { - continue; - } - - return { - err: { - code: 'InvalidChar', - msg: 'char ' + xmlData[i] + ' is not expected .' - } - }; - } - } - - if (!tagFound) { - return { - err: { - code: 'InvalidXml', - msg: 'Start tag expected.' - } - }; - } else if (tags.length > 0) { - return { - err: { - code: 'InvalidXml', - msg: 'Invalid ' + JSON.stringify(tags, null, 4).replace(/\r?\n/g, '') + ' found.' - } - }; - } - - return true; -}; -/** - * Read Processing insstructions and skip - * @param {*} xmlData - * @param {*} i - */ - - -function readPI(xmlData, i) { - var start = i; - - for (; i < xmlData.length; i++) { - if (xmlData[i] == '?' || xmlData[i] == ' ') { - //tagname - var tagname = xmlData.substr(start, i - start); - - if (i > 5 && tagname === 'xml') { - return { - err: { - code: 'InvalidXml', - msg: 'XML declaration allowed only at the start of the document.' - } - }; - } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') { - //check if valid attribut string - i++; - break; - } else { - continue; - } - } - } - - return i; -} - -function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') { - //comment - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === 'D' && xmlData[i + 2] === 'O' && xmlData[i + 3] === 'C' && xmlData[i + 4] === 'T' && xmlData[i + 5] === 'Y' && xmlData[i + 6] === 'P' && xmlData[i + 7] === 'E') { - var angleBracketsCount = 1; - - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === '<') { - angleBracketsCount++; - } else if (xmlData[i] === '>') { - angleBracketsCount--; - - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === '[' && xmlData[i + 2] === 'C' && xmlData[i + 3] === 'D' && xmlData[i + 4] === 'A' && xmlData[i + 5] === 'T' && xmlData[i + 6] === 'A' && xmlData[i + 7] === '[') { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') { - i += 2; - break; - } - } - } - - return i; -} - -var doubleQuote = '"'; -var singleQuote = "'"; -/** - * Keep reading xmlData until '<' is found outside the attribute value. - * @param {string} xmlData - * @param {number} i - */ - -function readAttributeStr(xmlData, i) { - var attrStr = ''; - var startChar = ''; - var tagClosed = false; - - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === '') { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa - continue; - } else { - startChar = ''; - } - } else if (xmlData[i] === '>') { - if (startChar === '') { - tagClosed = true; - break; - } - } - - attrStr += xmlData[i]; - } - - if (startChar !== '') { - return false; - } - - return { - value: attrStr, - index: i, - tagClosed: tagClosed - }; -} -/** - * Select all the attributes whether valid or invalid. - */ - - -var validAttrStrRegxp = new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?', 'g'); //attr, ="sd", a="amit's", a="sd"b="saf", ab cd="" - -function validateAttributeString(attrStr, options, regxAttrName) { - //console.log("start:"+attrStr+":end"); - //if(attrStr.trim().length === 0) return true; //empty string - var matches = util.getAllMatches(attrStr, validAttrStrRegxp); - var attrNames = {}; - - for (var i = 0; i < matches.length; i++) { - //console.log(matches[i]); - if (matches[i][1].length === 0) { - //nospace before attribute name: a="sd"b="saf" - return { - err: { - code: 'InvalidAttr', - msg: 'attribute ' + matches[i][2] + ' has no space in starting.' - } - }; - } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) { - //independent attribute: ab - return { - err: { - code: 'InvalidAttr', - msg: 'boolean attribute ' + matches[i][2] + ' is not allowed.' - } - }; - } - /* else if(matches[i][6] === undefined){//attribute without value: ab= - return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}}; - } */ - - - var attrName = matches[i][2]; - - if (!validateAttrName(attrName, regxAttrName)) { - return { - err: { - code: 'InvalidAttr', - msg: 'attribute ' + attrName + ' is an invalid name.' - } - }; - } - /*if (!attrNames.hasOwnProperty(attrName)) {*/ - - - if (!Object.prototype.hasOwnProperty.call(attrNames, attrName)) { - //check for duplicate attribute. - attrNames[attrName] = 1; - } else { - return { - err: { - code: 'InvalidAttr', - msg: 'attribute ' + attrName + ' is repeated.' - } - }; - } - } - - return true; -} // const validAttrRegxp = /^[_a-zA-Z][\w\-.:]*$/; - - -function validateAttrName(attrName, regxAttrName) { - // const validAttrRegxp = new RegExp(regxAttrName); - return util.doesMatch(attrName, regxAttrName); -} //const startsWithXML = new RegExp("^[Xx][Mm][Ll]"); -// startsWith = /^([a-zA-Z]|_)[\w.\-_:]*/; - - -function validateTagName(tagname, regxTagName) { - /*if(util.doesMatch(tagname,startsWithXML)) return false; - else*/ - return !util.doesNotMatch(tagname, regxTagName); -} - -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BitMapFont; }); -/* harmony import */ var _imageManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _pool__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - -var bitMapPool = new _pool__WEBPACK_IMPORTED_MODULE_1__["default"]('bitMapPool'); - -var Emitter = __webpack_require__(3); -/** - * http://www.angelcode.com/products/bmfont/doc/file_format.html - */ - - -var BitMapFont = /*#__PURE__*/function () { - function BitMapFont(name, src, config) { - var _this = this; - - _classCallCheck(this, BitMapFont); - - var cache = bitMapPool.get(name); - - if (cache) { - return cache; - } - - this.config = config; - this.chars = this.parseConfig(config); - this.ready = false; - this.event = new Emitter(); - this.texture = _imageManager__WEBPACK_IMPORTED_MODULE_0__["default"].loadImage(src, function (texture, fromCache) { - if (fromCache) { - _this.texture = texture; - } - - _this.ready = true; - - _this.event.emit('text__load__done'); - }); - bitMapPool.set(name, this); - } - - _createClass(BitMapFont, [{ - key: "parseConfig", - value: function parseConfig(fntText) { - fntText = fntText.split("\r\n").join("\n"); - var lines = fntText.split("\n"); - var charsCount = this.getConfigByKey(lines[3], "count"); - this.lineHeight = this.getConfigByKey(lines[1], 'lineHeight'); - this.fontSize = this.getConfigByKey(lines[0], 'size'); - var chars = {}; - - for (var i = 4; i < 4 + charsCount; i++) { - var charText = lines[i]; - var letter = String.fromCharCode(this.getConfigByKey(charText, "id")); - var c = {}; - chars[letter] = c; - c["x"] = this.getConfigByKey(charText, "x"); - c["y"] = this.getConfigByKey(charText, "y"); - c["w"] = this.getConfigByKey(charText, "width"); - c["h"] = this.getConfigByKey(charText, "height"); - c["offX"] = this.getConfigByKey(charText, "xoffset"); - c["offY"] = this.getConfigByKey(charText, "yoffset"); - c["xadvance"] = this.getConfigByKey(charText, "xadvance"); - } - - return chars; - } - }, { - key: "getConfigByKey", - value: function getConfigByKey(configText, key) { - var itemConfigTextList = configText.split(" "); - - for (var i = 0, length = itemConfigTextList.length; i < length; i++) { - var itemConfigText = itemConfigTextList[i]; - - if (key === itemConfigText.substring(0, key.length)) { - var value = itemConfigText.substring(key.length + 1); - return parseInt(value); - } - } - - return 0; - } - }]); - - return BitMapFont; -}(); - - - -/***/ }), -/* 14 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _pool__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - -var imgPool = new _pool__WEBPACK_IMPORTED_MODULE_0__["default"]('imgPool'); - -var ImageManager = /*#__PURE__*/function () { - function ImageManager() { - _classCallCheck(this, ImageManager); - } - - _createClass(ImageManager, [{ - key: "getRes", - value: function getRes(src) { - return imgPool.get(src); - } - }, { - key: "loadImage", - value: function loadImage(src) { - var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _util__WEBPACK_IMPORTED_MODULE_1__["none"]; - var img = null; - var cache = this.getRes(src); - - if (!src) { - return img; - } // 图片已经被加载过,直接返回图片并且执行回调 - - - if (cache && cache.loadDone) { - img = cache; - callback(img, true); - } else if (cache && !cache.loadDone) { - // 图片正在加载过程中,返回图片并且等待图片加载完成执行回调 - img = cache; - cache.onloadcbks.push(callback); - } else { - // 创建图片,将回调函数推入回调函数栈 - img = Object(_util__WEBPACK_IMPORTED_MODULE_1__["createImage"])(); - img.onloadcbks = [callback]; - imgPool.set(src, img); - - img.onload = function () { - img.onloadcbks.forEach(function (fn) { - return fn(img, false); - }); - img.onloadcbks = []; - img.loadDone = true; - }; - - img.onerror = function (e) { - console.log('img load error', e); - }; - - img.src = src; - } - - return img; - } - }]); - - return ImageManager; -}(); - -/* harmony default export */ __webpack_exports__["default"] = (new ImageManager()); - -/***/ }), -/* 15 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _view_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "View", function() { return _view_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); - -/* harmony import */ var _image_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Image", function() { return _image_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); - -/* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Text", function() { return _text_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); - -/* harmony import */ var _scrollview_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScrollView", function() { return _scrollview_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); - -/* harmony import */ var _bitmaptext_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BitMapText", function() { return _bitmaptext_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); - - - - - - - - -/***/ }), -/* 16 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; }); -/* harmony import */ var _elements_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - -var View = /*#__PURE__*/function (_Element) { - _inherits(View, _Element); - - var _super = _createSuper(View); - - function View(_ref) { - var _this; - - var _ref$style = _ref.style, - style = _ref$style === void 0 ? {} : _ref$style, - _ref$props = _ref.props, - props = _ref$props === void 0 ? {} : _ref$props, - _ref$idName = _ref.idName, - idName = _ref$idName === void 0 ? '' : _ref$idName, - _ref$className = _ref.className, - className = _ref$className === void 0 ? '' : _ref$className; - - _classCallCheck(this, View); - - _this = _super.call(this, { - props: props, - idName: idName, - className: className, - style: style - }); - _this.type = 'View'; - _this.ctx = null; - _this.renderBoxes = []; - return _this; - } - - _createClass(View, [{ - key: "destroySelf", - value: function destroySelf() { - this.isDestroyed = true; - this.children = null; - this.root = null; - } // 有些节点仅仅作为容器,实际上不需要任何渲染逻辑,这里加个判断可以提高性能 - - }, { - key: "checkNeedRender", - value: function checkNeedRender() { - var style = this.style || {}; - var borderColor = style.borderColor; - return !!(style.backgroundColor || style.borderWidth && borderColor || style.borderTopWidth && (borderColor || style.borderTopColor) || style.borderBottomWidth && (borderColor || style.borderBottomColor) || style.borderLeftWidth && (borderColor || style.borderLeftColor) || style.borderRightWidth && (borderColor || style.borderRightColor)); - } - }, { - key: "render", - value: function render(ctx, layoutBox) { - var style = this.style || {}; - var box = layoutBox || this.layoutBox; - ctx.save(); - var borderWidth = style.borderWidth || 0; - var drawX = box.absoluteX; - var drawY = box.absoluteY; - var borderLeftWidth = style.borderLeftWidth || borderWidth; - var borderRightWidth = style.borderRightWidth || borderWidth; - var borderTopWidth = style.borderTopWidth || borderWidth; - var borderBottomWidth = style.borderBottomWidth || borderWidth; - this.renderBorder(ctx, layoutBox); - - if (style.backgroundColor) { - ctx.fillStyle = style.backgroundColor; - ctx.fillRect(drawX + borderLeftWidth, drawY + borderRightWidth, box.width - (borderLeftWidth + borderRightWidth), box.height - (borderTopWidth + borderBottomWidth)); - } - - ctx.restore(); - } - }, { - key: "insert", - value: function insert(ctx, box) { - this.ctx = ctx; - - if (!box) { - box = this.layoutBox; - } - - this.renderBoxes.push({ - ctx: ctx, - box: box - }); - this.render(ctx, box); - } - }, { - key: "repaint", - value: function repaint() { - var _this2 = this; - - this.renderBoxes.forEach(function (item) { - _this2.render(item.ctx, item.box); - }); - } - }]); - - return View; -}(_elements_js__WEBPACK_IMPORTED_MODULE_0__["default"]); - - - -/***/ }), -/* 17 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Image; }); -/* harmony import */ var _elements_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _common_imageManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - - -var Image = /*#__PURE__*/function (_Element) { - _inherits(Image, _Element); - - var _super = _createSuper(Image); - - function Image(opts) { - var _this; - - _classCallCheck(this, Image); - - var _opts$style = opts.style, - style = _opts$style === void 0 ? {} : _opts$style, - _opts$props = opts.props, - props = _opts$props === void 0 ? {} : _opts$props, - _opts$idName = opts.idName, - idName = _opts$idName === void 0 ? '' : _opts$idName, - _opts$className = opts.className, - className = _opts$className === void 0 ? '' : _opts$className, - _opts$src = opts.src, - src = _opts$src === void 0 ? '' : _opts$src; - _this = _super.call(this, { - props: props, - idName: idName, - className: className, - style: style - }); - _this.imgsrc = src; - Object.defineProperty(_assertThisInitialized(_this), "src", { - get: function get() { - return this.imgsrc; - }, - set: function set(newValue) { - var _this2 = this; - - if (newValue !== this.imgsrc) { - this.imgsrc = newValue; - _common_imageManager__WEBPACK_IMPORTED_MODULE_1__["default"].loadImage(this.src, function (img) { - _this2.img = img; - /*this.repaint();*/ - - _this2.emit('repaint'); - }); - } - }, - enumerable: true, - configurable: true - }); - _this.type = 'Image'; - _this.renderBoxes = []; - return _this; - } - - _createClass(Image, [{ - key: "repaint", - value: function repaint() { - var _this3 = this; - - this.renderBoxes.forEach(function (item) { - _this3.renderImg(item.ctx, item.box, false); - }); - } // 子类填充实现 - - }, { - key: "destroySelf", - value: function destroySelf() { - this.isDestroyed = true; - this.img = null; - delete this.src; - this.root = null; - } - }, { - key: "renderImg", - value: function renderImg(ctx, layoutBox) { - var needEmitEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - - if (!this.img) { - return; - } - - var style = this.style || {}; - var box = layoutBox || this.layoutBox; - ctx.save(); - - if (style.borderColor) { - ctx.strokeStyle = style.borderColor; - } - - ctx.lineWidth = style.borderWidth || 0; - var drawX = box.absoluteX; - var drawY = box.absoluteY; - this.renderBorder(ctx, layoutBox); - ctx.drawImage(this.img, drawX, drawY, box.width, box.height); - ctx.restore(); - } - }, { - key: "insert", - value: function insert(ctx, box) { - var _this4 = this; - - this.renderBoxes.push({ - ctx: ctx, - box: box - }); - this.img = _common_imageManager__WEBPACK_IMPORTED_MODULE_1__["default"].loadImage(this.src, function (img, fromCache) { - // 来自缓存的,还没返回img就会执行回调函数 - if (fromCache) { - _this4.img = img; - - _this4.renderImg(ctx, box, false); - } else { - // 当图片加载完成,实例可能已经被销毁了 - if (_this4.img) { - var eventName = _this4.isScrollViewChild ? 'image__render__done' : 'one__image__render__done'; - - _this4.EE.emit(eventName, _this4); - } - } - }); - } - }, { - key: "isScrollViewChild", - get: function get() { - var flag = false; - var parent = this.parent; - - while (parent && !flag) { - if (parent.type === 'ScrollView') { - flag = true; - } else { - parent = parent.parent; - } - } - - return flag; - } - }]); - - return Image; -}(_elements_js__WEBPACK_IMPORTED_MODULE_0__["default"]); - - - -/***/ }), -/* 18 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; }); -/* harmony import */ var _elements_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _common_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - -var DEFAULT_FONT_FAMILY = 'PingFangSC-Regular, sans-serif'; -var context = null; - -var getContext = function getContext() { - if (context) { - return context; - } - - var canvas = Object(_common_util_js__WEBPACK_IMPORTED_MODULE_1__["createCanvas"])(); - canvas.width = 1; - canvas.height = 1; - context = canvas.getContext('2d'); - return context; -}; - -function getTextWidth(style, value) { - var context = getContext(); - context.font = "".concat(style.fontWeight || 'normal', " ").concat(style.fontSize || 12, "px ").concat(style.fontFamily || DEFAULT_FONT_FAMILY); - return context.measureText(value).width || 0; -} - -function getTextWidthWithoutSetFont(value) { - return getContext().measureText(value).width || 0; -} - -function parseText(style, value) { - value = String(value); - var maxWidth = style.width; - var wordWidth = getTextWidth(style, value); // 对文字溢出的处理,默认用... - - var textOverflow = style.textOverflow || 'ellipsis'; // 文字最大长度不超限制 - - if (wordWidth <= maxWidth) { - return value; - } // 对于用点点点处理的情况,先将最大宽度减去...的宽度 - - - if (textOverflow === 'ellipsis') { - maxWidth -= getTextWidthWithoutSetFont('...'); - } - - var length = value.length - 1; - var str = value.substring(0, length); - - while (getTextWidthWithoutSetFont(str) > maxWidth && length > 0) { - length--; - str = value.substring(0, length); - } - - return length && textOverflow === 'ellipsis' ? str + '...' : str; -} - -var Text = /*#__PURE__*/function (_Element) { - _inherits(Text, _Element); - - var _super = _createSuper(Text); - - function Text(_ref) { - var _this; - - var _ref$style = _ref.style, - style = _ref$style === void 0 ? {} : _ref$style, - _ref$props = _ref.props, - props = _ref$props === void 0 ? {} : _ref$props, - _ref$idName = _ref.idName, - idName = _ref$idName === void 0 ? '' : _ref$idName, - _ref$className = _ref.className, - className = _ref$className === void 0 ? '' : _ref$className, - _ref$value = _ref.value, - value = _ref$value === void 0 ? '' : _ref$value; - - _classCallCheck(this, Text); - - // 没有设置宽度的时候通过canvas计算出文字宽度 - if (style.width === undefined) { - style.width = getTextWidth(style, value); - } else if (style.textOverflow === 'ellipsis') { - value = parseText(style, value); - } - - _this = _super.call(this, { - props: props, - idName: idName, - className: className, - style: style - }); - _this.type = 'Text'; - _this.ctx = null; - _this.valuesrc = value; - _this.renderBoxes = []; - Object.defineProperty(_assertThisInitialized(_this), "value", { - get: function get() { - return this.valuesrc; - }, - set: function set(newValue) { - if (newValue !== this.valuesrc) { - this.valuesrc = newValue; - this.emit('repaint'); - } - }, - enumerable: true, - configurable: true - }); - return _this; - } - - _createClass(Text, [{ - key: "toCanvasData", - value: function toCanvasData() { - var style = this.style || {}; - this.fontSize = style.fontSize || 12; - this.textBaseline = 'top'; - this.font = "".concat(style.fontWeight || '', " ").concat(style.fontSize || 12, "px ").concat(DEFAULT_FONT_FAMILY); - this.textAlign = style.textAlign || 'left'; - this.fillStyle = style.color || '#000'; - } - }, { - key: "insert", - value: function insert(ctx, box) { - this.renderBoxes.push({ - ctx: ctx, - box: box - }); - this.render(ctx, box); - } - }, { - key: "repaint", - value: function repaint() { - var _this2 = this; - - this.renderBoxes.forEach(function (item) { - _this2.render(item.ctx, item.box); - }); - } - }, { - key: "destroySelf", - value: function destroySelf() { - this.root = null; - } - }, { - key: "render", - value: function render(ctx, layoutBox) { - this.toCanvasData(); - ctx.save(); - var box = layoutBox || this.layoutBox; - var style = this.style; - ctx.textBaseline = this.textBaseline; - ctx.font = this.font; - ctx.textAlign = this.textAlign; - var drawX = box.absoluteX; - var drawY = box.absoluteY; - this.renderBorder(ctx, layoutBox); - - if (style.backgroundColor) { - ctx.fillStyle = style.backgroundColor; - ctx.fillRect(drawX, drawY, box.width, box.height); - } - - ctx.fillStyle = this.fillStyle; - - if (this.textAlign === 'center') { - drawX += box.width / 2; - } else if (this.textAlign === 'right') { - drawX += box.width; - } - - if (style.lineHeight) { - ctx.textBaseline = 'middle'; - drawY += style.lineHeight / 2; - } - - ctx.fillText(this.value, drawX, drawY); - ctx.restore(); - } - }]); - - return Text; -}(_elements_js__WEBPACK_IMPORTED_MODULE_0__["default"]); - - - -/***/ }), -/* 19 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ScrollView; }); -/* harmony import */ var _view_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); -/* harmony import */ var _common_pool_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); -/* harmony import */ var _common_touch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); -/* harmony import */ var _common_util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - - - -var id = 0; -var canvasPool = new _common_pool_js__WEBPACK_IMPORTED_MODULE_1__["default"]('canvasPool'); - -var ScrollView = /*#__PURE__*/function (_View) { - _inherits(ScrollView, _View); - - var _super = _createSuper(ScrollView); - - function ScrollView(_ref) { - var _this; - - var _ref$style = _ref.style, - style = _ref$style === void 0 ? {} : _ref$style, - _ref$props = _ref.props, - props = _ref$props === void 0 ? {} : _ref$props, - _ref$name = _ref.name, - name = _ref$name === void 0 ? '' : _ref$name; - - _classCallCheck(this, ScrollView); - - _this = _super.call(this, { - props: props, - name: name, - style: style - }); - _this.type = 'ScrollView'; // 当前列表滚动的值 - - _this.top = 0; // 滚动处理器 - - _this.touch = new _common_touch_js__WEBPACK_IMPORTED_MODULE_2__["default"](); // canvas高度不能过高,在小游戏里面,对canvas尺寸是有限制的 - - _this.pageHeight = 2000; // 根据列表总高度和单页高度计算的分页数量 - - _this.pageCount = 1; - _this.canvasMap = {}; // 图片加载完成之后会触发scrollView的重绘函数,当图片过多的时候用节流提升性能 - - _this.throttleRepaint = Object(_common_util_js__WEBPACK_IMPORTED_MODULE_3__["throttle"])(_this.clipRepaint, 16, _assertThisInitialized(_this)); - _this.throttleImageLoadDone = Object(_common_util_js__WEBPACK_IMPORTED_MODULE_3__["throttle"])(_this.childImageLoadDoneCbk, 32, _assertThisInitialized(_this)); - _this.renderTimers = []; - _this.requestID = null; - return _this; - } - /** - * 获取滚动列表内所有元素的高度和 - * 这里不能简单将所有子元素的高度累加,因为每个元素之间可能是有空隙的 - */ - - - _createClass(ScrollView, [{ - key: "repaint", - value: function repaint() { - var _this2 = this; - - this.clear(); - this.renderBoxes.forEach(function (item) { - _this2.render(item.ctx, item.box); - }); - } - /** - * 列表子元素重绘之前先将所有的canvas擦除 - */ - - }, { - key: "clear", - value: function clear() { - var _this3 = this; - - Object.keys(this.canvasMap).forEach(function (key) { - var item = _this3.canvasMap[key]; - item.context && item.context.clearRect(0, 0, item.canvas.width, item.canvas.height); - }); - } // 与主canvas的尺寸保持一致 - - }, { - key: "updateRenderPort", - value: function updateRenderPort(renderport) { - this.renderport = renderport; - } - /** - * 计算分页数据 - * 小游戏的canvas对尺寸有要求,如果如果高度过高,可能出现渲染不出来的情况 - * 因此需要手动分页,列表过长的时候将数据绘制到几个canvas上面,这里预创建几个canvas - */ - - }, { - key: "calPageData", - value: function calPageData() { - this.pageCount = Math.ceil((this.scrollHeight + this.layoutBox.absoluteY) / this.pageHeight); - - for (var i = 0; i < this.pageCount; i++) { - var cache = canvasPool.get(i); - - if (cache) { - cache.context && cache.context.clearRect(0, 0, cache.canvas.width, cache.canvas.height); - cache.elements = []; - this.canvasMap[i] = cache; - } else { - this.canvasMap[i] = { - elements: [] - }; - canvasPool.set(i, this.canvasMap[i]); - } - } - } - }, { - key: "destroySelf", - value: function destroySelf() { - this.touch = null; - this.isDestroyed = true; - this.throttleRepaint = null; - this.renderTimers.forEach(function (timer) { - clearTimeout(timer); - }); - this.root.off('repaint__done'); - this.renderTimers = []; - this.canvasMap = {}; - this.ctx = null; - this.children = null; - this.requestID && cancelAnimationFrame(this.requestID); - this.root = null; - } - /** - * 滚动列表重绘逻辑 - * 将分页canvas按照滚动裁剪绘制到主canvas上面 - */ - - }, { - key: "clipRepaint", - value: function clipRepaint(top) { - var _this4 = this; - - if (this.isDestroyed) { - return; - } - - this.requestID = requestAnimationFrame(function () { - top = -top; - _this4.top = top; - var box = _this4.layoutBox; - var abY = box.absoluteY; - - if (_this4.isDestroyed || _this4.root.state === _common_util_js__WEBPACK_IMPORTED_MODULE_3__["STATE"].CLEAR) { - return; - } // 在主canvas上面将滚动列表区域擦除 - - - _this4.ctx.clearRect(box.absoluteX, abY, box.width, box.height); // 背景填充 - - - _this4.ctx.fillStyle = _this4.parent.style.backgroundColor || '#ffffff'; - - _this4.ctx.fillRect(box.absoluteX, abY, box.width, box.height); - - for (var i = 0; i < _this4.pageCount; i++) { - var canvas = _this4.canvasMap[i].canvas; // 根据滚动值获取裁剪区域 - - var startY = abY + top; - var endY = abY + top + box.height; // 计算在裁剪区域内的canvas - - if (startY < _this4.pageHeight * (i + 1) && endY > _this4.pageHeight * i) { - /** - * 这里不能按照box.width * box.height的区域去裁剪 - * 在浏览器里面正常,但是在小游戏里面会出现诡异的渲染出错,所以裁剪canvas真实有效的区域 - */ - var clipY = abY + top - _this4.pageHeight * i; - var clipH = box.height; - var renderY = abY; - - if (clipY > 0 && _this4.pageHeight - clipY < box.height) { - clipH = _this4.pageHeight - clipY; - } else if (clipY < 0) { - clipH = clipY + box.height; - renderY = renderY - clipY; - clipY = 0; - } - - _this4.ctx.drawImage(canvas, box.absoluteX, clipY, box.width, clipH, box.absoluteX, renderY, box.width, clipH); - } - } - }); - } - }, { - key: "renderChildren", - value: function renderChildren(tree) { - var _this5 = this; - - var children = tree.children; - var height = this.pageHeight; - Object.keys(children).forEach(function (id) { - var child = children[id]; - var originY = child.layoutBox.originalAbsoluteY; - var pageIndex = Math.floor(originY / height); - var nextPage = pageIndex + 1; - child.layoutBox.absoluteY -= _this5.pageHeight * pageIndex; - - if (child.checkNeedRender()) { - _this5.canvasMap[pageIndex].elements.push({ - element: child, - box: child.layoutBox - }); - } // 对于跨界的元素,两边都绘制下 - - - if (originY + child.layoutBox.height > height * nextPage) { - var tmpBox = Object.assign({}, child.layoutBox); - tmpBox.absoluteY = originY - _this5.pageHeight * nextPage; - - if (child.checkNeedRender()) { - _this5.canvasMap[nextPage].elements.push({ - element: child, - box: tmpBox - }); - } - } - - _this5.renderChildren(child); - }); - } - }, { - key: "insertElements", - value: function insertElements(pageIndex) { - var _this6 = this; - - var can = Object(_common_util_js__WEBPACK_IMPORTED_MODULE_3__["createCanvas"])(); - var ctx = can.getContext('2d'); - can.width = this.renderport.width; - can.height = this.pageHeight; - ctx.id = ++id; - this.canvasMap[pageIndex].canvas = can; - this.canvasMap[pageIndex].context = ctx; - this.canvasMap[pageIndex].elements.forEach(function (ele) { - ele.element.insert(ctx, ele.box); - }); - - if (pageIndex < this.pageCount - 1) { - var timer = setTimeout(function () { - _this6.insertElements(++pageIndex); - }, 250); - this.renderTimers.push(timer); - } - } - }, { - key: "childImageLoadDoneCbk", - value: function childImageLoadDoneCbk(img) { - var start = new Date(); - var list = Object.values(this.canvasMap); - var pageIndex = -1; - - for (var i = 0; i < list.length; i++) { - if (list[i].elements.find(function (item) { - return item.element === img; - })) { - pageIndex = i; - break; - } - } - - if (pageIndex > -1) { - var _start = new Date(); - - var canItem = this.canvasMap[pageIndex]; - var canvas = canItem.canvas; - var ctx = canItem.context; - ctx.clearRect(0, 0, canvas.width, canvas.height); - this.canvasMap[pageIndex].elements.forEach(function (ele) { - Object(_common_util_js__WEBPACK_IMPORTED_MODULE_3__["repaintTree"])(ele.element); - }); - } - /*this.throttleRepaint(-this.top || 0);*/ - - - this.clipRepaint(-this.top); - } - }, { - key: "insertScrollView", - value: function insertScrollView(context) { - var _this7 = this; - - // 绘制容器 - this.insert(context); - this.root.on('repaint__done', function () { - _this7.clipRepaint(-_this7.top); - }); // 计算列表应该分割成几页 - - this.calPageData(); // 计算分页数据:每个元素应该坐落在哪个canvas - - this.renderChildren(this); - this.insertElements(0); - this.clipRepaint(-this.top); // 图片加载可能是异步的,监听图片加载完成事件完成列表重绘逻辑 - - this.EE.on('image__render__done', function (img) { - _this7.throttleImageLoadDone(img); - }); - - if (this.scrollHeight > this.layoutBox.height) { - this.touch.setTouchRange(-(this.scrollHeight - this.layoutBox.height), 0, this.clipRepaint.bind(this)); // 监听触摸相关事件,将滚动处理逻辑交给相应的处理器处理 - - this.on('touchstart', this.touch.startFunc); - this.on('touchmove', this.touch.moveFunc); - this.on('touchend', this.touch.endFunc); - } - } - }, { - key: "scrollHeight", - get: function get() { - // scrollview为空的情况 - if (!this.children.length) { - return 0; - } - - var last = this.children[this.children.length - 1]; - return last.layoutBox.top + last.layoutBox.height; - } - }]); - - return ScrollView; -}(_view_js__WEBPACK_IMPORTED_MODULE_0__["default"]); - - - -/***/ }), -/* 20 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Touch; }); -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - -var dpr = Object(_util_js__WEBPACK_IMPORTED_MODULE_0__["getDpr"])(); - -var Touch = /*#__PURE__*/function () { - function Touch() { - _classCallCheck(this, Touch); - - this.needProcess = false; - this.startFunc = this.touchStartHandler.bind(this); - this.endFunc = this.touchEndHandler.bind(this); - this.moveFunc = this.touchMoveHandler.bind(this); - } - - _createClass(Touch, [{ - key: "reset", - value: function reset() { - this.touchTime = new Date(); - this.touchStartX = 0; - this.touchStartY = 0; // 滚动区间 - - this.start = 0; - this.end = 0; // 当前位置 - - this.move = 0; // 目标位置 - - this.target = 0; // 滚动回调函数 - - this.scroll = null; // for istanbul - - /* istanbul ignore if*/ - - if (typeof cancelAnimationFrame !== 'undefined') { - cancelAnimationFrame(this.animate); - } - } - }, { - key: "enable", - value: function enable() { - this.reset(); - this.needProcess = true; - } - }, { - key: "disable", - value: function disable() { - this.needProcess = false; - } // 设置滚动区间,比如一个排行榜的滚动区间可能是[-300, 0] - - }, { - key: "setTouchRange", - value: function setTouchRange(start, end, scroll) { - // 考虑到切换游戏的场景,每次设置的时候重置所有变量 - this.enable(); - this.start = start; - this.end = end; - - if (start === 0 && end === 0) { - return; - } - - this.scroll = scroll; // this.animate = requestAnimationFrame(this.loop.bind(this)); - } // 保证滚动目标位置在滚动区间内 - - }, { - key: "limitTarget", - value: function limitTarget(target) { - var result = target; - - if (target > this.end) { - result = this.end; - } else if (target < this.start) { - result = this.start; - } - - return result; - } - }, { - key: "touchStartHandler", - value: function touchStartHandler(e) { - var touch = e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e; - - if (!touch || !touch.pageX || !touch.pageY) { - return; - } - - this.touchStartX = touch.clientX * dpr; - this.touchStartY = touch.clientY * dpr; - this.touchTime = new Date(); - this.isMoving = true; - this.needProcess = true; - this.animate = requestAnimationFrame(this.loop.bind(this)); - } - }, { - key: "touchMoveHandler", - value: function touchMoveHandler(e) { - if (!this.isMoving) { - return; - } - - var touch = e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e; - - if (!touch || !touch.pageX || !touch.pageY) { - return; - } - - var currY = touch.clientY * dpr; - - if (this.touchStartY - currY > 2 || this.touchStartY - currY < -2) { - this.target -= this.touchStartY - currY; - } - - this.target = this.limitTarget(this.target); - this.touchStartY = currY; - } - }, { - key: "touchEndHandler", - value: function touchEndHandler() { - this.isMoving = false; - var timeInS = (Date.now() - this.touchTime) / 1000; - /*console.log(Date.now(), this.touchTime.getTime(), Date.now() - this.touchTime);*/ - - if (timeInS < 0.9) { - /*console.log(1, timeInS, this.target, this.move);*/ - this.target += (this.target - this.move) * 0.6 / (timeInS * 5); - /*console.log(2, this.target)*/ - - this.target = this.limitTarget(this.target); - /*console.log(3, this.target)*/ - } - } - }, { - key: "loop", - value: function loop() { - if (this.needProcess) { - if (this.isMoving) { - if (this.move !== this.target) { - // 手指移动可能过快,切片以使得滑动流畅 - if (Math.abs(this.target - this.move) > 1) { - this.move += (this.target - this.move) * 0.4; - } else { - this.move = this.target; - } - - this.scroll && this.scroll(this.move); - } - } else { - if (this.move !== this.target) { - /** - * 如果滑动很快,为了滚动流畅,需要将滑动过程切片 - */ - if (Math.abs(this.target - this.move) > 1) { - this.move += (this.target - this.move) * 0.3; - } else { - this.move = this.target; - } - - this.scroll && this.scroll(this.move); - } else { - // 滑动结束,停止动画 - this.needProcess = false; - } - } - - this.animate = requestAnimationFrame(this.loop.bind(this)); - } else if (typeof cancelAnimationFrame !== 'undefined') { - cancelAnimationFrame(this.animate); - } - } - }]); - - return Touch; -}(); - - - -/***/ }), -/* 21 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BitMapText; }); -/* harmony import */ var _elements_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _common_pool_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - - - -var bitMapPool = new _common_pool_js__WEBPACK_IMPORTED_MODULE_1__["default"]('bitMapPool'); - -var BitMapText = /*#__PURE__*/function (_Element) { - _inherits(BitMapText, _Element); - - var _super = _createSuper(BitMapText); - - function BitMapText(opts) { - var _this; - - _classCallCheck(this, BitMapText); - - var _opts$style = opts.style, - style = _opts$style === void 0 ? {} : _opts$style, - _opts$props = opts.props, - props = _opts$props === void 0 ? {} : _opts$props, - _opts$idName = opts.idName, - idName = _opts$idName === void 0 ? '' : _opts$idName, - _opts$className = opts.className, - className = _opts$className === void 0 ? '' : _opts$className, - _opts$value = opts.value, - value = _opts$value === void 0 ? '' : _opts$value, - _opts$font = opts.font, - font = _opts$font === void 0 ? '' : _opts$font; - _this = _super.call(this, { - props: props, - idName: idName, - className: className, - style: style - }); - _this.type = "BitMapText"; - _this.ctx = null; - _this.valuesrc = value; - _this.renderBoxes = []; - Object.defineProperty(_assertThisInitialized(_this), "value", { - get: function get() { - return this.valuesrc; - }, - set: function set(newValue) { - if (newValue !== this.valuesrc) { - this.valuesrc = newValue; - this.emit('repaint'); - } - }, - enumerable: true, - configurable: true - }); - _this.font = bitMapPool.get(font); - - if (!_this.font) { - console.error('Please invoke API `registBitMapFont` before using `BitMapText`'); - } - - return _this; - } - - _createClass(BitMapText, [{ - key: "insert", - value: function insert(ctx, box) { - this.renderBoxes.push({ - ctx: ctx, - box: box - }); - this.render(ctx, box); - } - }, { - key: "repaint", - value: function repaint() { - var _this2 = this; - - this.renderBoxes.forEach(function (item) { - _this2.render(item.ctx, item.box); - }); - } - }, { - key: "destroySelf", - value: function destroySelf() { - this.root = null; - } - }, { - key: "render", - value: function render(ctx, layoutBox) { - var _this3 = this; - - if (!this.font) { - return; - } - - if (this.font.ready) { - this.renderText(ctx, layoutBox); - } else { - this.font.event.on('text__load__done', function () { - if (!_this3.isDestroyed) { - _this3.renderText(ctx, layoutBox); - } - }); - } - } - }, { - key: "getTextBounds", - value: function getTextBounds() { - var style = this.style; - var _style$letterSpacing = style.letterSpacing, - letterSpacing = _style$letterSpacing === void 0 ? 0 : _style$letterSpacing; - var width = 0; - - for (var i = 0, len = this.value.length; i < len; i++) { - var _char = this.value[i]; - var cfg = this.font.chars[_char]; - - if (cfg) { - width += cfg.w; - - if (i < len - 1) { - width += letterSpacing; - } - } - } - - return { - width: width, - height: this.font.lineHeight - }; - } - }, { - key: "renderText", - value: function renderText(ctx, layoutBox) { - var bounds = this.getTextBounds(); - var defaultLineHeight = this.font.lineHeight; - ctx.save(); - this.renderBorder(ctx, layoutBox); - var box = layoutBox || this.layoutBox; - var style = this.style; - var width = style.width, - height = style.height, - _style$lineHeight = style.lineHeight, - lineHeight = _style$lineHeight === void 0 ? defaultLineHeight : _style$lineHeight, - textAlign = style.textAlign, - verticalAlign = style.verticalAlign; // 元素包围盒的左上角坐标 - - var x = box.absoluteX; - var y = box.absoluteY; - var scaleY = lineHeight / defaultLineHeight; - var realWidth = scaleY * bounds.width; // 如果文字的渲染区域高度小于盒子高度,采用对齐方式 - - if (lineHeight < height) { - if (verticalAlign === 'middle') { - y += (height - lineHeight) / 2; - } else if (verticalAlign === 'bottom') { - y = y + height - lineHeight; - } - } - - if (width > realWidth) { - if (textAlign === 'center') { - x += (width - realWidth) / 2; - } else if (textAlign === 'right') { - x += width - realWidth; - } - } - - for (var i = 0; i < this.value.length; i++) { - var _char2 = this.value[i]; - var cfg = this.font.chars[_char2]; - - if (cfg) { - ctx.drawImage(this.font.texture, cfg.x, cfg.y, cfg.w, cfg.h, x + cfg.offX * scaleY, y + cfg.offY * scaleY, cfg.w * scaleY, cfg.h * scaleY); - x += cfg.w * scaleY; - } - } - } - }]); - - return BitMapText; -}(_elements_js__WEBPACK_IMPORTED_MODULE_0__["default"]); - - - -/***/ }) -/******/ ]); \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine/index.js.meta b/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine/index.js.meta deleted file mode 100644 index a051e792..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/open-data/open-data-js-sdk/minigame-canvas-engine/index.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 223bd05daca5de0498b16e8d7ffa13fe -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/plugin-config.js b/Assets/WX-WASM-SDK/wechat-default/plugin-config.js deleted file mode 100644 index e49d92cc..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/plugin-config.js +++ /dev/null @@ -1,8 +0,0 @@ -export const launchEventType = { - launchPlugin: 0, // 插件启动 - loadWasm: 1, // 加载wasm代码包 - compileWasm: 2, // 编译wasm代码 - loadAssets: 3, // 加载首包资源 - readAssets: 5, // 读取首包资源 - prepareGame: 6, // 初始化引擎 -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/wechat-default/plugin-config.js.meta b/Assets/WX-WASM-SDK/wechat-default/plugin-config.js.meta deleted file mode 100644 index a049d7ee..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/plugin-config.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: fe524bc5806ad47eaa53f337b69fbd2f -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/project.config.json b/Assets/WX-WASM-SDK/wechat-default/project.config.json deleted file mode 100644 index 77718aa9..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/project.config.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "description": "项目配置文件", - "setting": { - "urlCheck": false, - "es6": true, - "enhance": true, - "postcss": true, - "preloadBackgroundData": false, - "minified": true, - "newFeature": true, - "coverView": true, - "nodeModules": false, - "autoAudits": false, - "showShadowRootInWxmlPanel": true, - "scopeDataCheck": false, - "uglifyFileName": false, - "checkInvalidKey": true, - "checkSiteMap": true, - "uploadWithSourceMap": true, - "compileHotReLoad": false, - "useMultiFrameRuntime": true, - "useApiHook": false, - "disableUseStrict": false, - "babelSetting": { - "ignore": ["$GAME_NAME.wasm.framework.unityweb.js"], - "disablePlugins": [], - "outputPath": "" - }, - "useIsolateContext": true, - "useCompilerModule": true, - "userConfirmedUseCompilerModuleSwitch": false, - "packNpmManually": false, - "packNpmRelationList": [] - }, - "compileType": "game", - "libVersion": "2.24.6", - "appid": "$APP_ID", - "projectname": "$PROJECT_NAME", - "simulatorType": "wechat", - "simulatorPluginLibVersion": {}, - "packOptions": { - "ignore": [ - { - "type": "folder", - "value": ".plugincache" - }, - { - "type": "suffix", - "value": ".symbols.unityweb" - } - ] - }, - "condition": { - "search": { - "current": -1, - "list": [] - }, - "conversation": { - "current": -1, - "list": [] - }, - "game": { - "currentL": -1, - "list": [] - }, - "miniprogram": { - "current": -1, - "list": [] - } - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/project.config.json.meta b/Assets/WX-WASM-SDK/wechat-default/project.config.json.meta deleted file mode 100644 index dac16b74..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/project.config.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 5d978252a1b1c3a409387fc5d16783bb -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/texture-config.js b/Assets/WX-WASM-SDK/wechat-default/texture-config.js deleted file mode 100644 index 4aec13d9..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/texture-config.js +++ /dev/null @@ -1 +0,0 @@ -GameGlobal.USED_TEXTURE_COMPRESSION=false;GameGlobal.TEXTURE_PARALLEL_BUNDLE=false;GameGlobal.TEXTURE_BUNDLES = ''; diff --git a/Assets/WX-WASM-SDK/wechat-default/texture-config.js.meta b/Assets/WX-WASM-SDK/wechat-default/texture-config.js.meta deleted file mode 100644 index a3901d28..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/texture-config.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ee2c55ef67d754219bf5980f49f212c8 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-namespace.js b/Assets/WX-WASM-SDK/wechat-default/unity-namespace.js deleted file mode 100644 index 62d04bac..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-namespace.js +++ /dev/null @@ -1,62 +0,0 @@ -const unityNamespace = { - canvas: GameGlobal.canvas, - navigator: GameGlobal.navigator, - XMLHttpRequest: GameGlobal.XMLHttpRequest, - hideTimeLogModal: true, // 是否显示耗时的弹框,默认开发版时显示弹出耗时弹框 - enableDebugLog: false, // 是否打印详细日志 - bundleHashLength: $BUNDLE_HASH_LENGTH, // 自定义bundle中的hash长度 - releaseMemorySize: $DEFAULT_RELEASE_SIZE, // 单位Bytes, 1MB = 1024 KB = 1024*1024Bytes - unityVersion: "$UNITY_VERSION", - convertPluginVersion: "$PLUGIN_VERSION", - streamingUrlPrefixPath: '', // 拼在StreamingAssets前面的path,DATA_CDN + streamingUrlPrefixPath + StreamingAssets - dataFileSubPrefix: '$DATA_FILE_SUB_PREFIX', // DATA_CDN + dataFileSubPrefix + datafilename - maxStorage: $MAX_STORAGE_SIZE, // 当前appid扩容后,通过本字段告知插件本地存储最大容量,单位MB - texturesHashLength: $TEXTURE_HASH_LENGTH, // 纹理中的hash长度 - texturesPath: '$TEXTURES_PATH', // 纹理存放路径 - needCacheTextures: $NEED_CACHE_TEXTURES, // 是否需要缓存纹理 -} - -// 判断是否需要自动缓存的文件,返回true自动缓存;false不自动缓存 -unityNamespace.isCacheableFile = function(path) { - const cacheableFileIdentifier = [$BUNDLE_PATH_IDENTIFIER]; // 判定为下载bundle的路径标识符,此路径下的下载,会自动缓存 - const excludeFileIdentifier = [$EXCLUDE_FILE_EXTENSIONS]; // 命中路径标识符的情况下,并不是所有文件都有必要缓存,过滤下不需要缓存的文件 - if (cacheableFileIdentifier.some(identifier => path.includes(identifier) && excludeFileIdentifier.every(excludeIdentifier => !path.includes(excludeIdentifier)))) { - return true; - } - return false; -} - -// 清理缓存时是否可被自动清理;返回true可自动清理;返回false不可自动清理 -unityNamespace.isErasableFile = function(info) { - const inErasableIdentifier = []; // 达到缓存上限时,不会被自动清理的文件 - if (inErasableIdentifier.some(identifier => info.path.includes(identifier))) { - return false; - } - return true; -} - -GameGlobal.WebAssembly = GameGlobal.WXWebAssembly -GameGlobal.unityNamespace = GameGlobal.unityNamespace || unityNamespace -GameGlobal.realtimeLogManager = wx.getRealtimeLogManager() -GameGlobal.logmanager = wx.getLogManager() -GameGlobal.onCrash = function(error){ - GameGlobal.manager.showAbort(); - const sysInfo = wx.getSystemInfoSync() - let button = wx.createFeedbackButton({ - type: 'text', - text: '提交反馈', - style: { - left: (sysInfo.screenWidth - 184) / 2, - top: sysInfo.screenHeight / 3 + 140, - width: 184, - height: 40, - lineHeight: 40, - backgroundColor: '#07C160', - color: '#ffffff', - textAlign: 'center', - fontSize: 16, - borderRadius: 4 - } - }) -} -export default GameGlobal.unityNamespace diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-namespace.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-namespace.js.meta deleted file mode 100644 index d026a086..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-namespace.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1c7db38c35302284e8cd9a72e0429fe4 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk.meta deleted file mode 100644 index c3b8b786..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f752425ac67944c039cf42ca17f07f9b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/ad.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/ad.js deleted file mode 100755 index 3f0917f7..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/ad.js +++ /dev/null @@ -1,273 +0,0 @@ -import moduleHelper from './module-helper'; -import response from './response'; - -const ads = {}; - -export default { - WXCreateBannerAd(conf) { - conf = JSON.parse(conf); - conf.style = JSON.parse(conf.styleRaw); - const ad = wx.createBannerAd(conf); - const key = new Date().getTime().toString(32) + Math.random().toString(32); - ads[key] = ad; - ad.onError((res) => { - console.error(res); - moduleHelper.send('ADOnErrorCallback', JSON.stringify({ - callbackId: key, - errMsg: res.errMsg, - errCode: res.errCode || res.err_code, - })); - }); - ad.onLoad(() => { - moduleHelper.send('ADOnLoadCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - ad.onResize((res) => { - moduleHelper.send('ADOnResizeCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - ...res, - })); - }); - return key; - }, - WXCreateFixedBottomMiddleBannerAd(adUnitId, adIntervals, height) { - const info = wx.getSystemInfoSync(); - const ad = wx.createBannerAd({ - adUnitId, - adIntervals, - style: { - left: 0, - top: info.windowHeight - height, - height, - width: info.windowWeight, - }, - }); - const key = new Date().getTime().toString(32) + Math.random().toString(32); - ads[key] = ad; - ad.onError((res) => { - console.error(res); - moduleHelper.send('ADOnErrorCallback', JSON.stringify({ - callbackId: key, - errMsg: res.errMsg, - errCode: res.errCode || res.err_code, - })); - }); - ad.onLoad(() => { - moduleHelper.send('ADOnLoadCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - const oldWidth = info.windowWidth; - ad.onResize((res) => { - if (Math.abs(res.height - height) > 1 || Math.abs(res.width - oldWidth) > 1) { - ad.style.left = parseInt((info.windowWidth - res.width) / 2); - ad.style.top = parseInt(info.windowHeight - res.height); - } - moduleHelper.send('ADOnResizeCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - ...res, - })); - }); - return key; - }, - WXCreateRewardedVideoAd(conf) { - conf = JSON.parse(conf); - const ad = wx.createRewardedVideoAd(conf); - const key = new Date().getTime().toString(32) + Math.random().toString(32); - ads[key] = ad; - if (!conf.multiton) { // 单例模式要处理一下 - ad.offLoad(); - ad.offError(); - ad.offClose(); - } - ad.onError((res) => { - console.error(res); - moduleHelper.send('ADOnErrorCallback', JSON.stringify({ - callbackId: key, - errMsg: res.errMsg, - errCode: res.errCode || res.err_code, - })); - }); - ad.onLoad(() => { - moduleHelper.send('ADOnLoadCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - ad.onClose((res) => { - moduleHelper.send('ADOnVideoCloseCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - ...res, - })); - }); - return key; - }, - WXCreateInterstitialAd(conf) { - conf = JSON.parse(conf); - const ad = wx.createInterstitialAd(conf); - const key = new Date().getTime().toString(32) + Math.random().toString(32); - ads[key] = ad; - ad.onError((res) => { - console.error(res); - moduleHelper.send('ADOnErrorCallback', JSON.stringify({ - callbackId: key, - errMsg: res.errMsg, - errCode: res.errCode || res.err_code, - })); - }); - ad.onLoad(() => { - moduleHelper.send('ADOnLoadCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - ad.onClose(() => { - moduleHelper.send('ADOnCloseCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - return key; - }, - WXCreateGridAd(conf) { - conf = JSON.parse(conf); - conf.style = JSON.parse(conf.styleRaw); - const ad = wx.createGridAd(conf); - const key = new Date().getTime().toString(32) + Math.random().toString(32); - ads[key] = ad; - ad.onError((res) => { - console.error(res); - moduleHelper.send('ADOnErrorCallback', JSON.stringify({ - callbackId: key, - errMsg: res.errMsg, - errCode: res.errCode || res.err_code, - })); - }); - ad.onLoad(() => { - moduleHelper.send('ADOnLoadCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - ad.onResize((res) => { - moduleHelper.send('ADOnResizeCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - ...res, - })); - }); - return key; - }, - WXCreateCustomAd(conf) { - conf = JSON.parse(conf); - conf.style = JSON.parse(conf.styleRaw); - const ad = wx.createCustomAd(conf); - const key = new Date().getTime().toString(32) + Math.random().toString(32); - ads[key] = ad; - ad.onError((res) => { - console.error(res); - moduleHelper.send('ADOnErrorCallback', JSON.stringify({ - callbackId: key, - errMsg: res.errMsg, - errCode: res.errCode || res.err_code, - })); - }); - ad.onLoad(() => { - moduleHelper.send('ADOnLoadCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - ad.onClose(() => { - moduleHelper.send('ADOnCloseCallback', JSON.stringify({ - callbackId: key, - errMsg: '', - })); - }); - return key; - }, - WXADStyleChange(id, key, value) { - if (!ads[id]) { - return false; - } - ads[id].style[key] = value; - }, - WXShowAd(id, succ, fail) { - if (!ads[id]) { - return false; - } - ads[id].show().then(() => { - response.textFormat(succ, { - errMsg: 'show:ok', - }); - }).catch((e) => { - response.textFormat(fail, { - errMsg: e.errMsg || '', - }); - }); - }, - WXShowAd2(id, branchId, branchDim, succ, fail) { - if (!ads[id]) { - return false; - } - ads[id].show({ branchId, branchDim }).then(() => { - response.textFormat(succ, { - errMsg: 'show:ok', - }); - }).catch((e) => { - response.textFormat(fail, { - errMsg: e.errMsg || '', - }); - }); - }, - WXHideAd(id, succ, fail) { - if (!ads[id]) { - return false; - } - if (succ || fail) { - ads[id].hide().then((v) => { - response.textFormat(succ, { - errMsg: 'hide:ok', - }); - }).catch((e) => { - response.textFormat(fail, { - errMsg: e.errMsg || '', - }); - }); - } else { - ads[id].hide(); - } - }, - WXADDestroy(id) { - if (!ads[id]) { - return false; - } - ads[id].destroy(); - delete ads[id]; - }, - WXADLoad(id, succ, fail) { - if (!ads[id]) { - return false; - } - ads[id].load().then(() => { - response.textFormat(succ, {}); - }).catch((res) => { - moduleHelper.send('ADLoadErrorCallback', JSON.stringify({ - callbackId: fail, - ...res, - })); - }); - }, - WXReportShareBehavior(id, conf) { - if (!ads[id]) { - return '{}'; - } - return JSON.stringify(ads[id].reportShareBehavior(JSON.parse(conf))); - }, -}; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/ad.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/ad.js.meta deleted file mode 100644 index e1cf54e7..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/ad.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ba85a7007f5ed6b4c97dccd81773e284 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/audio.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/audio.js deleted file mode 100644 index 3a35b2d8..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/audio.js +++ /dev/null @@ -1,860 +0,0 @@ -const audios = {}; -import moduleHelper from "./module-helper"; -const msg = 'InnerAudioContext does not exist!'; -const localAudioMap = {}; -const downloadingAudioMap = {}; -const soundVolumeHandler = {}; -const err = function(msg){GameGlobal.manager.printErr(msg)} -const funs = { - getFullUrl(v) { - if (!/^https?:\/\//.test(v)) { - const cdnPath = GameGlobal.manager.assetPath; - v = cdnPath.replace(/\/$/, '') + '/' + v.replace(/^\//, '').replace(/^Assets\//, ''); - } - return encodeURI(v); - }, - downloadMusic(src){ - return new Promise((resolve,reject)=>{ - wx.downloadFile({ - url: src, - success(res) { - if (res.statusCode === 200 && res.tempFilePath ) { - localAudioMap[src] = res.tempFilePath; - wx.setStorage({ - key:src, - data:res.tempFilePath - }).catch(e=>{}); - resolve(true); - } else { - resolve(false); - } - }, - fail(e) { - resolve(false); - err(e); - } - }); - }); - }, - checkLocalFile(src){ - return new Promise(async (resolve, reject)=>{ - let path = localAudioMap[src]; - if(!path){ - try{ - const res = await new Promise((subResolve,subReject)=>{ - wx.getStorage({ - key:src, - success:(r)=>{ - subResolve(r); - }, - fail:(e)=>{ - subReject(e); - } - }) - }); - path = res.data; - localAudioMap[src] = path; - }catch (e){} - } - if(!path){ - return resolve(false); - } - const fs = wx.getFileSystemManager(); - fs.access({ - path: path, - success() { - // 文件存在 - resolve(true); - }, - fail() { - // 文件不存在或其他错误 - resolve(false); - } - }); - }) - }, - handleDownloadEnd(src,succeeded){ - if(!downloadingAudioMap[src]){ - return; - } - while (downloadingAudioMap[src] && downloadingAudioMap[src].length>0){ - const item = downloadingAudioMap[src].shift(); - if(!succeeded){ - item.reject(); - }else{ - item.resolve(); - } - } - downloadingAudioMap[src] = null; - } -}; - -var WEBAudio = { - audioInstanceIdCounter: 0, - audioInstances: {}, - audioContext: null, - audioWebEnabled: 0, - audioCache: [], - lOrientation: {x:0, y:0, z:0, xUp:0, yUp:0, zUp:0}, - lPosition: {x:0, y:0, z:0} -}; -export default { - WXCreateInnerAudioContext(src, loop, startTime, autoplay, volume, playbackRate, needDownload) { - const id = new Date().getTime().toString(32) + Math.random().toString(32); - audios[id] = wx.createInnerAudioContext(); - playbackRate = 1; // 先强制为1,android客户端有bug,设为其他值的话 - audios[id]._needDownload = needDownload; - audios[id]._src = src; - if (src) { - src = funs.getFullUrl(src); - funs.checkLocalFile(src).then(exist=>{ - if(exist){ - audios[id].src = localAudioMap[src]; - funs.handleDownloadEnd(src,true); - }else if(needDownload){ - const successFun = function(){ - audios[id].src = localAudioMap[src]; - }; - const failFun = function(){ - moduleHelper.send('OnAudioCallback', JSON.stringify({ - callbackId: id, - errMsg: "onError" - })); - } - if(!downloadingAudioMap[src]) { - downloadingAudioMap[src] = []; - } - downloadingAudioMap[src].unshift({ - resolve:successFun,reject:failFun - }); - if(!downloadingAudioMap[src].isDownloading){ - downloadingAudioMap[src].isDownloading = true; - funs.downloadMusic(src).then(succeeded=>{ - funs.handleDownloadEnd(src,succeeded); - }); - } - }else{ - audios[id].src = src; - } - }); - } - - if (loop) { - audios[id].loop = true; - } - if (autoplay) { - audios[id].autoplay = true; - } - if (startTime > 0) { - audios[id].startTime = +startTime.toFixed(2); - } - if (volume !== 1) { - audios[id].volume = +volume.toFixed(2); - } - if (playbackRate !== 1) { - audios[id].playbackRate = +playbackRate.toFixed(2); - } - return id; - }, - WXInnerAudioContextSetBool(id, k, v) { - if (audios[id]) { - audios[id][k] = Boolean(+v); - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextSetString(id, k, v) { - if (audios[id]) { - if (k === 'src') { - v = funs.getFullUrl(v); - if (localAudioMap[v]) { - v = localAudioMap[v]; - } - } - audios[id][k] = v; - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextSetFloat(id, k, v) { - if (audios[id]) { - audios[id][k] = +v.toFixed(2); - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextGetFloat(id, k) { - if (audios[id]) { - return audios[id][k]; - } else { - console.error(msg, id); - return 0; - } - }, - WXInnerAudioContextGetBool(id, k) { - if (audios[id]) { - return audios[id][k]; - } else { - console.error(msg, id); - return false; - } - }, - WXInnerAudioContextPlay(id) { - if (audios[id]) { - audios[id].play(); - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextPause(id) { - if (audios[id]) { - audios[id].pause(); - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextStop(id) { - if (audios[id]) { - audios[id].stop(); - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextDestroy(id) { - if (audios[id]) { - audios[id].destroy(); - delete audios[id]; - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextSeek(id, position) { - if (audios[id]) { - audios[id].seek(+position.toFixed(3)); - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextAddListener(id, key) { - if (audios[id]) { - function AddListener(){ - audios[id][key](function (e) { - moduleHelper.send('OnAudioCallback', JSON.stringify({ - callbackId: id, - errMsg: key - })); - if (key === 'onError') { - console.error(e); - } - }); - } - - if(!audios[id].src && audios[id]._needDownload && audios[id]._src){ - const src = funs.getFullUrl(audios[id]._src); - if(!downloadingAudioMap[src]){ - downloadingAudioMap[src] = []; - } - downloadingAudioMap[src].push({ - resolve:AddListener, - reject:()=>{} - }); - }else{ - AddListener(); - } - - } else { - console.error(msg, id); - } - }, - WXInnerAudioContextRemoveListener(id, key) { - if (audios[id]) { - audios[id][key](); - } else { - console.error(msg, id); - } - }, - WXPreDownloadAudios(paths, id) { - var list = paths.split(','); - Promise.all(list.map(v => { - const src = funs.getFullUrl(v); - return new Promise(async (resolve, reject) => { - if(!downloadingAudioMap[src]){ - downloadingAudioMap[src] = [{ - resolve,reject - }]; - const exist = await funs.checkLocalFile(src); - if(exist){ - funs.handleDownloadEnd(src,true); - return; - } - const succeeded = await funs.downloadMusic(src); - funs.handleDownloadEnd(src,succeeded); - }else{ - downloadingAudioMap[src].push({ - resolve,reject - }); - } - }) - })).then(() => { - moduleHelper.send('WXPreDownloadAudiosCallback', JSON.stringify({ - callbackId: id.toString(), - errMsg: "0" - })); - }).catch(e => { - moduleHelper.send('WXPreDownloadAudiosCallback', JSON.stringify({ - callbackId: id.toString(), - errMsg: "1" - })); - }) - - }, - //-------------------Unity Audio适配-------------------- - _JS_Sound_Create_Channel(callback, userData) { - if (WEBAudio.audioWebEnabled == 0) return; - var channel = { - gain: WEBAudio.audioContext.createGain(), - panner: WEBAudio.audioContext.createPanner(), - threeD: false, - playUrl: function (startTime, url, startOffset) { - try { - this.setup(url); - var chan = this; - this.source.onended = function () { - chan.disconnectSource(); - if (callback) GameGlobal.unityNamespace.Module.dynCall_vi(callback, [userData]); - }; - this.source.start(startTime, startOffset); - this.source.playbackStartTime = - startTime - startOffset / this.source.playbackRate.value; - } catch (e) { - err("playUrl error. Exception: " + e); - } - }, - playBuffer: function (startTime, buffer, startOffset) { - try { - this.setup(); - this.source.buffer = buffer; - var chan = this; - this.source.onended = function () { - chan.disconnectSource(); - if (callback) GameGlobal.unityNamespace.Module.dynCall_vi(callback, [userData]); - }; - this.source.start(startTime, startOffset); - this.source.playbackStartTime = - startTime - startOffset / this.source.playbackRate.value; - } catch (e) { - err("playUrl error. Exception: " + e); - } - }, - disconnectSource: function () { - if (this.source && !this.source.isPausedMockNode) { - this.source.onended = null; - this.source.disconnect(); - if (this.source.mediaElement) { - var url = this.source.mediaElement.src; - this.source.mediaElement.pause(); - this.source.mediaElement.src = ""; - delete this.source.mediaElement; - URL.revokeObjectURL(url); - } - delete this.source; - } - }, - stop: function (delay) { - if (channel.source && channel.source.buffer) { - try { - channel.source.stop(WEBAudio.audioContext.currentTime + delay); - } catch (e) {} - if (delay == 0) { - channel.disconnectSource(); - } - } - }, - pause: function () { - var s = this.source; - if (!s) return; - if (s.mediaElement) { - this.pauseMediaElement(); - return; - } - var pausedSource = { - isPausedMockNode: true, - loop: s.loop, - loopStart: s.loopStart, - loopEnd: s.loopEnd, - buffer: s.buffer, - url: s.mediaElement ? s.mediaElement.src : null, - playbackRate: s.playbackRate.value, - playbackPausedAtPosition: s.estimatePlaybackPosition(), - setPitch: function (v) { - this.playbackRate = v; - }, - }; - this.stop(0); - this.disconnectSource(); - this.source = pausedSource; - }, - resume: function () { - var pausedSource = this.source; - if (pausedSource && pausedSource.mediaElement) { - pausedSource.start(); - return; - } - if (!pausedSource || !pausedSource.isPausedMockNode) return; - delete this.source; - if (pausedSource.url) { - this.playUrl( - WEBAudio.audioContext.currentTime - - Math.min(0, pausedSource.playbackPausedAtPosition), - pausedSource.url, - Math.max(0, pausedSource.playbackPausedAtPosition) - ); - } else { - this.playBuffer( - WEBAudio.audioContext.currentTime - - Math.min(0, pausedSource.playbackPausedAtPosition), - pausedSource.buffer, - Math.max(0, pausedSource.playbackPausedAtPosition) - ); - } - this.source.loop = pausedSource.loop; - this.source.loopStart = pausedSource.loopStart; - this.source.loopEnd = pausedSource.loopEnd; - this.source.setPitch(pausedSource.playbackRate); - }, - setup: function (url) { - if (this.source && !this.source.isPausedMockNode) return; - if (!url) { - this.source = WEBAudio.audioContext.createBufferSource(); - } else { - this.mediaElement = WEBAudio.audioCache.length ? - WEBAudio.audioCache.pop() : - new Audio(); - this.mediaElement.preload = "metadata"; - this.mediaElement.src = url; - this.source = WEBAudio.audioContext.createMediaElementSource( - this.mediaElement - ); - this.source.playbackRate = {}; - var source = this.source; - Object.defineProperty(this.source, "loop", { - get: function () { - return source.mediaElement.loop; - }, - set: function (v) { - source.mediaElement.loop = v; - }, - }); - Object.defineProperty(this.source.playbackRate, "value", { - get: function () { - return source.mediaElement.playbackRate; - }, - set: function (v) { - source.mediaElement.playbackRate = v; - }, - }); - Object.defineProperty(this.source, "currentTime", { - get: function () { - return source.mediaElement.currentTime; - }, - set: function (v) { - source.mediaElement.currentTime = v; - }, - }); - Object.defineProperty(this.source, "mute", { - get: function () { - return source.mediaElement.mute; - }, - set: function (v) { - source.mediaElement.mute = v; - }, - }); - var self = this; - this.playPromise = null; - this.pauseRequested = false; - this.pauseMediaElement = function () { - if (self.playPromise) { - self.pauseRequested = true; - } else { - source.mediaElement.pause(); - } - }; - var _startPlayback = function (offset) { - if (self.playPromise) { - self.pauseRequested = false; - return; - } - source.mediaElement.currentTime = offset; - self.playPromise = source.mediaElement.play(); - if (self.playPromise) { - self.playPromise.then(function () { - if (self.pauseRequested) { - source.mediaElement.pause(); - self.pauseRequested = false; - } - self.playPromise = null; - }); - } - }; - this.source.start = function (startTime, offset) { - var startDelayThresholdMS = 4; - var startDelayMS = - (startTime - WEBAudio.audioContext.currentTime) * 1e3; - if (startDelayMS > startDelayThresholdMS) { - setTimeout(function () { - _startPlayback(offset); - }, startDelayMS); - } else { - _startPlayback(offset); - } - }; - this.source.stop = function () { - self.pauseMediaElement(); - }; - } - this.source.estimatePlaybackPosition = function () { - var t = - (WEBAudio.audioContext.currentTime - this.playbackStartTime) * - this.playbackRate.value; - if (this.loop && t >= this.loopStart) { - t = - ((t - this.loopStart) % (this.loopEnd - this.loopStart)) + - this.loopStart; - } - return t; - }; - this.source.setPitch = function (newPitch) { - var curPosition = this.estimatePlaybackPosition(); - if (curPosition >= 0) { - this.playbackStartTime = - WEBAudio.audioContext.currentTime - curPosition / newPitch; - } - this.playbackRate.value = newPitch; - }; - this.setupPanning(); - }, - setupPanning: function () { - if (this.source.isPausedMockNode) return; - this.source.disconnect(); - if (this.threeD) { - this.source.connect(this.panner); - this.panner.connect(this.gain); - } else { - this.panner.disconnect(); - this.source.connect(this.gain); - } - }, - }; - channel.panner.rolloffFactor = 0; - channel.gain.connect(WEBAudio.audioContext.destination); - WEBAudio.audioInstances[++WEBAudio.audioInstanceIdCounter] = channel; - return WEBAudio.audioInstanceIdCounter; - }, - _JS_Sound_GetLength(bufferInstance) { - if (WEBAudio.audioWebEnabled == 0) return 0; - var sound = WEBAudio.audioInstances[bufferInstance]; - if (sound.buffer) { - var sampleRateRatio = 44100 / sound.buffer.sampleRate; - return sound.buffer.length * sampleRateRatio; - } - return sound.mediaElement.duration * 44100; - }, - _JS_Sound_GetLoadState(bufferInstance) { - if (WEBAudio.audioWebEnabled == 0) return 2; - var sound = WEBAudio.audioInstances[bufferInstance]; - if (sound.error) return 2; - if (sound.buffer || sound.url) return 0; - return 1; - }, - _JS_Sound_Init() { - try { - window.AudioContext = window.AudioContext || window.webkitAudioContext; - if (window.AudioContext) { - WEBAudio.audioContext = new AudioContext(); - } - if (wx && wx.createWebAudioContext) { - WEBAudio.audioContext = wx.createWebAudioContext(); - console.log("use wx WebAudio"); - } - if (!WEBAudio.audioContext) { - err('Minigame Web Audio API not suppoted') - return - } - var tryToResumeAudioContext = function () { - if (WEBAudio.audioContext.state === "suspended") { - WEBAudio.audioContext.resume(); - } - else clearInterval(resumeInterval); - }; - // var resumeInterval = setInterval(tryToResumeAudioContext, 400); - WEBAudio.audioWebEnabled = 1; - wx.onShow((result) => {WEBAudio.audioContext.resume()}); - } catch (e) { - err("Web Audio API is not supported in this browser"); - } - }, - _JS_Sound_Load(ptr, length, decompress) { - if (WEBAudio.audioWebEnabled == 0) return 0; - var sound = { - buffer: null, - error: false - }; - WEBAudio.audioInstances[++WEBAudio.audioInstanceIdCounter] = sound; - var audioData = GameGlobal.unityNamespace.Module.HEAPU8.buffer.slice(ptr, ptr + length); - WEBAudio.audioContext.decodeAudioData( - audioData, - function (buffer) { - sound.buffer = buffer; - }, - function (error) { - sound.error = true; - console.log("Decode error: " + error); - } - ); - return WEBAudio.audioInstanceIdCounter; - }, - _JS_Sound_Load_PCM(channels, length, sampleRate, ptr) { - if (WEBAudio.audioWebEnabled == 0) return 0; - var sound = { - buffer: WEBAudio.audioContext.createBuffer(channels, length, sampleRate), - error: false, - }; - for (var i = 0; i < channels; i++) { - var offs = (ptr >> 2) + length * i; - var buffer = sound.buffer; - var copyToChannel = - buffer["copyToChannel"] || - function (source, channelNumber, startInChannel) { - var clipped = source.subarray( - 0, - Math.min(source.length, this.length - (startInChannel | 0)) - ); - this.getChannelData(channelNumber | 0).set(clipped, startInChannel | 0); - }; - copyToChannel.apply(buffer, [GameGlobal.unityNamespace.Module.HEAPF32.subarray(offs, offs + length), i, 0]); - } - WEBAudio.audioInstances[++WEBAudio.audioInstanceIdCounter] = sound; - return WEBAudio.audioInstanceIdCounter; - }, - _JS_Sound_Play(bufferInstance, channelInstance, offset, delay) { - WXWASMSDK._JS_Sound_Stop(channelInstance, 0); - if (WEBAudio.audioWebEnabled == 0) return; - var sound = WEBAudio.audioInstances[bufferInstance]; - var channel = WEBAudio.audioInstances[channelInstance]; - if (sound.url) { - try { - channel.playUrl( - WEBAudio.audioContext.currentTime + delay, - sound.url, - offset - ); - } catch (e) { - err("playUrl error. Exception: " + e); - } - } else if (sound.buffer) { - try { - channel.playBuffer( - WEBAudio.audioContext.currentTime + delay, - sound.buffer, - offset - ); - } catch (e) { - err("playBuffer error. Exception: " + e); - } - } else console.log("Trying to play sound which is not loaded."); - }, - _JS_Sound_ReleaseInstance(instance) { - delete WEBAudio.audioInstances[instance]; - }, - _JS_Sound_ResumeIfNeeded() { - if (WEBAudio.audioWebEnabled == 0) return; - if (WEBAudio.audioContext.state === "suspended") - WEBAudio.audioContext.resume(); - }, - _JS_Sound_Set3D(channelInstance, threeD) { - var channel = WEBAudio.audioInstances[channelInstance]; - if (channel.threeD != threeD) { - channel.threeD = threeD; - if (!channel.source) { - channel.setup(); - } - channel.setupPanning(); - } - }, - _JS_Sound_SetListenerOrientation(x, y, z, xUp, yUp, zUp) { - if (WEBAudio.audioWebEnabled == 0) return; - x = x > 0 ? 0 : x; - y = y > 0 ? 0 : y; - z = z > 0 ? 0 : z; - xUp = xUp < 0 ? 0 : xUp; - yUp = yUp < 0 ? 0 : yUp; - zUp = zUp < 0 ? 0 : zUp; - if (x==WEBAudio.lOrientation.x && y==WEBAudio.lOrientation.y && z==WEBAudio.lOrientation.z && xUp==WEBAudio.lOrientation.xUp && yUp==WEBAudio.lOrientation.yUp && zUp==WEBAudio.lOrientation.zUp){return;} - WEBAudio.lOrientation.x = x; - WEBAudio.lOrientation.y = y; - WEBAudio.lOrientation.z = z; - WEBAudio.lOrientation.xUp = xUp; - WEBAudio.lOrientation.yUp = yUp; - WEBAudio.lOrientation.zUp = zUp; - if (WEBAudio.audioContext.listener.forwardX) { - WEBAudio.audioContext.listener.forwardX.setValueAtTime( - -x, - WEBAudio.audioContext.currentTime - ); - WEBAudio.audioContext.listener.forwardY.setValueAtTime( - -y, - WEBAudio.audioContext.currentTime - ); - WEBAudio.audioContext.listener.forwardZ.setValueAtTime( - -z, - WEBAudio.audioContext.currentTime - ); - WEBAudio.audioContext.listener.upX.setValueAtTime( - xUp, - WEBAudio.audioContext.currentTime - ); - WEBAudio.audioContext.listener.upY.setValueAtTime( - yUp, - WEBAudio.audioContext.currentTime - ); - WEBAudio.audioContext.listener.upZ.setValueAtTime( - zUp, - WEBAudio.audioContext.currentTime - ); - } else { - WEBAudio.audioContext.listener.setOrientation(-x, -y, -z, xUp, yUp, zUp); - } - }, - _JS_Sound_SetListenerPosition(x, y, z) { - if (WEBAudio.audioWebEnabled == 0) return; - x = x < 0 ? 0 : x; - y = y < 0 ? 0 : y; - z = z < 0 ? 0 : z; - if (x==WEBAudio.lPosition.x && y==WEBAudio.lPosition.y && z==WEBAudio.lPosition.z){return;} - WEBAudio.lPosition.x = x; - WEBAudio.lPosition.y = y; - WEBAudio.lPosition.z = z; - if (WEBAudio.audioContext.listener.positionX) { - WEBAudio.audioContext.listener.positionX.setValueAtTime( - x, - WEBAudio.audioContext.currentTime - ); - WEBAudio.audioContext.listener.positionY.setValueAtTime( - y, - WEBAudio.audioContext.currentTime - ); - WEBAudio.audioContext.listener.positionZ.setValueAtTime( - z, - WEBAudio.audioContext.currentTime - ); - } else { - WEBAudio.audioContext.listener.setPosition(x, y, z); - } - }, - _JS_Sound_SetLoop(channelInstance, loop) { - if (WEBAudio.audioWebEnabled == 0) return; - var channel = WEBAudio.audioInstances[channelInstance]; - if (!channel.source) { - channel.setup(); - } - channel.source.loop = loop > 0 ? true : false; - }, - _JS_Sound_SetLoopPoints(channelInstance, loopStart, loopEnd) { - if (WEBAudio.audioWebEnabled == 0) return; - var channel = WEBAudio.audioInstances[channelInstance]; - if (!channel.source) { - channel.setup(); - } - channel.source.loopStart = loopStart; - channel.source.loopEnd = loopEnd; - }, - _JS_Sound_SetPaused(channelInstance, paused) { - if (WEBAudio.audioWebEnabled == 0) return; - var channel = WEBAudio.audioInstances[channelInstance]; - var channelCurrentlyPaused = !channel.source || channel.source.isPausedMockNode; - if (paused != channelCurrentlyPaused) { - if (paused) channel.pause(); - else channel.resume(); - } - }, - _JS_Sound_SetPitch(channelInstance, v) { - if (WEBAudio.audioWebEnabled == 0) return; - try { - WEBAudio.audioInstances[channelInstance].source.setPitch(v); - } catch (e) { - err("Invalid audio pitch " + v + " specified to WebAudio backend!"); - } - }, - _JS_Sound_SetPosition(channelInstance, x, y, z) { - if (WEBAudio.audioWebEnabled == 0) return; - var channel = WEBAudio.audioInstances[channelInstance]; - if (channel.x != x || channel.y != y || channel.z != z) { - channel.panner.setPosition(x, y, z); - channel.x = x; - channel.y = y; - channel.z = z; - } - }, - - _JS_Sound_SetVolume(channelInstance, v) { - - if (WEBAudio.audioWebEnabled == 0) return; - try { - let volume = Number(v.toFixed(2)); - if (soundVolumeHandler[channelInstance] === volume) {return;} - soundVolumeHandler[channelInstance] = volume; - WEBAudio.audioInstances[channelInstance].gain.gain.setValueAtTime( - volume, - WEBAudio.audioContext.currentTime - ); - } catch (e) { - err("Invalid audio volume " + v + " specified to WebAudio backend!"); - } - }, - _JS_Sound_Stop(channelInstance, delay) { - if (WEBAudio.audioWebEnabled == 0) return; - var channel = WEBAudio.audioInstances[channelInstance]; - channel.stop(delay); - } - - -} - -//声音被打断后自动帮用户恢复 -const HandleInterruption = { - init() { - var InterruptList = {}; - wx.onHide(function () { - for (var key in audios) { - if (!audios[key].paused) { - InterruptList[key] = true; - } - } - }); - wx.onShow(function () { - for (var key in audios) { - if (audios[key].paused && InterruptList[key]) { - audios[key].play(); - } - } - InterruptList = {}; - }); - wx.onAudioInterruptionBegin(function () { - for (var key in audios) { - if (!audios[key].paused) { - InterruptList[key] = true; - } - } - }); - wx.onAudioInterruptionEnd(function () { - for (var key in audios) { - if (audios[key].paused && InterruptList[key]) { - audios[key].play(); - } - } - InterruptList = {}; - }); - } -}; - -HandleInterruption.init(); diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/audio.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/audio.js.meta deleted file mode 100644 index 71c51c0b..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/audio.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 78f7574fe6f3875419d5c7431e152771 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas-context.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas-context.js deleted file mode 100644 index a85871a6..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas-context.js +++ /dev/null @@ -1,16 +0,0 @@ -const callbacks = []; -let isTriggered = false; -export default { - addCreatedListener(callback){ - if(isTriggered){ - callback(); - }else{ - callbacks.push(callback); - } - }, - _triggerCallback(){ - isTriggered = true; - callbacks.forEach(v=>v()); - } -} - diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas-context.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas-context.js.meta deleted file mode 100644 index 65fd3b94..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas-context.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 86f3b136c3ded417e8101983377dbd7f -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas.js deleted file mode 100755 index 4236b618..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas.js +++ /dev/null @@ -1,22 +0,0 @@ -import response from './response'; -import moduleHelper from './module-helper'; - -export default { - WXToTempFilePathSync(conf) { - return canvas.toTempFilePathSync(JSON.parse(conf)); - }, - WXToTempFilePath(conf, s, f, c) { - canvas.toTempFilePath({ - ...JSON.parse(conf), - ...response.handleText(s, f, c), - success: (res) => { - moduleHelper.send('ToTempFilePathCallback', JSON.stringify({ - callbackId: s, - errMsg: res.errMsg, - errCode: res.errCode, - tempFilePath: res.tempFilePath, - })); - }, - }); - }, -}; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas.js.meta deleted file mode 100644 index dc0e8751..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/canvas.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 85684e1aab9280748ad503b16176f9e5 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/cloud.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/cloud.js deleted file mode 100755 index e72ec896..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/cloud.js +++ /dev/null @@ -1,35 +0,0 @@ -import response from "./response"; -let CloudIDObject = {}; -function fixWXCallFunctionData(data){ - for(var key in data){ - if(typeof data[key] == 'object'){ - fixWXCallFunctionData(data[key]) - }else if(typeof data[key] == 'string' && CloudIDObject[data[key]]){ - data[key] = CloudIDObject[data[key]]; - } - } -} -export default { - WXCallFunctionInit(conf){ - if(typeof conf === 'string'){ - conf = JSON.parse(conf); - } - wx.cloud.init(conf); - }, - WXCallFunction(name,data,conf,s,f,c) { - var d = JSON.parse(data); - fixWXCallFunctionData(d); - wx.cloud.callFunction({ - name: name, - data: d, - config: conf == "" ? null : JSON.parse(conf), - ...response.handlecloudCallFunction(s,f,c) - }) - }, - WXCloudID(cloudId){ - var res = wx.cloud.CloudID(cloudId); - var r = JSON.stringify(res); - CloudIDObject[r] = res; - return r; - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/cloud.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/cloud.js.meta deleted file mode 100644 index a34c2719..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/cloud.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ff7ed923b52279e438f31ba2dee4753e -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/conf.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/conf.js deleted file mode 100755 index 0b3a9c6d..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/conf.js +++ /dev/null @@ -1,2 +0,0 @@ -const moduleName = "WXSDKManagerHandler"; -export {moduleName}; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/conf.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/conf.js.meta deleted file mode 100644 index 9d45595d..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/conf.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 500afdc7a0a31fc4aa3e7ac1979e8464 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fix.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fix.js deleted file mode 100644 index ae6b245f..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fix.js +++ /dev/null @@ -1,76 +0,0 @@ -//用来修复一些unity跟小游戏的差异问题 - -export default { - init(){ - this.fixTimer(); - }, - //基础库现在返回的id都是固定值了,会导致unity拿到的id有问题,所以这里做个中间映射 - fixTimer(){ - const wm = {}; - let _setTimeout = window.setTimeout; - let id = 0; - const getId = function(){ - id++; - if(id>100000000){ - id = 0; - } - return id; - }; - window.setTimeout = function(vCallback, nDelay){ - let aArgs = Array.prototype.slice.call(arguments, 2); - let id = getId(); - let t = _setTimeout(vCallback instanceof Function ? function() { - vCallback.apply(null, aArgs); - delete wm[id]; - } : vCallback, nDelay); - wm[id] = t; - return id; - }; - let _clearTimeout = window.clearTimeout; - window.clearTimeout = function(id){ - let t = wm[id]; - if(t){ - _clearTimeout(t); - delete wm[id]; - } - }; - - let _setInterval = window.setInterval; - window.setInterval = function(vCallback, nDelay){ - let aArgs = Array.prototype.slice.call(arguments, 2); - let id = getId(); - let t = _setInterval(vCallback instanceof Function ? function() { - vCallback.apply(null, aArgs); - } : vCallback, nDelay); - wm[id] = t; - return id; - }; - let _clearInterval = window.clearInterval; - window.clearInterval = function(id){ - let t = wm[id]; - if(t){ - _clearInterval(t); - delete wm[id]; - } - }; - - let _requestAnimationFrame = window.requestAnimationFrame; - window.requestAnimationFrame = function(vCallback){ - let id = getId(); - let t = _requestAnimationFrame(function (){ - vCallback(); - delete wm[id]; - }); - wm[id] = t; - return id; - } - let _cancelAnimationFrame = window.cancelAnimationFrame; - window.cancelAnimationFrame = function(id){ - let t = wm[id]; - if(t){ - _cancelAnimationFrame(t); - delete wm[id]; - } - }; - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fix.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fix.js.meta deleted file mode 100644 index 48687bb2..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fix.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 7662cb148ced64c9fb3f96dc67d2303e -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fs.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fs.js deleted file mode 100755 index cf5ea361..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fs.js +++ /dev/null @@ -1,187 +0,0 @@ -import response from "./response"; -import moduleHelper from "./module-helper"; - -//暂存readFile的数据 -const tempCacheObj = {}; - -export default { - /*env*/ - WXGetUserDataPath(){ - return wx.env.USER_DATA_PATH; - }, - WXWriteFileSync(filePath, data, encoding){ - try{ - const fs = wx.getFileSystemManager(); - fs.writeFileSync(filePath, data, encoding) - }catch (e) { - console.error(e); - return e.message; - } - return "ok"; - }, - WXAccessFileSync(filePath){ - try{ - const fs = wx.getFileSystemManager(); - fs.accessSync(filePath); - return "access:ok"; - }catch (e) { - // console.error(e); - return e.message; - } - }, - WXAccessFile(path,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.access({ - path:path, - ...response.handleText(s,f,c) - }); - }, - WXCopyFileSync(src,dst){ - try{ - const fs = wx.getFileSystemManager(); - fs.copyFileSync(src,dst); - return "copyFile:ok"; - }catch (e) { - console.error(e); - return e.message; - } - }, - WXCopyFile(srcPath,destPath,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.copyFile({ - srcPath, - destPath, - ...response.handleText(s,f,c) - }); - }, - WXUnlinkSync(filePath){ - try{ - const fs = wx.getFileSystemManager(); - fs.unlinkSync(filePath); - return "unlink:ok"; - }catch (e) { - console.error(e); - return e.message; - } - }, - WXUnlink(filePath,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.unlink({ - filePath, - ...response.handleText(s,f,c) - }); - }, - WXWriteFile(filePath,data,encoding,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.writeFile({ - filePath, - data:data.buffer, - encoding, - ...response.handleTextLongBack(s,f,c) - }) - }, - WXWriteStringFile(filePath,data,encoding,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.writeFile({ - filePath, - data, - encoding, - ...response.handleTextLongBack(s,f,c) - }) - }, - WXAppendFile(filePath,data,encoding,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.appendFile({ - filePath, - data:data.buffer, - encoding, - ...response.handleTextLongBack(s,f,c) - }) - }, - WXAppendStringFile(filePath,data,encoding,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.appendFile({ - filePath, - data, - encoding, - ...response.handleTextLongBack(s,f,c) - }) - }, - WXWriteBinFileSync(filePath,data,encoding){ - const fs = wx.getFileSystemManager(); - try{ - fs.writeFileSync( - filePath, - data.buffer, - encoding - ) - }catch (e) { - console.error(e); - return e.message; - } - return "ok"; - - }, - WXReadFile(filePath, encoding, callbackId){ - const fs = wx.getFileSystemManager(); - fs.readFile({ - filePath, - encoding, - success(res){ - if(!encoding){ - tempCacheObj[callbackId] = res.data; - } - moduleHelper.send('ReadFileCallback',JSON.stringify({ - callbackId, - errMsg:res.errMsg, - errCode : 0, - byteLength:res.data.byteLength || 0, - data:encoding ? res.data : "" - })); - }, - fail(res){ - moduleHelper.send('ReadFileCallback',JSON.stringify({ - callbackId, - errMsg:res.errMsg, - errCode : 1 - })); - } - }); - }, - WXReadFileSync(filePath,encoding){ - const fs = wx.getFileSystemManager(); - try{ - const res = fs.readFileSync(filePath, encoding); - if(!encoding){ - tempCacheObj[filePath] = res; - return res.byteLength; - }else{ - return res; - } - }catch (e){ - console.error(e); - return ""; - } - }, - WXShareFileBuffer(buffer,offset,callbackId){ - buffer.set(new Uint8Array(tempCacheObj[callbackId]),offset); - delete tempCacheObj[callbackId]; - }, - WXMkdir(dirPath,recursive,s,f,c){ - const fs = wx.getFileSystemManager(); - fs.mkdir({ - dirPath, - recursive:Boolean(recursive), - ...response.handleText(s,f,c) - }); - }, - WXMkdirSync(dirPath,recursive){ - try{ - const fs = wx.getFileSystemManager(); - fs.mkdirSync(dirPath,Boolean(recursive)); - return "mkdir:ok"; - }catch (e) { - return e.message; - } - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fs.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fs.js.meta deleted file mode 100644 index f35fe97b..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/fs.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6f1ca54f6d57eb240871640481b18d78 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/game-club.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/game-club.js deleted file mode 100644 index 4bb9824d..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/game-club.js +++ /dev/null @@ -1,86 +0,0 @@ -import moduleHelper from "./module-helper"; -const gameClubs = {}; -const msg = 'GameClubButton不存在'; -function printErrMsg(id) { - console.error(msg, id); -} -const typeEnum = { - 0: 'text', - 1: 'image', -} -const iconEnum = { - 0: 'green', - 1: 'white', - 2: 'dark', - 3: 'light' -} -export default { - WXCreateGameClubButton(conf) { - const config = JSON.parse(conf); - config.style = JSON.parse(config.styleRaw); - if (config.style.fontSize === 0) { - config.style.fontSize = undefined; - } - config.type = typeEnum[config.type]; - config.icon = iconEnum[config.icon]; - const id = new Date().getTime().toString(32)+Math.random().toString(32); - gameClubs[id] = wx.createGameClubButton(config); - return id; - }, - WXGameClubButtonDestroy(id) { - if (gameClubs[id]) { - gameClubs[id].destroy(); - delete gameClubs[id]; - } else { - printErrMsg(id); - } - }, - WXGameClubButtonHide(id) { - if (gameClubs[id]) { - gameClubs[id].hide(); - } else { - printErrMsg(id); - } - }, - WXGameClubButtonShow(id) { - if (gameClubs[id]) { - gameClubs[id].show(); - } else { - printErrMsg(id); - } - }, - WXGameClubButtonAddListener(id, key) { - if (gameClubs[id]) { - gameClubs[id][key](function(e) { - moduleHelper.send('OnGameClubButtonCallback', JSON.stringify({ - callbackId: id, - errMsg: key - })); - }) - } else { - printErrMsg(id); - } - }, - WXGameClubButtonRemoveListener(id, key) { - if (gameClubs[id]) { - gameClubs[id][key](); - } else { - printErrMsg(id); - } - }, - WXGameClubButtonSetProperty(id, key, value) { - if (gameClubs[id]) { - gameClubs[id][key] = value; - } - }, - WXGameClubStyleChangeInt(id, key, value) { - if (gameClubs[id]) { - gameClubs[id]["style"][key] = value; - } - }, - WXGameClubStyleChangeStr(id, key, value) { - if (gameClubs[id]) { - gameClubs[id]["style"][key] = value; - } - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/game-club.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/game-club.js.meta deleted file mode 100644 index a00e780b..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/game-club.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b966c693b5ac04119bb4f424544da1a7 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/index.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/index.js deleted file mode 100755 index 6aa1b97e..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/index.js +++ /dev/null @@ -1,104 +0,0 @@ -import storage from "./storage"; -import userInfo from "./userinfo"; -import moduleHelper from "./module-helper"; -import share from "./share"; -import ad from "./ad"; -import canvasHelper from "./canvas"; -import fs from "./fs"; -import openData from "./open-data"; -import util from "./util"; -import cloud from "./cloud"; -import audio from "./audio"; -import texture from "./texture"; -import fix from "./fix"; -import canvasContext from "./canvas-context"; -import video from "./video"; -import logger from "./logger"; -import shortAudio from "./short-audio"; -import gameClub from "./game-club"; -import sdk from "./sdk"; -import "./unity-adapter"; - -const unityVersion = "$unityVersion$"; -GameGlobal.unityNamespace = GameGlobal.unityNamespace || {}; -GameGlobal.unityNamespace.unityVersion = unityVersion; - -window._ScaleRate = 1; -//兼容unity低版本高清屏的问题 -if(unityVersion && unityVersion.split('.').slice(0,2).join('')<'20193'){ - var width = window.innerWidth*window.devicePixelRatio; - var height = window.innerHeight*window.devicePixelRatio; - canvas.width = width; - canvas.height = height; - window._ScaleRate = window.devicePixelRatio; -} - - -Object.defineProperty(canvas,'clientHeight',{ - get:function(){ - return window.innerHeight * window._ScaleRate; - }, - configuarble:true -}); - -Object.defineProperty(canvas,'clientWidth',{ - get:function(){ - return window.innerWidth * window._ScaleRate; - }, - configuarble:true -}); - -Object.defineProperty(document.body,'clientHeight',{ - get:function(){ - return window.innerHeight * window._ScaleRate; - }, - configuarble:true -}); - -Object.defineProperty(document.body,'clientWidth',{ - get:function(){ - return window.innerWidth * window._ScaleRate; - }, - configuarble:true -}); - -Object.defineProperty(document,'fullscreenEnabled',{ - get:function(){ - return true; - }, - configuarble:true -}); - -fix.init(); - -const WXWASMSDK = { - /* - 初始化 - */ - WXInitializeSDK(){ - moduleHelper.init(); - moduleHelper.send('Inited', 200); - }, - ...storage, - ...userInfo, - ...share, - ...ad, - ...canvasHelper, - ...fs, - ...openData, - ...util, - ...cloud, - ...audio, - ...texture, - ...video, - ...logger, - ...shortAudio, - ...gameClub, - canvasContext, - ...sdk - -}; - - - -GameGlobal.WXWASMSDK = WXWASMSDK; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/index.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/index.js.meta deleted file mode 100644 index 9229efe5..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/index.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ee41d0e40e4776f46927571e5b2a5247 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/logger.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/logger.js deleted file mode 100644 index d40a3de7..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/logger.js +++ /dev/null @@ -1,18 +0,0 @@ -export default { - WXLogManagerDebug(str){ - const logger = wx.getLogManager(); - logger.debug(str); - }, - WXLogManagerInfo(str){ - const logger = wx.getLogManager(); - logger.info(str); - }, - WXLogManagerLog(str){ - const logger = wx.getLogManager(); - logger.log(str); - }, - WXLogManagerWarn(str){ - const logger = wx.getLogManager(); - logger.warn(str); - } -}; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/logger.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/logger.js.meta deleted file mode 100644 index 54de3701..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/logger.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 65ffeffdfe3cd4614871dc4a47d4ebb5 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/module-helper.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/module-helper.js deleted file mode 100755 index 4898345a..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/module-helper.js +++ /dev/null @@ -1,14 +0,0 @@ -import { moduleName } from './conf'; - -export default { - _send: null, - init() { - this._send = GameGlobal.Module.SendMessage; - }, - send(method, str) { - if (!this._send) { - this.init(); - } - this._send(moduleName, method, str); - }, -}; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/module-helper.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/module-helper.js.meta deleted file mode 100644 index 5694792f..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/module-helper.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 562586d78ced2b54b9b4173d963768c0 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/open-data.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/open-data.js deleted file mode 100644 index 56ce4da4..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/open-data.js +++ /dev/null @@ -1,65 +0,0 @@ -import response from "./response"; - -let needRenderOpenData = false; -let textureId= ''; -let runningTaskId = 0; -let textureObject; -function createTextureByImgObject(){ - var webgl = GameGlobal.manager.gameInstance.Module.GL.currentContext.GLctx; - let openDataContext = wx.getOpenDataContext(); - let sharedCanvas = openDataContext.canvas; - if(!textureObject){ - textureObject = webgl.createTexture(); - } - webgl.bindTexture(webgl.TEXTURE_2D, textureObject); - webgl.texImage2D(webgl.TEXTURE_2D, 0, webgl.RGBA, webgl.RGBA, webgl.UNSIGNED_BYTE, sharedCanvas); - webgl.texParameteri(webgl.TEXTURE_2D, webgl.TEXTURE_MIN_FILTER, webgl.LINEAR); - webgl.texParameteri(webgl.TEXTURE_2D, webgl.TEXTURE_MAG_FILTER, webgl.LINEAR); - webgl.texParameteri(webgl.TEXTURE_2D, webgl.TEXTURE_WRAP_S, webgl.CLAMP_TO_EDGE); - webgl.texParameteri(webgl.TEXTURE_2D, webgl.TEXTURE_WRAP_T, webgl.CLAMP_TO_EDGE); - return textureObject; -} -export default { - WXDataContextPostMessage(msg){ - var openDataContext = wx.getOpenDataContext(); - openDataContext.postMessage(msg); - }, - WXShowOpenData(id,x,y,width,height){ - const taskId = new Date().getTime(); - runningTaskId = taskId; //这里保存一个id是为了避免两次 - let openDataContext = wx.getOpenDataContext(); - let sharedCanvas = openDataContext.canvas; - sharedCanvas.width = width; - sharedCanvas.height = height; - openDataContext.postMessage({ - type:"WXRender", - x: x, - y: y, - width: width, - height: height, - devicePixelRatio:window.devicePixelRatio - }); - const manager = GameGlobal.manager; - needRenderOpenData = true; - renderTexture(); - textureId = id; - function renderTexture(){ - if(needRenderOpenData && runningTaskId === taskId){ - manager.gameInstance.Module.GL.textures[id] = createTextureByImgObject(); - manager.gameInstance.Module.requestAnimationFrame(renderTexture); - } - } - }, - WXHideOpenData(){ - needRenderOpenData = false; - let openDataContext = wx.getOpenDataContext(); - let sharedCanvas = openDataContext.canvas; - openDataContext.postMessage({ - type:"WXDestroy" - }); - sharedCanvas.width = 10; - sharedCanvas.height = 10; - manager.gameInstance.Module.GL.textures[textureId] = createTextureByImgObject(); - textureObject = null; - }, -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/open-data.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/open-data.js.meta deleted file mode 100644 index eda1be56..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/open-data.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 66b26d67858847941b3cd95669f4fc62 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/resType.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/resType.js deleted file mode 100644 index aaf1fbff..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/resType.js +++ /dev/null @@ -1,765 +0,0 @@ -export default { - AccountInfo:{ - miniProgram:"MiniProgram", - plugin:"Plugin", - }, - MiniProgram:{ - appId:"string", - envVersion:"string", - version:"string", - }, - Plugin:{ - appId:"string", - version:"string", - }, - GetBatteryInfoSyncResult:{ - isCharging:"bool", - level:"int", - }, - EnterOptionsGame:{ - query:"object", - referrerInfo:"EnterOptionsGameReferrerInfo", - scene:"int", - chatType:"int", - shareTicket:"string", - }, - EnterOptionsGameReferrerInfo:{ - appId:"string", - extraData:"object", - gameLiveInfo:"GameLiveInfo", - }, - GameLiveInfo:{ - streamerOpenId:"string", - feedId:"string", - }, - LaunchOptionsGame:{ - query:"object", - referrerInfo:"EnterOptionsGameReferrerInfo", - scene:"int", - chatType:"int", - shareTicket:"string", - }, - ClientRect:{ - bottom:"int", - height:"int", - left:"int", - right:"int", - top:"int", - width:"int", - }, - GetStorageInfoSyncOption:{ - currentSize:"int", - keys:"array", - limitSize:"int", - }, - SystemInfo:{ - SDKVersion:"string", - albumAuthorized:"bool", - benchmarkLevel:"int", - bluetoothEnabled:"bool", - brand:"string", - cameraAuthorized:"bool", - deviceOrientation:"string", - enableDebug:"bool", - fontSizeSetting:"int", - host:"Host", - language:"string", - locationAuthorized:"bool", - locationEnabled:"bool", - locationReducedAccuracy:"bool", - microphoneAuthorized:"bool", - model:"string", - notificationAlertAuthorized:"bool", - notificationAuthorized:"bool", - notificationBadgeAuthorized:"bool", - notificationSoundAuthorized:"bool", - phoneCalendarAuthorized:"bool", - pixelRatio:"int", - platform:"string", - safeArea:"SafeArea", - screenHeight:"int", - screenWidth:"int", - statusBarHeight:"int", - system:"string", - version:"string", - wifiEnabled:"bool", - windowHeight:"int", - windowWidth:"int", - theme:"string", - }, - Host:{ - appId:"string", - }, - SafeArea:{ - bottom:"int", - height:"int", - left:"int", - right:"int", - top:"int", - width:"int", - }, - OnCheckForUpdateCallbackResult:{ - hasUpdate:"bool", - }, - GeneralCallbackResult:{ - errMsg:"string", - }, - SetMessageToFriendQueryOption:{ - shareMessageToFriendScene:"int", - }, - AddCardRequestInfo:{ - cardExt:"string", - cardId:"string", - }, - AddCardSuccessCallbackResult:{ - cardList:"array", - errMsg:"string", - }, - AddCardResponseInfo:{ - cardExt:"string", - cardId:"string", - code:"string", - isSuccess:"bool", - }, - AuthPrivateMessageSuccessCallbackResult:{ - encryptedData:"string", - errMsg:"string", - iv:"string", - valid:"bool", - }, - CheckHandoffEnabledSuccessCallbackResult:{ - errCode:"int", - isEnabled:"bool", - errMsg:"string", - }, - CheckIsUserAdvisedToRestSuccessCallbackResult:{ - result:"bool", - errMsg:"string", - }, - ChooseImageSuccessCallbackResult:{ - tempFilePaths:"array", - tempFiles:"array", - errMsg:"string", - }, - ImageFile:{ - path:"string", - size:"int", - }, - BluetoothError:{ - errMsg:"string", - errCode:"int", - }, - CreateBLEPeripheralServerSuccessCallbackResult:{ - server:"BLEPeripheralServer", - errMsg:"string", - }, - BLEPeripheralService:{ - characteristics:"array", - uuid:"string", - }, - Characteristic:{ - uuid:"string", - descriptors:"array", - permission:"CharacteristicPermission", - properties:"CharacteristicProperties", - value:"array", - }, - Descriptor:{ - uuid:"string", - permission:"DescriptorPermission", - value:"array", - }, - DescriptorPermission:{ - read:"bool", - write:"bool", - }, - CharacteristicPermission:{ - readEncryptionRequired:"bool", - readable:"bool", - writeEncryptionRequired:"bool", - writeable:"bool", - }, - CharacteristicProperties:{ - indicate:"bool", - notify:"bool", - read:"bool", - write:"bool", - writeNoResponse:"bool", - }, - OnCharacteristicReadRequestCallbackResult:{ - callbackId:"int", - characteristicId:"string", - serviceId:"string", - }, - OnCharacteristicSubscribedCallbackResult:{ - characteristicId:"string", - serviceId:"string", - }, - OnCharacteristicWriteRequestCallbackResult:{ - callbackId:"int", - characteristicId:"string", - serviceId:"string", - value:"array", - }, - AdvertiseReqObj:{ - beacon:"BeaconInfoObj", - connectable:"bool", - deviceName:"string", - manufacturerData:"array", - serviceUuids:"array", - }, - BeaconInfoObj:{ - major:"int", - minor:"int", - uuid:"string", - measuredPower:"int", - }, - ManufacturerData:{ - manufacturerId:"string", - manufacturerSpecificData:"array", - }, - FaceDetectSuccessCallbackResult:{ - angleArray:"FaceAngel", - confArray:"FaceConf", - detectRect:"object", - faceInfo:"array", - pointArray:"array", - x:"int", - y:"int", - errMsg:"string", - }, - FaceAngel:{ - pitch:"int", - roll:"int", - yaw:"int", - }, - FaceConf:{ - global:"int", - leftEye:"int", - mouth:"int", - nose:"int", - rightEye:"int", - }, - GetAvailableAudioSourcesSuccessCallbackResult:{ - errMsg:"string", - }, - GetBLEDeviceCharacteristicsSuccessCallbackResult:{ - characteristics:"array", - errMsg:"string", - }, - BLECharacteristic:{ - properties:"BLECharacteristicProperties", - uuid:"string", - }, - BLECharacteristicProperties:{ - indicate:"bool", - notify:"bool", - read:"bool", - write:"bool", - }, - GetBLEDeviceRSSISuccessCallbackResult:{ - RSSI:"int", - errMsg:"string", - }, - GetBLEDeviceServicesSuccessCallbackResult:{ - services:"array", - errMsg:"string", - }, - BLEService:{ - isPrimary:"bool", - uuid:"string", - }, - GetBLEMTUSuccessCallbackResult:{ - mtu:"int", - errMsg:"string", - }, - GetBatteryInfoSuccessCallbackResult:{ - isCharging:"bool", - level:"int", - errMsg:"string", - }, - BeaconError:{ - errMsg:"string", - errCode:"int", - }, - GetBeaconsSuccessCallbackResult:{ - beacons:"array", - errMsg:"string", - }, - BeaconInfo:{ - accuracy:"int", - major:"int", - minor:"int", - proximity:"int", - rssi:"int", - uuid:"string", - }, - GetBluetoothAdapterStateSuccessCallbackResult:{ - available:"bool", - discovering:"bool", - errMsg:"string", - }, - GetBluetoothDevicesSuccessCallbackResult:{ - devices:"array", - errMsg:"string", - }, - BlueToothDevice:{ - RSSI:"int", - advertisData:"array", - advertisServiceUUIDs:"array", - deviceId:"string", - localName:"string", - name:"string", - serviceData:"object", - }, - GetChannelsLiveInfoSuccessCallbackResult:{ - description:"string", - feedId:"string", - headUrl:"string", - nickname:"string", - nonceId:"string", - status:"int", - errMsg:"string", - }, - GetChannelsLiveNoticeInfoSuccessCallbackResult:{ - headUrl:"string", - nickname:"string", - noticeId:"string", - reservable:"bool", - startTime:"string", - status:"int", - errMsg:"string", - }, - GetClipboardDataSuccessCallbackOption:{ - data:"string", - }, - GetConnectedBluetoothDevicesSuccessCallbackResult:{ - devices:"array", - errMsg:"string", - }, - BluetoothDeviceInfo:{ - deviceId:"string", - name:"string", - }, - GetExtConfigSuccessCallbackResult:{ - extConfig:"object", - errMsg:"string", - }, - WxGetFileInfoSuccessCallbackResult:{ - digest:"string", - size:"int", - errMsg:"string", - }, - GetFriendCloudStorageSuccessCallbackResult:{ - data:"array", - errMsg:"string", - }, - UserGameData:{ - KVDataList:"array", - avatarUrl:"string", - nickname:"string", - openid:"string", - }, - KVData:{ - key:"string", - value:"string", - }, - GetGroupCloudStorageSuccessCallbackResult:{ - data:"array", - errMsg:"string", - }, - GetGroupEnterInfoSuccessCallbackResult:{ - cloudID:"string", - encryptedData:"string", - errMsg:"string", - iv:"string", - }, - GetGroupInfoSuccessCallbackResult:{ - name:"string", - errMsg:"string", - }, - GetLocalIPAddressSuccessCallbackResult:{ - errMsg:"string", - localip:"string", - }, - GetLocationSuccessCallbackResult:{ - accuracy:"int", - altitude:"int", - horizontalAccuracy:"int", - latitude:"int", - longitude:"int", - speed:"int", - verticalAccuracy:"int", - errMsg:"string", - }, - GetNetworkTypeSuccessCallbackResult:{ - networkType:"string", - signalStrength:"int", - errMsg:"string", - }, - GetPotentialFriendListSuccessCallbackResult:{ - list:"array", - errMsg:"string", - }, - FriendInfo:{ - avatarUrl:"string", - nickname:"string", - openid:"string", - }, - GetScreenBrightnessSuccessCallbackOption:{ - value:"int", - }, - GetSettingSuccessCallbackResult:{ - authSetting:"AuthSetting", - subscriptionsSetting:"SubscriptionsSetting", - miniprogramAuthSetting:"AuthSetting", - errMsg:"string", - }, - AuthSetting:{ - }, - SubscriptionsSetting:{ - mainSwitch:"bool", - itemSettings:"object", - }, - GetStorageInfoSuccessCallbackOption:{ - currentSize:"int", - keys:"array", - limitSize:"int", - }, - GetUserCloudStorageSuccessCallbackResult:{ - KVDataList:"array", - errMsg:"string", - }, - GetUserCloudStorageKeysSuccessCallbackResult:{ - keys:"array", - errMsg:"string", - }, - GetUserInfoSuccessCallbackResult:{ - cloudID:"string", - encryptedData:"string", - iv:"string", - rawData:"string", - signature:"string", - userInfo:"UserInfo", - errMsg:"string", - }, - UserInfo:{ - avatarUrl:"string", - city:"string", - country:"string", - gender:"int", - language:"string", - nickName:"string", - province:"string", - }, - GetUserInteractiveStorageFailCallbackResult:{ - errCode:"int", - errMsg:"string", - }, - GetUserInteractiveStorageSuccessCallbackResult:{ - cloudID:"string", - encryptedData:"string", - errMsg:"string", - iv:"string", - }, - GetWeRunDataSuccessCallbackResult:{ - cloudID:"string", - encryptedData:"string", - iv:"string", - errMsg:"string", - }, - JoinVoIPChatError:{ - errMsg:"string", - errCode:"int", - }, - MuteConfig:{ - muteEarphone:"bool", - muteMicrophone:"bool", - }, - JoinVoIPChatSuccessCallbackResult:{ - errCode:"int", - errMsg:"string", - openIdList:"array", - }, - LoginSuccessCallbackResult:{ - code:"string", - errMsg:"string", - }, - ModifyFriendInteractiveStorageFailCallbackResult:{ - errCode:"int", - errMsg:"string", - }, - OnAccelerometerChangeCallbackResult:{ - x:"int", - y:"int", - z:"int", - }, - OnAddToFavoritesCallbackResult:{ - disableForward:"bool", - imageUrl:"string", - query:"string", - title:"string", - }, - OnBLECharacteristicValueChangeCallbackResult:{ - characteristicId:"string", - deviceId:"string", - serviceId:"string", - value:"array", - }, - OnBLEConnectionStateChangeCallbackResult:{ - connected:"bool", - deviceId:"string", - }, - OnBLEMTUChangeCallbackResult:{ - deviceId:"string", - mtu:"int", - }, - OnBLEPeripheralConnectionStateChangedCallbackResult:{ - connected:"bool", - deviceId:"string", - serverId:"string", - }, - OnBeaconServiceChangeCallbackResult:{ - available:"bool", - discovering:"bool", - }, - OnBeaconUpdateCallbackResult:{ - beacons:"array", - }, - OnBluetoothAdapterStateChangeCallbackResult:{ - available:"bool", - discovering:"bool", - }, - OnBluetoothDeviceFoundCallbackResult:{ - devices:"array", - }, - OnCompassChangeCallbackResult:{ - accuracy:"int", - direction:"int", - }, - OnCopyUrlCallbackResult:{ - query:"string", - }, - OnDeviceMotionChangeCallbackResult:{ - alpha:"int", - beta:"int", - gamma:"int", - }, - OnDeviceOrientationChangeCallbackResult:{ - value:"string", - }, - WxOnErrorCallbackResult:{ - message:"string", - stack:"string", - }, - OnGyroscopeChangeCallbackResult:{ - x:"int", - y:"int", - z:"int", - }, - OnHandoffCallbackResult:{ - query:"string", - }, - OnKeyDownCallbackResult:{ - code:"string", - key:"string", - timeStamp:"int", - }, - OnKeyboardInputCallbackResult:{ - value:"string", - }, - OnKeyboardHeightChangeCallbackResult:{ - height:"int", - }, - OnMemoryWarningCallbackResult:{ - level:"int", - }, - OnNetworkStatusChangeCallbackResult:{ - isConnected:"bool", - networkType:"string", - }, - OnNetworkWeakChangeCallbackResult:{ - networkType:"string", - weakNet:"bool", - }, - OnShareTimelineCallbackResult:{ - imageUrl:"string", - imagePreviewUrl:"string", - imagePreviewUrlId:"string", - imageUrlId:"string", - path:"string", - query:"string", - title:"string", - }, - OnShowCallbackResult:{ - query:"object", - referrerInfo:"ResultReferrerInfo", - scene:"int", - shareTicket:"string", - }, - ResultReferrerInfo:{ - appId:"string", - extraData:"object", - }, - SocketTaskOnCloseCallbackResult:{ - code:"int", - reason:"string", - }, - SocketTaskOnMessageCallbackResult:{ - data:"string", - }, - OnSocketOpenCallbackResult:{ - header:"object", - }, - OnTouchStartCallbackResult:{ - changedTouches:"array", - timeStamp:"int", - touches:"array", - }, - Touch:{ - clientX:"int", - clientY:"int", - force:"int", - identifier:"int", - pageX:"int", - pageY:"int", - }, - OnUnhandledRejectionCallbackResult:{ - promise:"string", - reason:"string", - }, - OnVoIPChatInterruptedCallbackResult:{ - errCode:"int", - errMsg:"string", - }, - OnVoIPChatMembersChangedCallbackResult:{ - errCode:"int", - errMsg:"string", - openIdList:"array", - }, - OnVoIPChatSpeakersChangedCallbackResult:{ - errCode:"int", - errMsg:"string", - openIdList:"array", - }, - OnVoIPChatStateChangedCallbackResult:{ - code:"int", - data:"object", - errCode:"int", - errMsg:"string", - }, - OnWindowResizeCallbackResult:{ - windowHeight:"int", - windowWidth:"int", - }, - OpenCardRequestInfo:{ - cardId:"string", - code:"string", - }, - OpenSettingSuccessCallbackResult:{ - authSetting:"AuthSetting", - subscriptionsSetting:"SubscriptionsSetting", - errMsg:"string", - }, - MediaSource:{ - url:"string", - poster:"string", - type:"string", - }, - ReportUserBehaviorBranchAnalyticsOption:{ - branchId:"string", - eventType:"int", - branchDim:"string", - }, - MidasFriendPaymentError:{ - errMsg:"string", - errCode:"int", - }, - RequestMidasFriendPaymentSuccessCallbackResult:{ - cloudID:"string", - encryptedData:"string", - errMsg:"string", - iv:"string", - }, - MidasPaymentError:{ - errMsg:"string", - errCode:"int", - }, - RequestSubscribeMessageFailCallbackResult:{ - errCode:"int", - errMsg:"string", - }, - RequestSubscribeMessageSuccessCallbackResult:{ - errMsg:"string", - }, - RequestSubscribeSystemMessageSuccessCallbackResult:{ - errMsg:"string", - }, - ReserveChannelsLiveOption:{ - noticeId:"string", - }, - ScanCodeSuccessCallbackResult:{ - charSet:"string", - path:"string", - rawData:"string", - result:"string", - scanType:"string", - errMsg:"string", - }, - SetBLEMTUFailCallbackResult:{ - mtu:"int", - }, - SetBLEMTUSuccessCallbackResult:{ - mtu:"int", - errMsg:"string", - }, - ShareAppMessageOption:{ - imageUrl:"string", - imageUrlId:"string", - path:"string", - query:"string", - title:"string", - toCurrentGroup:"bool", - }, - ShowActionSheetSuccessCallbackResult:{ - tapIndex:"int", - errMsg:"string", - }, - ShowModalSuccessCallbackResult:{ - cancel:"bool", - confirm:"bool", - content:"string", - errMsg:"string", - }, - UpdatableMessageFrontEndTemplateInfo:{ - parameterList:"array", - }, - UpdatableMessageFrontEndParameter:{ - name:"string", - value:"string", - }, - CheckGameLiveEnabledSuccessCallbackOption:{ - errMsg:"string", - isEnabled:"bool", - }, - OnGameLiveStateChangeCallbackResult:{ - state:"string", - feedId:"string", - }, - OnGameLiveStateChangeCallbackResponse:{ - query:"string", - }, - GameLiveState:{ - isLive:"bool", - }, - GetUserCurrentGameliveInfoSuccessCallbackOption:{ - feedIdList:"array", - }, - GetUserGameLiveDetailsSuccessCallbackOption:{ - encryptedData:"string", - iv:"string", - cloudID:"string", - feedIdList:"array", - errMsg:"string", - }, -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/resType.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/resType.js.meta deleted file mode 100644 index 206fbe2f..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/resType.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d6ab0a5fe59434d73a168a99fddba326 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/response.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/response.js deleted file mode 100755 index d1bc394c..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/response.js +++ /dev/null @@ -1,99 +0,0 @@ -import moduleHelper from "./module-helper"; - -export default { - handleText(s,f,c){ - const self = this; - return { - success(res){ - self.textFormat(s,res); - }, - fail(res){ - self.textFormat(f,res); - }, - complete(res){ - self.textFormat(c,res); - } - } - }, - handleTextLongBack(s,f,c){ - const self = this; - return { - success(res){ - self.textFormatLongBack(s,res); - }, - fail(res){ - self.textFormatLongBack(f,res); - }, - complete(res){ - self.textFormatLongBack(c,res); - } - } - }, - textFormat(id,res){ - if(!id){ - return false; - } - moduleHelper.send('TextResponseCallback', JSON.stringify({ - callbackId:id, - errMsg:res.errMsg, - errCode:res.errCode - })); - }, - textFormatLongBack(id,res){ - if(!id){ - return false; - } - moduleHelper.send('TextResponseLongCallback', JSON.stringify({ - callbackId:id, - errMsg:res.errMsg, - errCode:res.errCode - })); - }, - handlecloudCallFunction(s,f,c){ - const self = this; - return { - success(res){ - self.cloudCallFunctionFormat(s,res); - }, - fail(res){ - self.cloudCallFunctionFormat(f,res); - }, - complete(res){ - self.cloudCallFunctionFormat(c,res); - } - } - }, - cloudCallFunctionFormat(id,res){ - if(!id){ - return false; - } - moduleHelper.send('CloudCallFunctionResponseCallback', JSON.stringify({ - callbackId:id, - errMsg:res.errMsg, - result:typeof res.result === "object" ? JSON.stringify(res.result) : res.result, - requestID:res.requestID - })); - }, - handle(formatFunc,s,f,c){ - return { - success(res){ - if(!s){ - return false; - } - formatFunc(s,res); - }, - fail(res){ - if(!f){ - return false; - } - formatFunc(f,res); - }, - complete(res){ - if(!c){ - return false; - } - formatFunc(c,res); - } - } - }, -}; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/response.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/response.js.meta deleted file mode 100644 index b3dfdf24..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/response.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 4ee750881e8374549b97b612f953c2b9 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/sdk.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/sdk.js deleted file mode 100644 index 8ceb2c4a..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/sdk.js +++ /dev/null @@ -1,4070 +0,0 @@ -import ResType from "./resType"; -import moduleHelper from "./module-helper"; - -var identifierCache = []; - -function formatIdentifier(identifier){ - if(Math.abs(identifier)<2147483648){ - return Math.round(identifier); - } - for(var key in identifierCache){ - if(identifierCache[key] && identifierCache[key].key === identifier){ - return identifierCache[key].value; - } - } - var value = parseInt(Math.random()*2147483648); - while(identifierCache.some(v=>v.value === value)){ - value++; - } - identifierCache.push({ - key:identifier, - value - }); - if(identifierCache.length>30){ - identifierCache.shift(); - } - return value; -} - -function formatTouchEvent(v){ - //这里将坐标转换为Unity的坐标 - return { - identifier:formatIdentifier(v.identifier), - clientX : v.clientX * devicePixelRatio, - clientY :(window.innerHeight - v.clientY) * devicePixelRatio, - pageX : v.pageX * devicePixelRatio, - pageY : (window.innerHeight - v.pageY) * devicePixelRatio - } -} - -function formatResponse(type,data){ - let conf = ResType[type]; - let typeMap = { "array":[],"string":"","int":0,"bool":false,"object":{} }; - if(!conf){ - return; - } - if(conf && !data){ - data = {}; - } - for(var key in conf){ - if(data[key] == null){ - if(typeof typeMap[conf[key]] ==="undefined"){ - data[key] = {}; - if(ResType[conf[key]]){ - formatResponse(conf[key],data[key]) - } - }else{ - data[key] = typeMap[conf[key]]; - } - }else if(typeof data[key] == "object" && ResType[conf[key]]){ - formatResponse(conf[key],data[key]) - }else if(typeof data[key] == "object" && conf[key] === "object"){ - Object.keys(data[key]).forEach(v=>{ - data[key][v] += ''; - }); - } - } -} - -function formatJsonStr(str){ - if(!str){ - return {}; - } - let conf = JSON.parse(str); - var keys = Object.keys(conf); - keys.forEach(v=>{ - if(conf[v] === null){ - delete conf[v]; - } - }); - return conf; -} - -export default { - WX_AddCard(conf, callbackId){ - conf = formatJsonStr(conf); - wx.addCard({ - ...conf, - success(res){ - formatResponse("AddCardSuccessCallbackResult",res); - moduleHelper.send('AddCardCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('AddCardCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('AddCardCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_AuthPrivateMessage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.authPrivateMessage({ - ...conf, - success(res){ - formatResponse("AuthPrivateMessageSuccessCallbackResult",res); - moduleHelper.send('AuthPrivateMessageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('AuthPrivateMessageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('AuthPrivateMessageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_Authorize(conf, callbackId){ - conf = formatJsonStr(conf); - wx.authorize({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('AuthorizeCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('AuthorizeCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('AuthorizeCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CheckHandoffEnabled(conf, callbackId){ - conf = formatJsonStr(conf); - wx.checkHandoffEnabled({ - ...conf, - success(res){ - formatResponse("CheckHandoffEnabledSuccessCallbackResult",res); - moduleHelper.send('CheckHandoffEnabledCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckHandoffEnabledCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckHandoffEnabledCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CheckIsUserAdvisedToRest(conf, callbackId){ - conf = formatJsonStr(conf); - wx.checkIsUserAdvisedToRest({ - ...conf, - success(res){ - formatResponse("CheckIsUserAdvisedToRestSuccessCallbackResult",res); - moduleHelper.send('CheckIsUserAdvisedToRestCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckIsUserAdvisedToRestCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckIsUserAdvisedToRestCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CheckSession(conf, callbackId){ - conf = formatJsonStr(conf); - wx.checkSession({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckSessionCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckSessionCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckSessionCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ChooseImage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.chooseImage({ - ...conf, - success(res){ - formatResponse("ChooseImageSuccessCallbackResult",res); - moduleHelper.send('ChooseImageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ChooseImageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ChooseImageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CloseBLEConnection(conf, callbackId){ - conf = formatJsonStr(conf); - wx.closeBLEConnection({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CloseBLEConnectionCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CloseBLEConnectionCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CloseBLEConnectionCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CloseBluetoothAdapter(conf, callbackId){ - conf = formatJsonStr(conf); - wx.closeBluetoothAdapter({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CloseBluetoothAdapterCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CloseBluetoothAdapterCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CloseBluetoothAdapterCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CloseSocket(conf, callbackId){ - conf = formatJsonStr(conf); - wx.closeSocket({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CloseSocketCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CloseSocketCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CloseSocketCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CreateBLEConnection(conf, callbackId){ - conf = formatJsonStr(conf); - wx.createBLEConnection({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CreateBLEConnectionCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CreateBLEConnectionCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('CreateBLEConnectionCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CreateBLEPeripheralServer(conf, callbackId){ - conf = formatJsonStr(conf); - wx.createBLEPeripheralServer({ - ...conf, - success(res){ - formatResponse("CreateBLEPeripheralServerSuccessCallbackResult",res); - moduleHelper.send('CreateBLEPeripheralServerCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CreateBLEPeripheralServerCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CreateBLEPeripheralServerCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ExitMiniProgram(conf, callbackId){ - conf = formatJsonStr(conf); - wx.exitMiniProgram({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ExitMiniProgramCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ExitMiniProgramCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ExitMiniProgramCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ExitVoIPChat(conf, callbackId){ - conf = formatJsonStr(conf); - wx.exitVoIPChat({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ExitVoIPChatCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ExitVoIPChatCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ExitVoIPChatCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_FaceDetect(conf, callbackId){ - conf = formatJsonStr(conf); - wx.faceDetect({ - ...conf, - success(res){ - formatResponse("FaceDetectSuccessCallbackResult",res); - moduleHelper.send('FaceDetectCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('FaceDetectCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('FaceDetectCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetAvailableAudioSources(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getAvailableAudioSources({ - ...conf, - success(res){ - formatResponse("GetAvailableAudioSourcesSuccessCallbackResult",res); - moduleHelper.send('GetAvailableAudioSourcesCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetAvailableAudioSourcesCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetAvailableAudioSourcesCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBLEDeviceCharacteristics(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBLEDeviceCharacteristics({ - ...conf, - success(res){ - formatResponse("GetBLEDeviceCharacteristicsSuccessCallbackResult",res); - moduleHelper.send('GetBLEDeviceCharacteristicsCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBLEDeviceCharacteristicsCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBLEDeviceCharacteristicsCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBLEDeviceRSSI(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBLEDeviceRSSI({ - ...conf, - success(res){ - formatResponse("GetBLEDeviceRSSISuccessCallbackResult",res); - moduleHelper.send('GetBLEDeviceRSSICallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetBLEDeviceRSSICallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetBLEDeviceRSSICallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBLEDeviceServices(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBLEDeviceServices({ - ...conf, - success(res){ - formatResponse("GetBLEDeviceServicesSuccessCallbackResult",res); - moduleHelper.send('GetBLEDeviceServicesCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBLEDeviceServicesCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBLEDeviceServicesCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBLEMTU(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBLEMTU({ - ...conf, - success(res){ - formatResponse("GetBLEMTUSuccessCallbackResult",res); - moduleHelper.send('GetBLEMTUCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBLEMTUCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBLEMTUCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBatteryInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBatteryInfo({ - ...conf, - success(res){ - formatResponse("GetBatteryInfoSuccessCallbackResult",res); - moduleHelper.send('GetBatteryInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetBatteryInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetBatteryInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBeacons(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBeacons({ - ...conf, - success(res){ - formatResponse("GetBeaconsSuccessCallbackResult",res); - moduleHelper.send('GetBeaconsCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BeaconError",res); - moduleHelper.send('GetBeaconsCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BeaconError",res); - moduleHelper.send('GetBeaconsCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBluetoothAdapterState(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBluetoothAdapterState({ - ...conf, - success(res){ - formatResponse("GetBluetoothAdapterStateSuccessCallbackResult",res); - moduleHelper.send('GetBluetoothAdapterStateCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBluetoothAdapterStateCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBluetoothAdapterStateCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetBluetoothDevices(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getBluetoothDevices({ - ...conf, - success(res){ - formatResponse("GetBluetoothDevicesSuccessCallbackResult",res); - moduleHelper.send('GetBluetoothDevicesCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBluetoothDevicesCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetBluetoothDevicesCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetChannelsLiveInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getChannelsLiveInfo({ - ...conf, - success(res){ - formatResponse("GetChannelsLiveInfoSuccessCallbackResult",res); - moduleHelper.send('GetChannelsLiveInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetChannelsLiveInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetChannelsLiveInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetChannelsLiveNoticeInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getChannelsLiveNoticeInfo({ - ...conf, - success(res){ - formatResponse("GetChannelsLiveNoticeInfoSuccessCallbackResult",res); - moduleHelper.send('GetChannelsLiveNoticeInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetChannelsLiveNoticeInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetChannelsLiveNoticeInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetClipboardData(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getClipboardData({ - ...conf, - success(res){ - formatResponse("GetClipboardDataSuccessCallbackOption",res); - moduleHelper.send('GetClipboardDataCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetClipboardDataCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetClipboardDataCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetConnectedBluetoothDevices(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getConnectedBluetoothDevices({ - ...conf, - success(res){ - formatResponse("GetConnectedBluetoothDevicesSuccessCallbackResult",res); - moduleHelper.send('GetConnectedBluetoothDevicesCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetConnectedBluetoothDevicesCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('GetConnectedBluetoothDevicesCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetExtConfig(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getExtConfig({ - ...conf, - success(res){ - formatResponse("GetExtConfigSuccessCallbackResult",res); - moduleHelper.send('GetExtConfigCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetExtConfigCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetExtConfigCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetFileInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getFileInfo({ - ...conf, - success(res){ - formatResponse("WxGetFileInfoSuccessCallbackResult",res); - moduleHelper.send('GetFileInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetFileInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetFileInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetFriendCloudStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getFriendCloudStorage({ - ...conf, - success(res){ - formatResponse("GetFriendCloudStorageSuccessCallbackResult",res); - moduleHelper.send('GetFriendCloudStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetFriendCloudStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetFriendCloudStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetGroupCloudStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getGroupCloudStorage({ - ...conf, - success(res){ - formatResponse("GetGroupCloudStorageSuccessCallbackResult",res); - moduleHelper.send('GetGroupCloudStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetGroupCloudStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetGroupCloudStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetGroupEnterInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getGroupEnterInfo({ - ...conf, - success(res){ - formatResponse("GetGroupEnterInfoSuccessCallbackResult",res); - moduleHelper.send('GetGroupEnterInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetGroupEnterInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetGroupEnterInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetGroupInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getGroupInfo({ - ...conf, - success(res){ - formatResponse("GetGroupInfoSuccessCallbackResult",res); - moduleHelper.send('GetGroupInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetGroupInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetGroupInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetLocalIPAddress(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getLocalIPAddress({ - ...conf, - success(res){ - formatResponse("GetLocalIPAddressSuccessCallbackResult",res); - moduleHelper.send('GetLocalIPAddressCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetLocalIPAddressCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetLocalIPAddressCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetLocation(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getLocation({ - ...conf, - success(res){ - formatResponse("GetLocationSuccessCallbackResult",res); - moduleHelper.send('GetLocationCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetLocationCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetLocationCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetNetworkType(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getNetworkType({ - ...conf, - success(res){ - formatResponse("GetNetworkTypeSuccessCallbackResult",res); - moduleHelper.send('GetNetworkTypeCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetNetworkTypeCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetNetworkTypeCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetPotentialFriendList(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getPotentialFriendList({ - ...conf, - success(res){ - formatResponse("GetPotentialFriendListSuccessCallbackResult",res); - moduleHelper.send('GetPotentialFriendListCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetPotentialFriendListCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetPotentialFriendListCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetScreenBrightness(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getScreenBrightness({ - ...conf, - success(res){ - formatResponse("GetScreenBrightnessSuccessCallbackOption",res); - moduleHelper.send('GetScreenBrightnessCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetScreenBrightnessCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetScreenBrightnessCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetSetting(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getSetting({ - ...conf, - success(res){ - formatResponse("GetSettingSuccessCallbackResult",res); - moduleHelper.send('GetSettingCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetSettingCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetSettingCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetShareInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getShareInfo({ - ...conf, - success(res){ - formatResponse("GetGroupEnterInfoSuccessCallbackResult",res); - moduleHelper.send('GetShareInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetShareInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetShareInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetStorageInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getStorageInfo({ - ...conf, - success(res){ - formatResponse("GetStorageInfoSuccessCallbackOption",res); - moduleHelper.send('GetStorageInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetStorageInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetStorageInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetSystemInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getSystemInfo({ - ...conf, - success(res){ - formatResponse("SystemInfo",res); - moduleHelper.send('GetSystemInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetSystemInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetSystemInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetSystemInfoAsync(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getSystemInfoAsync({ - ...conf, - success(res){ - formatResponse("SystemInfo",res); - moduleHelper.send('GetSystemInfoAsyncCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetSystemInfoAsyncCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetSystemInfoAsyncCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetUserCloudStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getUserCloudStorage({ - ...conf, - success(res){ - formatResponse("GetUserCloudStorageSuccessCallbackResult",res); - moduleHelper.send('GetUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetUserCloudStorageKeys(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getUserCloudStorageKeys({ - ...conf, - success(res){ - formatResponse("GetUserCloudStorageKeysSuccessCallbackResult",res); - moduleHelper.send('GetUserCloudStorageKeysCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserCloudStorageKeysCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserCloudStorageKeysCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetUserInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getUserInfo({ - ...conf, - success(res){ - formatResponse("GetUserInfoSuccessCallbackResult",res); - moduleHelper.send('GetUserInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetUserInteractiveStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getUserInteractiveStorage({ - ...conf, - success(res){ - formatResponse("GetUserInteractiveStorageSuccessCallbackResult",res); - moduleHelper.send('GetUserInteractiveStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GetUserInteractiveStorageFailCallbackResult",res); - moduleHelper.send('GetUserInteractiveStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserInteractiveStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetWeRunData(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getWeRunData({ - ...conf, - success(res){ - formatResponse("GetWeRunDataSuccessCallbackResult",res); - moduleHelper.send('GetWeRunDataCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetWeRunDataCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetWeRunDataCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_HideKeyboard(conf, callbackId){ - conf = formatJsonStr(conf); - wx.hideKeyboard({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideKeyboardCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideKeyboardCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideKeyboardCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_HideLoading(conf, callbackId){ - conf = formatJsonStr(conf); - wx.hideLoading({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideLoadingCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideLoadingCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideLoadingCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_HideShareMenu(conf, callbackId){ - conf = formatJsonStr(conf); - wx.hideShareMenu({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideShareMenuCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideShareMenuCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideShareMenuCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_HideToast(conf, callbackId){ - conf = formatJsonStr(conf); - wx.hideToast({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideToastCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideToastCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('HideToastCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_InitFaceDetect(conf, callbackId){ - conf = formatJsonStr(conf); - wx.initFaceDetect({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('InitFaceDetectCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('InitFaceDetectCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('InitFaceDetectCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_IsBluetoothDevicePaired(conf, callbackId){ - conf = formatJsonStr(conf); - wx.isBluetoothDevicePaired({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('IsBluetoothDevicePairedCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('IsBluetoothDevicePairedCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('IsBluetoothDevicePairedCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_JoinVoIPChat(conf, callbackId){ - conf = formatJsonStr(conf); - wx.joinVoIPChat({ - ...conf, - success(res){ - formatResponse("JoinVoIPChatSuccessCallbackResult",res); - moduleHelper.send('JoinVoIPChatCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("JoinVoIPChatError",res); - moduleHelper.send('JoinVoIPChatCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("JoinVoIPChatError",res); - moduleHelper.send('JoinVoIPChatCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_Login(conf, callbackId){ - conf = formatJsonStr(conf); - if(!conf.timeout){ - delete conf.timeout - } - wx.login({ - ...conf, - success(res){ - formatResponse("LoginSuccessCallbackResult",res); - moduleHelper.send('LoginCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('LoginCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('LoginCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_MakeBluetoothPair(conf, callbackId){ - conf = formatJsonStr(conf); - wx.makeBluetoothPair({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('MakeBluetoothPairCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('MakeBluetoothPairCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('MakeBluetoothPairCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ModifyFriendInteractiveStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.modifyFriendInteractiveStorage({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ModifyFriendInteractiveStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("ModifyFriendInteractiveStorageFailCallbackResult",res); - moduleHelper.send('ModifyFriendInteractiveStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ModifyFriendInteractiveStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_NavigateToMiniProgram(conf, callbackId){ - conf = formatJsonStr(conf); - wx.navigateToMiniProgram({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('NavigateToMiniProgramCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('NavigateToMiniProgramCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('NavigateToMiniProgramCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_NotifyBLECharacteristicValueChange(conf, callbackId){ - conf = formatJsonStr(conf); - wx.notifyBLECharacteristicValueChange({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('NotifyBLECharacteristicValueChangeCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('NotifyBLECharacteristicValueChangeCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('NotifyBLECharacteristicValueChangeCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenBluetoothAdapter(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openBluetoothAdapter({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('OpenBluetoothAdapterCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('OpenBluetoothAdapterCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('OpenBluetoothAdapterCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenCard(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openCard({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenCardCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenCardCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenCardCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenChannelsActivity(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openChannelsActivity({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsActivityCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsActivityCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsActivityCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenChannelsEvent(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openChannelsEvent({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsEventCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsEventCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsEventCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenChannelsLive(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openChannelsLive({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsLiveCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsLiveCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsLiveCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenChannelsUserProfile(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openChannelsUserProfile({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsUserProfileCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsUserProfileCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsUserProfileCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenCustomerServiceConversation(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openCustomerServiceConversation({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenCustomerServiceConversationCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenCustomerServiceConversationCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenCustomerServiceConversationCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenSetting(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openSetting({ - ...conf, - success(res){ - formatResponse("OpenSettingSuccessCallbackResult",res); - moduleHelper.send('OpenSettingCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenSettingCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenSettingCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_PreviewImage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.previewImage({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('PreviewImageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('PreviewImageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('PreviewImageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_PreviewMedia(conf, callbackId){ - conf = formatJsonStr(conf); - wx.previewMedia({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('PreviewMediaCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('PreviewMediaCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('PreviewMediaCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ReadBLECharacteristicValue(conf, callbackId){ - conf = formatJsonStr(conf); - wx.readBLECharacteristicValue({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('ReadBLECharacteristicValueCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('ReadBLECharacteristicValueCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('ReadBLECharacteristicValueCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_RemoveStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.removeStorage({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RemoveStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RemoveStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RemoveStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_RemoveUserCloudStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.removeUserCloudStorage({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RemoveUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RemoveUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RemoveUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_RequestMidasFriendPayment(conf, callbackId){ - conf = formatJsonStr(conf); - wx.requestMidasFriendPayment({ - ...conf, - success(res){ - formatResponse("RequestMidasFriendPaymentSuccessCallbackResult",res); - moduleHelper.send('RequestMidasFriendPaymentCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("MidasFriendPaymentError",res); - moduleHelper.send('RequestMidasFriendPaymentCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("MidasFriendPaymentError",res); - moduleHelper.send('RequestMidasFriendPaymentCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_RequestMidasPayment(conf, callbackId){ - conf = formatJsonStr(conf); - wx.requestMidasPayment({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RequestMidasPaymentCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("MidasPaymentError",res); - moduleHelper.send('RequestMidasPaymentCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("MidasPaymentError",res); - moduleHelper.send('RequestMidasPaymentCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_RequestSubscribeMessage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.requestSubscribeMessage({ - ...conf, - success(res){ - formatResponse("RequestSubscribeMessageSuccessCallbackResult",res); - moduleHelper.send('RequestSubscribeMessageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("RequestSubscribeMessageFailCallbackResult",res); - moduleHelper.send('RequestSubscribeMessageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RequestSubscribeMessageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_RequestSubscribeSystemMessage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.requestSubscribeSystemMessage({ - ...conf, - success(res){ - formatResponse("RequestSubscribeSystemMessageSuccessCallbackResult",res); - moduleHelper.send('RequestSubscribeSystemMessageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("RequestSubscribeMessageFailCallbackResult",res); - moduleHelper.send('RequestSubscribeSystemMessageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('RequestSubscribeSystemMessageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SaveFileToDisk(conf, callbackId){ - conf = formatJsonStr(conf); - wx.saveFileToDisk({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SaveFileToDiskCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SaveFileToDiskCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SaveFileToDiskCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SaveImageToPhotosAlbum(conf, callbackId){ - conf = formatJsonStr(conf); - wx.saveImageToPhotosAlbum({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SaveImageToPhotosAlbumCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SaveImageToPhotosAlbumCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SaveImageToPhotosAlbumCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ScanCode(conf, callbackId){ - conf = formatJsonStr(conf); - wx.scanCode({ - ...conf, - success(res){ - formatResponse("ScanCodeSuccessCallbackResult",res); - moduleHelper.send('ScanCodeCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ScanCodeCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ScanCodeCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SendSocketMessage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.sendSocketMessage({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SendSocketMessageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SendSocketMessageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SendSocketMessageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetBLEMTU(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setBLEMTU({ - ...conf, - success(res){ - formatResponse("SetBLEMTUSuccessCallbackResult",res); - moduleHelper.send('SetBLEMTUCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("SetBLEMTUFailCallbackResult",res); - moduleHelper.send('SetBLEMTUCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetBLEMTUCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetClipboardData(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setClipboardData({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetClipboardDataCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetClipboardDataCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetClipboardDataCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetEnableDebug(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setEnableDebug({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetEnableDebugCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetEnableDebugCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetEnableDebugCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetInnerAudioOption(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setInnerAudioOption({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetInnerAudioOptionCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetInnerAudioOptionCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetInnerAudioOptionCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetKeepScreenOn(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setKeepScreenOn({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetKeepScreenOnCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetKeepScreenOnCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetKeepScreenOnCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetMenuStyle(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setMenuStyle({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetMenuStyleCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetMenuStyleCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetMenuStyleCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetScreenBrightness(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setScreenBrightness({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetScreenBrightnessCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetScreenBrightnessCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetScreenBrightnessCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetStatusBarStyle(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setStatusBarStyle({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetStatusBarStyleCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetStatusBarStyleCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetStatusBarStyleCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_SetUserCloudStorage(conf, callbackId){ - conf = formatJsonStr(conf); - wx.setUserCloudStorage({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('SetUserCloudStorageCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShareMessageToFriend(conf, callbackId){ - conf = formatJsonStr(conf); - wx.shareMessageToFriend({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShareMessageToFriendCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShareMessageToFriendCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShareMessageToFriendCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShowActionSheet(conf, callbackId){ - conf = formatJsonStr(conf); - wx.showActionSheet({ - ...conf, - success(res){ - formatResponse("ShowActionSheetSuccessCallbackResult",res); - moduleHelper.send('ShowActionSheetCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowActionSheetCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowActionSheetCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShowKeyboard(conf, callbackId){ - conf = formatJsonStr(conf); - wx.showKeyboard({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowKeyboardCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowKeyboardCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowKeyboardCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShowLoading(conf, callbackId){ - conf = formatJsonStr(conf); - wx.showLoading({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowLoadingCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowLoadingCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowLoadingCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShowModal(conf, callbackId){ - conf = formatJsonStr(conf); - wx.showModal({ - ...conf, - success(res){ - formatResponse("ShowModalSuccessCallbackResult",res); - moduleHelper.send('ShowModalCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowModalCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowModalCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShowShareImageMenu(conf, callbackId){ - conf = formatJsonStr(conf); - wx.showShareImageMenu({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowShareImageMenuCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowShareImageMenuCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowShareImageMenuCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShowShareMenu(conf, callbackId){ - conf = formatJsonStr(conf); - wx.showShareMenu({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowShareMenuCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowShareMenuCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowShareMenuCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_ShowToast(conf, callbackId){ - conf = formatJsonStr(conf); - wx.showToast({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowToastCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowToastCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('ShowToastCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StartAccelerometer(conf, callbackId){ - conf = formatJsonStr(conf); - wx.startAccelerometer({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartAccelerometerCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartAccelerometerCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartAccelerometerCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StartBeaconDiscovery(conf, callbackId){ - conf = formatJsonStr(conf); - wx.startBeaconDiscovery({ - ...conf, - success(res){ - formatResponse("BeaconError",res); - moduleHelper.send('StartBeaconDiscoveryCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BeaconError",res); - moduleHelper.send('StartBeaconDiscoveryCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BeaconError",res); - moduleHelper.send('StartBeaconDiscoveryCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StartBluetoothDevicesDiscovery(conf, callbackId){ - conf = formatJsonStr(conf); - wx.startBluetoothDevicesDiscovery({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('StartBluetoothDevicesDiscoveryCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('StartBluetoothDevicesDiscoveryCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('StartBluetoothDevicesDiscoveryCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StartCompass(conf, callbackId){ - conf = formatJsonStr(conf); - wx.startCompass({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartCompassCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartCompassCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartCompassCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StartDeviceMotionListening(conf, callbackId){ - conf = formatJsonStr(conf); - wx.startDeviceMotionListening({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartDeviceMotionListeningCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartDeviceMotionListeningCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartDeviceMotionListeningCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StartGyroscope(conf, callbackId){ - conf = formatJsonStr(conf); - wx.startGyroscope({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartGyroscopeCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartGyroscopeCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartGyroscopeCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StopAccelerometer(conf, callbackId){ - conf = formatJsonStr(conf); - wx.stopAccelerometer({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopAccelerometerCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopAccelerometerCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopAccelerometerCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StopBeaconDiscovery(conf, callbackId){ - conf = formatJsonStr(conf); - wx.stopBeaconDiscovery({ - ...conf, - success(res){ - formatResponse("BeaconError",res); - moduleHelper.send('StopBeaconDiscoveryCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BeaconError",res); - moduleHelper.send('StopBeaconDiscoveryCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BeaconError",res); - moduleHelper.send('StopBeaconDiscoveryCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StopBluetoothDevicesDiscovery(conf, callbackId){ - conf = formatJsonStr(conf); - wx.stopBluetoothDevicesDiscovery({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('StopBluetoothDevicesDiscoveryCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('StopBluetoothDevicesDiscoveryCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('StopBluetoothDevicesDiscoveryCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StopCompass(conf, callbackId){ - conf = formatJsonStr(conf); - wx.stopCompass({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopCompassCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopCompassCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopCompassCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StopDeviceMotionListening(conf, callbackId){ - conf = formatJsonStr(conf); - wx.stopDeviceMotionListening({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopDeviceMotionListeningCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopDeviceMotionListeningCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopDeviceMotionListeningCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StopFaceDetect(conf, callbackId){ - conf = formatJsonStr(conf); - wx.stopFaceDetect({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopFaceDetectCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopFaceDetectCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopFaceDetectCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StopGyroscope(conf, callbackId){ - conf = formatJsonStr(conf); - wx.stopGyroscope({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopGyroscopeCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopGyroscopeCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StopGyroscopeCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_UpdateKeyboard(conf, callbackId){ - conf = formatJsonStr(conf); - wx.updateKeyboard({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateKeyboardCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateKeyboardCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateKeyboardCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_UpdateShareMenu(conf, callbackId){ - conf = formatJsonStr(conf); - wx.updateShareMenu({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateShareMenuCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateShareMenuCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateShareMenuCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_UpdateVoIPChatMuteConfig(conf, callbackId){ - conf = formatJsonStr(conf); - wx.updateVoIPChatMuteConfig({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateVoIPChatMuteConfigCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateVoIPChatMuteConfigCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateVoIPChatMuteConfigCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_UpdateWeChatApp(conf, callbackId){ - conf = formatJsonStr(conf); - wx.updateWeChatApp({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateWeChatAppCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateWeChatAppCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('UpdateWeChatAppCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_VibrateLong(conf, callbackId){ - conf = formatJsonStr(conf); - wx.vibrateLong({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('VibrateLongCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('VibrateLongCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('VibrateLongCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_VibrateShort(conf, callbackId){ - conf = formatJsonStr(conf); - wx.vibrateShort({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('VibrateShortCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('VibrateShortCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('VibrateShortCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_WriteBLECharacteristicValue(conf, callbackId){ - conf = formatJsonStr(conf); - wx.writeBLECharacteristicValue({ - ...conf, - success(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('WriteBLECharacteristicValueCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('WriteBLECharacteristicValueCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("BluetoothError",res); - moduleHelper.send('WriteBLECharacteristicValueCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_StartGameLive(conf, callbackId){ - conf = formatJsonStr(conf); - wx.startGameLive({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartGameLiveCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartGameLiveCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('StartGameLiveCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_CheckGameLiveEnabled(conf, callbackId){ - conf = formatJsonStr(conf); - wx.checkGameLiveEnabled({ - ...conf, - success(res){ - formatResponse("CheckGameLiveEnabledSuccessCallbackOption",res); - moduleHelper.send('CheckGameLiveEnabledCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckGameLiveEnabledCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('CheckGameLiveEnabledCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetUserCurrentGameliveInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getUserCurrentGameliveInfo({ - ...conf, - success(res){ - formatResponse("GetUserCurrentGameliveInfoSuccessCallbackOption",res); - moduleHelper.send('GetUserCurrentGameliveInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserCurrentGameliveInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserCurrentGameliveInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetUserRecentGameLiveInfo(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getUserRecentGameLiveInfo({ - ...conf, - success(res){ - formatResponse("GetUserGameLiveDetailsSuccessCallbackOption",res); - moduleHelper.send('GetUserRecentGameLiveInfoCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserRecentGameLiveInfoCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserRecentGameLiveInfoCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_GetUserGameLiveDetails(conf, callbackId){ - conf = formatJsonStr(conf); - wx.getUserGameLiveDetails({ - ...conf, - success(res){ - formatResponse("GetUserGameLiveDetailsSuccessCallbackOption",res); - moduleHelper.send('GetUserGameLiveDetailsCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserGameLiveDetailsCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('GetUserGameLiveDetailsCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - WX_OpenChannelsLiveCollection(conf, callbackId){ - conf = formatJsonStr(conf); - wx.openChannelsLiveCollection({ - ...conf, - success(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsLiveCollectionCallback', JSON.stringify({ - callbackId,type:"success",res:JSON.stringify(res) - })); - }, - fail(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsLiveCollectionCallback', JSON.stringify({ - callbackId,type:"fail",res:JSON.stringify(res) - })); - }, - complete(res){ - formatResponse("GeneralCallbackResult",res); - moduleHelper.send('OpenChannelsLiveCollectionCallback', JSON.stringify({ - callbackId,type:"complete",res:JSON.stringify(res) - })); - } - }); - }, - - WX_RestartMiniProgram(){ - wx.restartMiniProgram(); - }, - WX_RemoveStorageSync(key){ - wx.removeStorageSync(key); - }, - WX_ReportEvent(eventId,data){ - wx.reportEvent(eventId,formatJsonStr(data)); - }, - WX_ReportMonitor(name,value){ - wx.reportMonitor(name,value); - }, - WX_ReportPerformance(id,value,dimensions){ - wx.reportPerformance(id,value,dimensions); - }, - WX_ReportUserBehaviorBranchAnalytics(option){ - wx.reportUserBehaviorBranchAnalytics(formatJsonStr(option)); - }, - WX_ReserveChannelsLive(option){ - wx.reserveChannelsLive(formatJsonStr(option)); - }, - WX_RevokeBufferURL(url){ - wx.revokeBufferURL(url); - }, - WX_SetPreferredFramesPerSecond(fps){ - wx.setPreferredFramesPerSecond(fps); - }, - WX_SetStorageSync(key,data,encrypt){ - wx.setStorageSync(key,formatJsonStr(data),encrypt); - }, - WX_ShareAppMessage(option){ - wx.shareAppMessage(formatJsonStr(option)); - }, - WX_TriggerGC(){ - wx.triggerGC(); - }, - WX_StopDownloadTexture(){ - wx.stopDownloadTexture(); - }, - WX_StarDownloadTexture(){ - wx.starDownloadTexture(); - }, - - WX_OnAccelerometerChange(){ - this.OnAccelerometerChangeList = this.OnAccelerometerChangeList || []; - let callback = (res)=>{ - formatResponse("OnAccelerometerChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnAccelerometerChangeCallback',resStr ); - }; - this.OnAccelerometerChangeList.push(callback); - wx.onAccelerometerChange(callback); - }, - WX_OffAccelerometerChange(){ - (this.OnAccelerometerChangeList || []).forEach(v=>{ - wx.offAccelerometerChange(v); - }); - }, - WX_OnAudioInterruptionBegin(){ - this.OnAudioInterruptionBeginList = this.OnAudioInterruptionBeginList || []; - let callback = (res)=>{ - formatResponse("GeneralCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnAudioInterruptionBeginCallback',resStr ); - }; - this.OnAudioInterruptionBeginList.push(callback); - wx.onAudioInterruptionBegin(callback); - }, - WX_OffAudioInterruptionBegin(){ - (this.OnAudioInterruptionBeginList || []).forEach(v=>{ - wx.offAudioInterruptionBegin(v); - }); - }, - WX_OnAudioInterruptionEnd(){ - this.OnAudioInterruptionEndList = this.OnAudioInterruptionEndList || []; - let callback = (res)=>{ - formatResponse("GeneralCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnAudioInterruptionEndCallback',resStr ); - }; - this.OnAudioInterruptionEndList.push(callback); - wx.onAudioInterruptionEnd(callback); - }, - WX_OffAudioInterruptionEnd(){ - (this.OnAudioInterruptionEndList || []).forEach(v=>{ - wx.offAudioInterruptionEnd(v); - }); - }, - WX_OnBLECharacteristicValueChange(){ - this.OnBLECharacteristicValueChangeList = this.OnBLECharacteristicValueChangeList || []; - let callback = (res)=>{ - formatResponse("OnBLECharacteristicValueChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBLECharacteristicValueChangeCallback',resStr ); - }; - this.OnBLECharacteristicValueChangeList.push(callback); - wx.onBLECharacteristicValueChange(callback); - }, - WX_OffBLECharacteristicValueChange(){ - (this.OnBLECharacteristicValueChangeList || []).forEach(v=>{ - wx.offBLECharacteristicValueChange(v); - }); - }, - WX_OnBLEConnectionStateChange(){ - this.OnBLEConnectionStateChangeList = this.OnBLEConnectionStateChangeList || []; - let callback = (res)=>{ - formatResponse("OnBLEConnectionStateChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBLEConnectionStateChangeCallback',resStr ); - }; - this.OnBLEConnectionStateChangeList.push(callback); - wx.onBLEConnectionStateChange(callback); - }, - WX_OffBLEConnectionStateChange(){ - (this.OnBLEConnectionStateChangeList || []).forEach(v=>{ - wx.offBLEConnectionStateChange(v); - }); - }, - WX_OnBLEMTUChange(){ - this.OnBLEMTUChangeList = this.OnBLEMTUChangeList || []; - let callback = (res)=>{ - formatResponse("OnBLEMTUChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBLEMTUChangeCallback',resStr ); - }; - this.OnBLEMTUChangeList.push(callback); - wx.onBLEMTUChange(callback); - }, - WX_OffBLEMTUChange(){ - (this.OnBLEMTUChangeList || []).forEach(v=>{ - wx.offBLEMTUChange(v); - }); - }, - WX_OnBLEPeripheralConnectionStateChanged(){ - this.OnBLEPeripheralConnectionStateChangedList = this.OnBLEPeripheralConnectionStateChangedList || []; - let callback = (res)=>{ - formatResponse("OnBLEPeripheralConnectionStateChangedCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBLEPeripheralConnectionStateChangedCallback',resStr ); - }; - this.OnBLEPeripheralConnectionStateChangedList.push(callback); - wx.onBLEPeripheralConnectionStateChanged(callback); - }, - WX_OffBLEPeripheralConnectionStateChanged(){ - (this.OnBLEPeripheralConnectionStateChangedList || []).forEach(v=>{ - wx.offBLEPeripheralConnectionStateChanged(v); - }); - }, - WX_OnBeaconServiceChange(){ - this.OnBeaconServiceChangeList = this.OnBeaconServiceChangeList || []; - let callback = (res)=>{ - formatResponse("OnBeaconServiceChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBeaconServiceChangeCallback',resStr ); - }; - this.OnBeaconServiceChangeList.push(callback); - wx.onBeaconServiceChange(callback); - }, - WX_OffBeaconServiceChange(){ - (this.OnBeaconServiceChangeList || []).forEach(v=>{ - wx.offBeaconServiceChange(v); - }); - }, - WX_OnBeaconUpdate(){ - this.OnBeaconUpdateList = this.OnBeaconUpdateList || []; - let callback = (res)=>{ - formatResponse("OnBeaconUpdateCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBeaconUpdateCallback',resStr ); - }; - this.OnBeaconUpdateList.push(callback); - wx.onBeaconUpdate(callback); - }, - WX_OffBeaconUpdate(){ - (this.OnBeaconUpdateList || []).forEach(v=>{ - wx.offBeaconUpdate(v); - }); - }, - WX_OnBluetoothAdapterStateChange(){ - this.OnBluetoothAdapterStateChangeList = this.OnBluetoothAdapterStateChangeList || []; - let callback = (res)=>{ - formatResponse("OnBluetoothAdapterStateChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBluetoothAdapterStateChangeCallback',resStr ); - }; - this.OnBluetoothAdapterStateChangeList.push(callback); - wx.onBluetoothAdapterStateChange(callback); - }, - WX_OffBluetoothAdapterStateChange(){ - (this.OnBluetoothAdapterStateChangeList || []).forEach(v=>{ - wx.offBluetoothAdapterStateChange(v); - }); - }, - WX_OnBluetoothDeviceFound(){ - this.OnBluetoothDeviceFoundList = this.OnBluetoothDeviceFoundList || []; - let callback = (res)=>{ - formatResponse("OnBluetoothDeviceFoundCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnBluetoothDeviceFoundCallback',resStr ); - }; - this.OnBluetoothDeviceFoundList.push(callback); - wx.onBluetoothDeviceFound(callback); - }, - WX_OffBluetoothDeviceFound(){ - (this.OnBluetoothDeviceFoundList || []).forEach(v=>{ - wx.offBluetoothDeviceFound(v); - }); - }, - WX_OnCompassChange(){ - this.OnCompassChangeList = this.OnCompassChangeList || []; - let callback = (res)=>{ - formatResponse("OnCompassChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnCompassChangeCallback',resStr ); - }; - this.OnCompassChangeList.push(callback); - wx.onCompassChange(callback); - }, - WX_OffCompassChange(){ - (this.OnCompassChangeList || []).forEach(v=>{ - wx.offCompassChange(v); - }); - }, - WX_OnDeviceMotionChange(){ - this.OnDeviceMotionChangeList = this.OnDeviceMotionChangeList || []; - let callback = (res)=>{ - formatResponse("OnDeviceMotionChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnDeviceMotionChangeCallback',resStr ); - }; - this.OnDeviceMotionChangeList.push(callback); - wx.onDeviceMotionChange(callback); - }, - WX_OffDeviceMotionChange(){ - (this.OnDeviceMotionChangeList || []).forEach(v=>{ - wx.offDeviceMotionChange(v); - }); - }, - WX_OnDeviceOrientationChange(){ - this.OnDeviceOrientationChangeList = this.OnDeviceOrientationChangeList || []; - let callback = (res)=>{ - formatResponse("OnDeviceOrientationChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnDeviceOrientationChangeCallback',resStr ); - }; - this.OnDeviceOrientationChangeList.push(callback); - wx.onDeviceOrientationChange(callback); - }, - WX_OffDeviceOrientationChange(){ - (this.OnDeviceOrientationChangeList || []).forEach(v=>{ - wx.offDeviceOrientationChange(v); - }); - }, - WX_OnError(){ - this.OnErrorList = this.OnErrorList || []; - let callback = (res)=>{ - formatResponse("WxOnErrorCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnErrorCallback',resStr ); - }; - this.OnErrorList.push(callback); - wx.onError(callback); - }, - WX_OffError(){ - (this.OnErrorList || []).forEach(v=>{ - wx.offError(v); - }); - }, - WX_OnGyroscopeChange(){ - this.OnGyroscopeChangeList = this.OnGyroscopeChangeList || []; - let callback = (res)=>{ - formatResponse("OnGyroscopeChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnGyroscopeChangeCallback',resStr ); - }; - this.OnGyroscopeChangeList.push(callback); - wx.onGyroscopeChange(callback); - }, - WX_OffGyroscopeChange(){ - (this.OnGyroscopeChangeList || []).forEach(v=>{ - wx.offGyroscopeChange(v); - }); - }, - WX_OnHide(){ - this.OnHideList = this.OnHideList || []; - let callback = (res)=>{ - formatResponse("GeneralCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnHideCallback',resStr ); - }; - this.OnHideList.push(callback); - wx.onHide(callback); - }, - WX_OffHide(){ - (this.OnHideList || []).forEach(v=>{ - wx.offHide(v); - }); - }, - WX_OnInteractiveStorageModified(){ - this.OnInteractiveStorageModifiedList = this.OnInteractiveStorageModifiedList || []; - let callback = (res)=>{ - formatResponse("string",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnInteractiveStorageModifiedCallback',resStr ); - }; - this.OnInteractiveStorageModifiedList.push(callback); - wx.onInteractiveStorageModified(callback); - }, - WX_OffInteractiveStorageModified(){ - (this.OnInteractiveStorageModifiedList || []).forEach(v=>{ - wx.offInteractiveStorageModified(v); - }); - }, - WX_OnKeyDown(){ - this.OnKeyDownList = this.OnKeyDownList || []; - let callback = (res)=>{ - formatResponse("OnKeyDownCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnKeyDownCallback',resStr ); - }; - this.OnKeyDownList.push(callback); - wx.onKeyDown(callback); - }, - WX_OffKeyDown(){ - (this.OnKeyDownList || []).forEach(v=>{ - wx.offKeyDown(v); - }); - }, - WX_OnKeyUp(){ - this.OnKeyUpList = this.OnKeyUpList || []; - let callback = (res)=>{ - formatResponse("OnKeyDownCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnKeyUpCallback',resStr ); - }; - this.OnKeyUpList.push(callback); - wx.onKeyUp(callback); - }, - WX_OffKeyUp(){ - (this.OnKeyUpList || []).forEach(v=>{ - wx.offKeyUp(v); - }); - }, - WX_OnKeyboardComplete(){ - this.OnKeyboardCompleteList = this.OnKeyboardCompleteList || []; - let callback = (res)=>{ - formatResponse("OnKeyboardInputCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnKeyboardCompleteCallback',resStr ); - }; - this.OnKeyboardCompleteList.push(callback); - wx.onKeyboardComplete(callback); - }, - WX_OffKeyboardComplete(){ - (this.OnKeyboardCompleteList || []).forEach(v=>{ - wx.offKeyboardComplete(v); - }); - }, - WX_OnKeyboardConfirm(){ - this.OnKeyboardConfirmList = this.OnKeyboardConfirmList || []; - let callback = (res)=>{ - formatResponse("OnKeyboardInputCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnKeyboardConfirmCallback',resStr ); - }; - this.OnKeyboardConfirmList.push(callback); - wx.onKeyboardConfirm(callback); - }, - WX_OffKeyboardConfirm(){ - (this.OnKeyboardConfirmList || []).forEach(v=>{ - wx.offKeyboardConfirm(v); - }); - }, - WX_OnKeyboardHeightChange(){ - this.OnKeyboardHeightChangeList = this.OnKeyboardHeightChangeList || []; - let callback = (res)=>{ - formatResponse("OnKeyboardHeightChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnKeyboardHeightChangeCallback',resStr ); - }; - this.OnKeyboardHeightChangeList.push(callback); - wx.onKeyboardHeightChange(callback); - }, - WX_OffKeyboardHeightChange(){ - (this.OnKeyboardHeightChangeList || []).forEach(v=>{ - wx.offKeyboardHeightChange(v); - }); - }, - WX_OnKeyboardInput(){ - this.OnKeyboardInputList = this.OnKeyboardInputList || []; - let callback = (res)=>{ - formatResponse("OnKeyboardInputCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnKeyboardInputCallback',resStr ); - }; - this.OnKeyboardInputList.push(callback); - wx.onKeyboardInput(callback); - }, - WX_OffKeyboardInput(){ - (this.OnKeyboardInputList || []).forEach(v=>{ - wx.offKeyboardInput(v); - }); - }, - WX_OnMemoryWarning(){ - this.OnMemoryWarningList = this.OnMemoryWarningList || []; - let callback = (res)=>{ - formatResponse("OnMemoryWarningCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnMemoryWarningCallback',resStr ); - }; - this.OnMemoryWarningList.push(callback); - wx.onMemoryWarning(callback); - }, - WX_OffMemoryWarning(){ - (this.OnMemoryWarningList || []).forEach(v=>{ - wx.offMemoryWarning(v); - }); - }, - WX_OnMessage(){ - this.OnMessageList = this.OnMessageList || []; - let callback = (res)=>{ - formatResponse("string",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnMessageCallback',resStr ); - }; - this.OnMessageList.push(callback); - wx.onMessage(callback); - }, - WX_OffMessage(){ - (this.OnMessageList || []).forEach(v=>{ - wx.offMessage(v); - }); - }, - WX_OnNetworkStatusChange(){ - this.OnNetworkStatusChangeList = this.OnNetworkStatusChangeList || []; - let callback = (res)=>{ - formatResponse("OnNetworkStatusChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnNetworkStatusChangeCallback',resStr ); - }; - this.OnNetworkStatusChangeList.push(callback); - wx.onNetworkStatusChange(callback); - }, - WX_OffNetworkStatusChange(){ - (this.OnNetworkStatusChangeList || []).forEach(v=>{ - wx.offNetworkStatusChange(v); - }); - }, - WX_OnNetworkWeakChange(){ - this.OnNetworkWeakChangeList = this.OnNetworkWeakChangeList || []; - let callback = (res)=>{ - formatResponse("OnNetworkWeakChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnNetworkWeakChangeCallback',resStr ); - }; - this.OnNetworkWeakChangeList.push(callback); - wx.onNetworkWeakChange(callback); - }, - WX_OffNetworkWeakChange(){ - (this.OnNetworkWeakChangeList || []).forEach(v=>{ - wx.offNetworkWeakChange(v); - }); - }, - WX_OnShareMessageToFriend(){ - this.OnShareMessageToFriendList = this.OnShareMessageToFriendList || []; - let callback = (res)=>{ - formatResponse("OnShareMessageToFriendCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnShareMessageToFriendCallback',resStr ); - }; - this.OnShareMessageToFriendList.push(callback); - wx.onShareMessageToFriend(callback); - }, - WX_OffShareMessageToFriend(){ - (this.OnShareMessageToFriendList || []).forEach(v=>{ - wx.offShareMessageToFriend(v); - }); - }, - WX_OnShow(){ - this.OnShowList = this.OnShowList || []; - let callback = (res)=>{ - formatResponse("OnShowCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnShowCallback',resStr ); - }; - this.OnShowList.push(callback); - wx.onShow(callback); - }, - WX_OffShow(){ - (this.OnShowList || []).forEach(v=>{ - wx.offShow(v); - }); - }, - WX_OnSocketClose(){ - this.OnSocketCloseList = this.OnSocketCloseList || []; - let callback = (res)=>{ - formatResponse("SocketTaskOnCloseCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnSocketCloseCallback',resStr ); - }; - this.OnSocketCloseList.push(callback); - wx.onSocketClose(callback); - }, - WX_OffSocketClose(){ - (this.OnSocketCloseList || []).forEach(v=>{ - wx.offSocketClose(v); - }); - }, - WX_OnSocketError(){ - this.OnSocketErrorList = this.OnSocketErrorList || []; - let callback = (res)=>{ - formatResponse("GeneralCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnSocketErrorCallback',resStr ); - }; - this.OnSocketErrorList.push(callback); - wx.onSocketError(callback); - }, - WX_OffSocketError(){ - (this.OnSocketErrorList || []).forEach(v=>{ - wx.offSocketError(v); - }); - }, - WX_OnSocketMessage(){ - this.OnSocketMessageList = this.OnSocketMessageList || []; - let callback = (res)=>{ - formatResponse("SocketTaskOnMessageCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnSocketMessageCallback',resStr ); - }; - this.OnSocketMessageList.push(callback); - wx.onSocketMessage(callback); - }, - WX_OffSocketMessage(){ - (this.OnSocketMessageList || []).forEach(v=>{ - wx.offSocketMessage(v); - }); - }, - WX_OnSocketOpen(){ - this.OnSocketOpenList = this.OnSocketOpenList || []; - let callback = (res)=>{ - formatResponse("OnSocketOpenCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnSocketOpenCallback',resStr ); - }; - this.OnSocketOpenList.push(callback); - wx.onSocketOpen(callback); - }, - WX_OffSocketOpen(){ - (this.OnSocketOpenList || []).forEach(v=>{ - wx.offSocketOpen(v); - }); - }, - WX_OnTouchCancel(){ - this.OnTouchCancelList = this.OnTouchCancelList || []; - let callback = (res)=>{ - var touches = res.touches.map(v=>formatTouchEvent(v)); - var resStr = JSON.stringify({ - touches, - timeStamp:parseInt(res.timeStamp), - changedTouches:res.changedTouches.map(v=>formatTouchEvent(v)) - }) - moduleHelper.send('_OnTouchCancelCallback',resStr ); - }; - this.OnTouchCancelList.push(callback); - wx.onTouchCancel(callback); - }, - WX_OffTouchCancel(){ - (this.OnTouchCancelList || []).forEach(v=>{ - wx.offTouchCancel(v); - }); - }, - WX_OnTouchEnd(){ - this.OnTouchEndList = this.OnTouchEndList || []; - let callback = (res)=>{ - var touches = res.touches.map(v=>formatTouchEvent(v)); - var resStr = JSON.stringify({ - touches, - timeStamp:parseInt(res.timeStamp), - changedTouches:res.changedTouches.map(v=>formatTouchEvent(v)) - }) - moduleHelper.send('_OnTouchEndCallback',resStr ); - }; - this.OnTouchEndList.push(callback); - wx.onTouchEnd(callback); - }, - WX_OffTouchEnd(){ - (this.OnTouchEndList || []).forEach(v=>{ - wx.offTouchEnd(v); - }); - }, - WX_OnTouchMove(){ - this.OnTouchMoveList = this.OnTouchMoveList || []; - let callback = (res)=>{ - var touches = res.touches.map(v=>formatTouchEvent(v)); - var resStr = JSON.stringify({ - touches, - timeStamp:parseInt(res.timeStamp), - changedTouches:res.changedTouches.map(v=>formatTouchEvent(v)) - }) - moduleHelper.send('_OnTouchMoveCallback',resStr ); - }; - this.OnTouchMoveList.push(callback); - wx.onTouchMove(callback); - }, - WX_OffTouchMove(){ - (this.OnTouchMoveList || []).forEach(v=>{ - wx.offTouchMove(v); - }); - }, - WX_OnTouchStart(){ - this.OnTouchStartList = this.OnTouchStartList || []; - let callback = (res)=>{ - var touches = res.touches.map(v=>formatTouchEvent(v)); - var resStr = JSON.stringify({ - touches, - timeStamp:parseInt(res.timeStamp), - changedTouches:res.changedTouches.map(v=>formatTouchEvent(v)) - }) - moduleHelper.send('_OnTouchStartCallback',resStr ); - }; - this.OnTouchStartList.push(callback); - wx.onTouchStart(callback); - }, - WX_OffTouchStart(){ - (this.OnTouchStartList || []).forEach(v=>{ - wx.offTouchStart(v); - }); - }, - WX_OnUnhandledRejection(){ - this.OnUnhandledRejectionList = this.OnUnhandledRejectionList || []; - let callback = (res)=>{ - formatResponse("OnUnhandledRejectionCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnUnhandledRejectionCallback',resStr ); - }; - this.OnUnhandledRejectionList.push(callback); - wx.onUnhandledRejection(callback); - }, - WX_OffUnhandledRejection(){ - (this.OnUnhandledRejectionList || []).forEach(v=>{ - wx.offUnhandledRejection(v); - }); - }, - WX_OnUserCaptureScreen(){ - this.OnUserCaptureScreenList = this.OnUserCaptureScreenList || []; - let callback = (res)=>{ - formatResponse("GeneralCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnUserCaptureScreenCallback',resStr ); - }; - this.OnUserCaptureScreenList.push(callback); - wx.onUserCaptureScreen(callback); - }, - WX_OffUserCaptureScreen(){ - (this.OnUserCaptureScreenList || []).forEach(v=>{ - wx.offUserCaptureScreen(v); - }); - }, - WX_OnVoIPChatInterrupted(){ - this.OnVoIPChatInterruptedList = this.OnVoIPChatInterruptedList || []; - let callback = (res)=>{ - formatResponse("OnVoIPChatInterruptedCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnVoIPChatInterruptedCallback',resStr ); - }; - this.OnVoIPChatInterruptedList.push(callback); - wx.onVoIPChatInterrupted(callback); - }, - WX_OffVoIPChatInterrupted(){ - (this.OnVoIPChatInterruptedList || []).forEach(v=>{ - wx.offVoIPChatInterrupted(v); - }); - }, - WX_OnVoIPChatMembersChanged(){ - this.OnVoIPChatMembersChangedList = this.OnVoIPChatMembersChangedList || []; - let callback = (res)=>{ - formatResponse("OnVoIPChatMembersChangedCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnVoIPChatMembersChangedCallback',resStr ); - }; - this.OnVoIPChatMembersChangedList.push(callback); - wx.onVoIPChatMembersChanged(callback); - }, - WX_OffVoIPChatMembersChanged(){ - (this.OnVoIPChatMembersChangedList || []).forEach(v=>{ - wx.offVoIPChatMembersChanged(v); - }); - }, - WX_OnVoIPChatSpeakersChanged(){ - this.OnVoIPChatSpeakersChangedList = this.OnVoIPChatSpeakersChangedList || []; - let callback = (res)=>{ - formatResponse("OnVoIPChatSpeakersChangedCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnVoIPChatSpeakersChangedCallback',resStr ); - }; - this.OnVoIPChatSpeakersChangedList.push(callback); - wx.onVoIPChatSpeakersChanged(callback); - }, - WX_OffVoIPChatSpeakersChanged(){ - (this.OnVoIPChatSpeakersChangedList || []).forEach(v=>{ - wx.offVoIPChatSpeakersChanged(v); - }); - }, - WX_OnVoIPChatStateChanged(){ - this.OnVoIPChatStateChangedList = this.OnVoIPChatStateChangedList || []; - let callback = (res)=>{ - formatResponse("OnVoIPChatStateChangedCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnVoIPChatStateChangedCallback',resStr ); - }; - this.OnVoIPChatStateChangedList.push(callback); - wx.onVoIPChatStateChanged(callback); - }, - WX_OffVoIPChatStateChanged(){ - (this.OnVoIPChatStateChangedList || []).forEach(v=>{ - wx.offVoIPChatStateChanged(v); - }); - }, - WX_OnWindowResize(){ - this.OnWindowResizeList = this.OnWindowResizeList || []; - let callback = (res)=>{ - formatResponse("OnWindowResizeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnWindowResizeCallback',resStr ); - }; - this.OnWindowResizeList.push(callback); - wx.onWindowResize(callback); - }, - WX_OffWindowResize(){ - (this.OnWindowResizeList || []).forEach(v=>{ - wx.offWindowResize(v); - }); - }, - - WX_OnAddToFavorites(){ - this.OnAddToFavoritesList = this.OnAddToFavoritesList || []; - let callback = (res)=>{ - res = res || {}; - var resStr = JSON.stringify(res); - moduleHelper.send('_OnAddToFavoritesCallback',resStr); - return this.WX_OnAddToFavorites_ResolveConf; - }; - this.OnAddToFavoritesList.push(callback); - wx.onAddToFavorites(callback); - }, - WX_OnAddToFavorites_Resolve(conf){ - try{ - conf = JSON.parse(conf); - this.WX_OnAddToFavorites_ResolveConf = conf; - return; - }catch(e){ - } - this.WX_OnAddToFavorites_ResolveConf = {}; - }, - WX_OffAddToFavorites(){ - wx.offAddToFavorites(); - }, - WX_OnCopyUrl(){ - this.OnCopyUrlList = this.OnCopyUrlList || []; - let callback = (res)=>{ - res = res || {}; - var resStr = JSON.stringify(res); - moduleHelper.send('_OnCopyUrlCallback',resStr); - return this.WX_OnCopyUrl_ResolveConf; - }; - this.OnCopyUrlList.push(callback); - wx.onCopyUrl(callback); - }, - WX_OnCopyUrl_Resolve(conf){ - try{ - conf = JSON.parse(conf); - this.WX_OnCopyUrl_ResolveConf = conf; - return; - }catch(e){ - } - this.WX_OnCopyUrl_ResolveConf = {}; - }, - WX_OffCopyUrl(){ - wx.offCopyUrl(); - }, - WX_OnHandoff(){ - this.OnHandoffList = this.OnHandoffList || []; - let callback = (res)=>{ - res = res || {}; - var resStr = JSON.stringify(res); - moduleHelper.send('_OnHandoffCallback',resStr); - return this.WX_OnHandoff_ResolveConf; - }; - this.OnHandoffList.push(callback); - wx.onHandoff(callback); - }, - WX_OnHandoff_Resolve(conf){ - try{ - conf = JSON.parse(conf); - this.WX_OnHandoff_ResolveConf = conf; - return; - }catch(e){ - } - this.WX_OnHandoff_ResolveConf = {}; - }, - WX_OffHandoff(){ - wx.offHandoff(); - }, - WX_OnShareTimeline(){ - this.OnShareTimelineList = this.OnShareTimelineList || []; - let callback = (res)=>{ - res = res || {}; - var resStr = JSON.stringify(res); - moduleHelper.send('_OnShareTimelineCallback',resStr); - return this.WX_OnShareTimeline_ResolveConf; - }; - this.OnShareTimelineList.push(callback); - wx.onShareTimeline(callback); - }, - WX_OnShareTimeline_Resolve(conf){ - try{ - conf = JSON.parse(conf); - this.WX_OnShareTimeline_ResolveConf = conf; - return; - }catch(e){ - } - this.WX_OnShareTimeline_ResolveConf = {}; - }, - WX_OffShareTimeline(){ - wx.offShareTimeline(); - }, - WX_OnGameLiveStateChange(){ - this.OnGameLiveStateChangeList = this.OnGameLiveStateChangeList || []; - let callback = (res)=>{ - res = res || {}; - formatResponse("OnGameLiveStateChangeCallbackResult",res); - var resStr = JSON.stringify(res); - moduleHelper.send('_OnGameLiveStateChangeCallback',resStr); - return this.WX_OnGameLiveStateChange_ResolveConf; - }; - this.OnGameLiveStateChangeList.push(callback); - wx.onGameLiveStateChange(callback); - }, - WX_OnGameLiveStateChange_Resolve(conf){ - try{ - conf = JSON.parse(conf); - this.WX_OnGameLiveStateChange_ResolveConf = conf; - return; - }catch(e){ - } - this.WX_OnGameLiveStateChange_ResolveConf = {}; - }, - WX_OffGameLiveStateChange(){ - wx.offGameLiveStateChange(); - }, - - WX_SetHandoffQuery(query){ - var res = wx.setHandoffQuery(formatJsonStr(query)); - return res; - }, - WX_GetAccountInfoSync(){ - var res = wx.getAccountInfoSync(); - formatResponse("AccountInfo",res); - return JSON.stringify(res); - }, - WX_GetBatteryInfoSync(){ - var res = wx.getBatteryInfoSync(); - formatResponse("GetBatteryInfoSyncResult",res); - return JSON.stringify(res); - }, - WX_GetEnterOptionsSync(){ - var res = wx.getEnterOptionsSync(); - formatResponse("EnterOptionsGame",res); - return JSON.stringify(res); - }, - WX_GetExptInfoSync(keys){ - var res = wx.getExptInfoSync(formatJsonStr(keys)); - formatResponse("IAnyObject",res); - return JSON.stringify(res); - }, - WX_GetExtConfigSync(){ - var res = wx.getExtConfigSync(); - formatResponse("IAnyObject",res); - return JSON.stringify(res); - }, - WX_GetLaunchOptionsSync(){ - var res = wx.getLaunchOptionsSync(); - formatResponse("LaunchOptionsGame",res); - return JSON.stringify(res); - }, - WX_GetMenuButtonBoundingClientRect(){ - var res = wx.getMenuButtonBoundingClientRect(); - formatResponse("ClientRect",res); - return JSON.stringify(res); - }, - WX_GetStorageInfoSync(){ - var res = wx.getStorageInfoSync(); - formatResponse("GetStorageInfoSyncOption",res); - return JSON.stringify(res); - }, - WX_GetSystemInfoSync(){ - var res = wx.getSystemInfoSync(); - formatResponse("SystemInfo",res); - return JSON.stringify(res); - }, - WX_SetCursor(path,x,y){ - var res = wx.setCursor(formatJsonStr(path),x,y); - return res; - }, - WX_SetMessageToFriendQuery(option){ - var res = wx.setMessageToFriendQuery(formatJsonStr(option)); - return res; - }, - WX_GetTextLineHeight(option){ - var res = wx.getTextLineHeight(formatJsonStr(option)); - return res; - }, - WX_LoadFont(path){ - var res = wx.loadFont(formatJsonStr(path)); - return res; - }, - WX_GetGameLiveState(){ - var res = wx.getGameLiveState(); - formatResponse("GameLiveState",res); - return JSON.stringify(res); - }, - - WX_GetUpdateManager(){ - let obj = wx.getUpdateManager(); - this.UpdateManagerList = this.UpdateManagerList || {}; - let list = this.UpdateManagerList; - let count = Object.keys(list); - let key = count+(new Date().getTime()); - list[key] = obj; - return key; - }, - - WX_ApplyUpdate(id){ - var obj = this.UpdateManagerList[id]; - if(obj){ - obj.applyUpdate(); - } - }, - WX_OnCheckForUpdate(id){ - var obj = this.UpdateManagerList[id]; - obj.OnCheckForUpdateList = obj.OnCheckForUpdateList || []; - let callback = (res)=>{ - formatResponse("OnCheckForUpdateCallbackResult",res); - var resStr = JSON.stringify({ - callbackId:id, - res:JSON.stringify(res) - }); - moduleHelper.send('_OnCheckForUpdateCallback',resStr ); - }; - obj.OnCheckForUpdateList.push(callback); - obj.onCheckForUpdate(callback); - }, - WX_OnUpdateFailed(id){ - var obj = this.UpdateManagerList[id]; - obj.OnUpdateFailedList = obj.OnUpdateFailedList || []; - let callback = (res)=>{ - formatResponse("GeneralCallbackResult",res); - var resStr = JSON.stringify({ - callbackId:id, - res:JSON.stringify(res) - }); - moduleHelper.send('_OnUpdateFailedCallback',resStr ); - }; - obj.OnUpdateFailedList.push(callback); - obj.onUpdateFailed(callback); - }, - WX_OnUpdateReady(id){ - var obj = this.UpdateManagerList[id]; - obj.OnUpdateReadyList = obj.OnUpdateReadyList || []; - let callback = (res)=>{ - formatResponse("GeneralCallbackResult",res); - var resStr = JSON.stringify({ - callbackId:id, - res:JSON.stringify(res) - }); - moduleHelper.send('_OnUpdateReadyCallback',resStr ); - }; - obj.OnUpdateReadyList.push(callback); - obj.onUpdateReady(callback); - }, - -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/sdk.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/sdk.js.meta deleted file mode 100644 index 2cd9d36f..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/sdk.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 0b951be0dd6664f31a3880402d2686c5 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/share.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/share.js deleted file mode 100755 index 81e20ecb..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/share.js +++ /dev/null @@ -1,31 +0,0 @@ -import moduleHelper from "./module-helper"; -let shareResolve; -export default { - WXShareAppMessage(conf){ - wx.shareAppMessage({ - ...JSON.parse(conf) - }); - }, - WXOnShareAppMessage(conf,isPromise){ - wx.onShareAppMessage(()=>{ - return { - ...JSON.parse(conf), - promise:isPromise ? new Promise((resolve)=>{ - shareResolve = resolve; - moduleHelper.send('OnShareAppMessageCallback'); - }):null - } - }); - }, - WXOnShareAppMessageResolve(conf){ - if(shareResolve){ - shareResolve(JSON.parse(conf)); - } - }, -} - -wx.showShareMenu({ - menus: ['shareAppMessage', 'shareTimeline'] -}); - - diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/share.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/share.js.meta deleted file mode 100644 index a1d1dbd7..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/share.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 274d2d3c426da0c41a83ee7c690e95ac -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/short-audio.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/short-audio.js deleted file mode 100644 index d7eedbfe..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/short-audio.js +++ /dev/null @@ -1,99 +0,0 @@ -const cacheAudios = {}; -const funs = { - getFullUrl(v){ - if(!/^https?:\/\//.test(v)){ - const cdnPath = GameGlobal.manager.assetPath; - v = cdnPath.replace(/\/$/,'') +'/' +v.replace(/^\//,'').replace(/^Assets\//,''); - } - return encodeURI(v); - } -}; -export default { - WXPreLoadShortAudio(str) { - str.split(',').forEach(v=>{ - if(!cacheAudios[v]){ - const innerAudioContext = wx.createInnerAudioContext(); - innerAudioContext.src= funs.getFullUrl(v); - cacheAudios[v] = { - context:innerAudioContext - } - } - }) - }, - WXStopOthersAndPlay(str,loop,volume){ - if(!cacheAudios[str]){ - const innerAudioContext = wx.createInnerAudioContext(); - innerAudioContext.src= funs.getFullUrl(str); - innerAudioContext.loop = Boolean(loop); - cacheAudios[str] = { - context:innerAudioContext, - loop, - volume, - isPlaying:false - } - innerAudioContext.onEnded = function(){ - cacheAudios[str].isPlaying = false; - } - } - - Object.keys(cacheAudios).forEach(v=>{ - if(cacheAudios[v].isPlaying && v!==str){ - cacheAudios[v].isPlaying = false; - cacheAudios[v].context.stop(); - } - }) - - const audio = cacheAudios[str]; - if(audio.loop !=Boolean(loop)){ - audio.loop = Boolean(loop); - audio.context.loop = Boolean(loop); - } - if(audio.volume !=volume){ - audio.volume = volume; - audio.context.volume = volume; - } - if(!audio.isPlaying){ - audio.context.play(); - audio.context.isPlaying = true; - } - }, - WXShortAudioPlayerStop(str){ - let audio = cacheAudios[str]; - if(audio){ - if(audio.isPlaying){ - audio.isPlaying =false; - audio.context.stop(); - } - } - }, - WXShortAudioPlayerDestroy(str){ - let audio = cacheAudios[str]; - if(audio){ - audio.context.destroy(); - delete cacheAudios[str]; - } - } - -} - -const mod = { - recover(){ - Object.keys(cacheAudios).forEach(key=>{ - const audio = cacheAudios[key]; - if(audio.context.paused && audio.isPlaying){ - if(audio.loop){ - audio.play(); - }else{ - audio.isPlaying = false; - } - } - }) - }, - init(){ - wx.onShow(mod.recover); - wx.onAudioInterruptionEnd(mod.recover); - } -}; - -mod.init(); - diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/short-audio.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/short-audio.js.meta deleted file mode 100644 index ed34271c..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/short-audio.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: cc9f3b72ca71d45599b0a233a1e3c1d1 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/storage.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/storage.js deleted file mode 100755 index fa22b4c5..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/storage.js +++ /dev/null @@ -1,152 +0,0 @@ -const PreLoadKeys = "$PreLoadKeys"; //Unity插件会替换这里,不要改这里 - -const storage = { - _cacheData:{}, //缓存数据,避免同步操作带来的卡顿 - _handleList:[], //io队列,避免时序问题和同时大量的io操作 - isRunning:false, - isCallDeletedAll:false, - getData(key,defaultValue){ - var v = this._cacheData[key]; - if(v === null){ - return defaultValue; - } - if(typeof v!== 'undefined'){ - return v; - } - if(this.isCallDeletedAll){ - return defaultValue; - } - try { - v = wx.getStorageSync(key); - this._cacheData[key] = v !== "" ? v : null; - return v === "" ? defaultValue : v; - } catch (e) { - //console.error(e); - return defaultValue; - } - }, - setData(key,value){ - this._cacheData[key] = value; - this._handleList.push({ - type:"setData", - key, - value - }); - this._doRun(); - }, - deleteKey(key){ - this._cacheData[key] = null; - this._handleList.push({ - type:"deleteKey", - key - }); - this._doRun(); - }, - deleteAll(){ - for(let key in this._cacheData){ - this._cacheData[key] = null; - } - this.isCallDeletedAll = true; - this._handleList.push({ - type:"deleteAll" - }); - this._doRun(); - }, - _doRun(){ - if(this.isRunning || this._handleList.length === 0){ - return false; - } - this.isRunning = true; - const task = this._handleList.shift(); - if(task.type === 'setData'){ - wx.setStorage({ - key:task.key, - data:task.value, - fail:function({errMsg}){ - console.error(errMsg); - }, - complete:()=>{ - this.isRunning = false; - this._doRun(); - } - }); - }else if(task.type === 'deleteKey'){ - wx.removeStorage({ - key:task.key, - fail:function({errMsg}){ - console.error(errMsg); - }, - complete:()=>{ - this.isRunning = false; - this._doRun(); - } - }); - }else if(task.type === 'deleteAll'){ - wx.clearStorage({ - fail:function({errMsg}){ - console.error(errMsg); - }, - complete:()=>{ - this.isRunning = false; - this._doRun(); - } - }); - }else{ - this.isRunning = false; - this._doRun(); - } - }, - init(){ - if(Array.isArray(PreLoadKeys) && PreLoadKeys.length>0){ - const key = PreLoadKeys.shift(); - wx.getStorage({ - key, - success(res){ - storage._cacheData[key] = res.data; - storage.init(); - }, - fail(){ - storage._cacheData[key] = null; - storage.init(); - } - }); - } - } -}; - -setTimeout(()=>{ - storage.init(); -},0); - -export default { - /* - 本地存储 - */ - WXStorageGetIntSync(key,defaultValue){ - return +storage.getData(key,defaultValue); - }, - WXStorageSetIntSync(key,value){ - storage.setData(key,value); - }, - WXStorageGetFloatSync(key,defaultValue){ - return +storage.getData(key,defaultValue); - }, - WXStorageSetFloatSync(key,value){ - storage.setData(key,value); - }, - WXStorageGetStringSync(key,defaultValue){ - return storage.getData(key,defaultValue) || ''; - }, - WXStorageSetStringSync(key,value){ - storage.setData(key,value); - }, - WXStorageDeleteAllSync(){ - storage.deleteAll(); - }, - WXStorageDeleteKeySync(key){ - storage.deleteKey(key); - }, - WXStorageHasKeySync(key){ - return storage.getData(key,'') !== ''; - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/storage.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/storage.js.meta deleted file mode 100644 index ec38dcaa..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/storage.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 52c8e6e2634388945acf11a09caedbb5 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/texture.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/texture.js deleted file mode 100755 index f594817f..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/texture.js +++ /dev/null @@ -1,296 +0,0 @@ -import canvasContext from "./canvas-context"; -const downloadedTextures = {}; -const downloadingTextures = {}; -const downloadFailedTextures = {}; - -let hasCheckSupportedExtensions = false; -//不让外部使用 -if(typeof window !='undefined' && window.indexedDB){ - Object.defineProperty(window, 'indexedDB', { - get() { return; }, - set() {}, - enumerable : true, - configurable : true - }); -} -const err = function(msg){GameGlobal.manager.printErr(msg)}; -const PotList = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; - -const UseDXT5 = "$UseDXT5$"; - -let isStopDownloadTexture = false; -let cachedDownloadTask = []; -wx.stopDownloadTexture = function(){ - isStopDownloadTexture = true; -} - -wx.starDownloadTexture = function(){ - isStopDownloadTexture = false; - while (cachedDownloadTask.length>0){ - var task = cachedDownloadTask.shift(); - mod.WXDownloadTexture(task.path,task.width,task.height,task.callback); - } -} - -const mod = { - getSupportedExtensions(){ - if(hasCheckSupportedExtensions){ - return GameGlobal.TextureCompressedFormat; - } - const list = canvas.getContext(GameGlobal.managerConfig.contextConfig.contextType == 2 ? 'webgl2': 'webgl').getSupportedExtensions(); - if(list.indexOf('WEBGL_compressed_texture_astc')!==-1){ - GameGlobal.TextureCompressedFormat = 'astc'; - }else if(list.indexOf('WEBGL_compressed_texture_etc')!==-1){ - GameGlobal.TextureCompressedFormat = 'etc2'; - }else if(list.indexOf('WEBGL_compressed_texture_pvrtc')!==-1){ - GameGlobal.TextureCompressedFormat = 'pvr'; - }else if(list.indexOf('WEBGL_compressed_texture_s3tc') !==-1 && UseDXT5){ - GameGlobal.TextureCompressedFormat = 'dds'; - }/*else if(list.indexOf('WEBGL_compressed_texture_etc1')!==-1){ //ect1不支持透明通道,先屏蔽 - GameGlobal.TextureCompressedFormat = 'etc1'; - }*/else{ - GameGlobal.TextureCompressedFormat = ''; - } - if(list.indexOf('WEBGL_compressed_texture_etc')!==-1){ - GameGlobal.TextureEtc2Supported = true; - } - if(list.indexOf('WEBGL_compressed_texture_pvrtc')!==-1){ - GameGlobal.TexturePVRTCSupported = true; - } - hasCheckSupportedExtensions = true; - return GameGlobal.TextureCompressedFormat; - }, - getRemoteImageFile(path,width,height){ - if(!GameGlobal.TextureCompressedFormat || (GameGlobal.TextureCompressedFormat == 'pvr' && (width != height || PotList.indexOf(width)===-1)) || (GameGlobal.TextureCompressedFormat == 'dds' && (width%4!==0 || height%4!==0))){ - mod.downloadFile(path,width,height) - }else{ - mod.requestFile(path,width,height); - } - }, - reTryRemoteImageFile(path,width,height){ - var cid = path; - if(!downloadFailedTextures[cid]){ - downloadFailedTextures[cid] = { - count:0, - path,width,height - }; - } - if(downloadFailedTextures[cid].count > 4){ - return; - } - - setTimeout(()=>{ - mod.getRemoteImageFile(path,width,height) - }, Math.pow(2,downloadFailedTextures[cid].count) * 250); - - downloadFailedTextures[cid].count++; - }, - requestFile(path,width,height){ - var cid = path; - var format = GameGlobal.TextureCompressedFormat; - var url = GameGlobal.manager.assetPath.replace(/\/$/,'')+'/Textures/'+format+'/'+width+"/"+path+'.txt'; - var xmlhttp = new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest(); - xmlhttp.responseType = 'arraybuffer'; - xmlhttp.open("GET",url,true); - xmlhttp.onload = function(){ - let res = xmlhttp; - if(res.status === 200){ - downloadedTextures[cid] = { - data:res.response, - tmpFile:'' - }; - if(downloadingTextures[cid] instanceof Array){ - downloadingTextures[cid].forEach(v=>v()); - }else{ - downloadingTextures[cid] && downloadingTextures[cid](); - } - - delete downloadingTextures[cid]; - delete downloadFailedTextures[cid]; - delete downloadedTextures[cid].data; - /* - const fileManager = wx.getFileSystemManager(); - const tmpFilePath = wx.env.USER_DATA_PATH+"/"+cid+'.txt'; - fileManager.writeFile({ - filePath:tmpFilePath, - data:res.response, - success(){ - downloadedTextures[cid].tmpFile = tmpFilePath; - }, - fail(err){ - console.error(err,"压缩纹理保存失败!id:"+textureId); - delete GameGlobal.DownloadedTextures[cid] - } - }); */ - }else{ - // err("压缩纹理下载失败!url:"+url); - mod.reTryRemoteImageFile(path,width,height); - } - }; - xmlhttp.onerror = function(){ - // err("压缩纹理下载失败!url:"+url); - mod.reTryRemoteImageFile(path,width,height); - } - xmlhttp.send(null); - }, - downloadFile(path,width,height){ - - var url = GameGlobal.manager.assetPath.replace(/\/$/,'')+'/Textures/png/'+width+"/"+path+'.png'; - var cid = path; - - var image = wx.createImage(); - image.crossOrigin = ''; - image.src = url; - image.onload = function () { - downloadedTextures[cid] = { - data:image, - tmpFile:'' - }; - if(downloadingTextures[cid] instanceof Array){ - downloadingTextures[cid].forEach(v=>v()); - }else{ - downloadingTextures[cid] && downloadingTextures[cid](); - } - delete downloadingTextures[cid]; - delete downloadFailedTextures[cid]; - delete downloadedTextures[cid]; - }; - - image.onerror = function(){ - mod.reTryRemoteImageFile(path,width,height); - }; - }, - readFile(textureId,callback,width,height){ - var cid = textureId; - const fileManager = wx.getFileSystemManager(); - const filePath = wx.env.USER_DATA_PATH+"/"+cid+'.txt'; - fileManager.readFile({ - filePath, - success(res){ - if(!GameGlobal.TextureCompressedFormat){ - var image = wx.createImage(); - image.src = filePath; - image.onload = function () { - handleLoaded(image); - delete downloadedTextures[cid]; - } - }else{ - handleLoaded(); - delete downloadedTextures[cid].data; - } - function handleLoaded(image){ - downloadedTextures[cid] = { - data:image || res.data, - tmpFile:filePath - }; - callback(); - } - }, - fail(err){ - err(err,"读取压缩纹理失败!id:"+cid); - handleError(); - } - }); - - - function handleError(){ - var path; - if(type === "Texture"){ - path = GameGlobal.TextureConfig[textureId].p; - }else{ - path = GameGlobal.SpriteAtlasConfig[textureId].p; - } - if(downloadingTextures[cid]){ - downloadingTextures[cid].push(callback); - }else{ - downloadingTextures[cid] = [callback]; - } - mod.getRemoteImageFile(textureId,type,path.replace(/\\/g,'/'),width,height); - } - }, - WXDownloadTexture(path,width,height,callback){ - if(!hasCheckSupportedExtensions){ - mod.getSupportedExtensions(); - } - var cid = path; - /* - if(downloadedTextures[cid]){ - if(downloadedTextures[cid].data){ - callback(); - }else{ - mod.readFile(id,type,callback,width,height); - } - }else */ - if(isStopDownloadTexture){ - cachedDownloadTask.push({ - path,width,height,callback - }); - return; - } - if(downloadingTextures[cid]){ - downloadingTextures[cid].push(callback); - }else{ - downloadingTextures[cid] = [callback]; - mod.getRemoteImageFile(path,width,height); - } - } -}; - -GameGlobal.DownloadedTextures = downloadedTextures; -GameGlobal.TextureCompressedFormat = ''; //支持的压缩格式 - -GameGlobal.ParalleLDownloadTexture = function(filename){ - filename = filename.replace(GameGlobal.managerConfig.DATA_CDN,'').replace(/^\//,''); - filename = "/"+filename; - if (GameGlobal.TEXTURE_BUNDLES[filename]) { - GameGlobal.TEXTURE_BUNDLES[filename].forEach(function (v) { - var f = GameGlobal.TextureCompressedFormat; - if (!f) { - var p = GameGlobal.manager.assetPath + '/Textures/png/' + v.w + '/' + v.p + '.png'; - var image = wx.createImage(); - image.crossOrigin = ''; - image.src = p - } else if (f != 'pvr') { - var http = new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest(); - var p = GameGlobal.manager.assetPath + '/Textures/' + f + '/' + v.w + '/' + v.p + '.txt'; - http.open('GET', p, true); - http.responseType = 'arraybuffer'; - http.send() - } - }) - } -} - - -export default { - WXDownloadTexture:mod.WXDownloadTexture -} - - -canvasContext.addCreatedListener(()=>{ - if(GameGlobal.USED_TEXTURE_COMPRESSION){ - mod.getSupportedExtensions(); - if(GameGlobal.TextureCompressedFormat == '' || GameGlobal.TextureCompressedFormat == "pvr"){ - wx.getSystemInfo({ - success(res){ - if(res.platform == 'ios'){ - wx.showModal({ - title: '提示', - content: "当前操作系统版本过低,建议您升级至最新版本。", - }); - } - } - }); - } - } - wx.onNetworkStatusChange(function(res){ - if(res.isConnected){ - for(var key in downloadFailedTextures){ - var v = downloadFailedTextures[key]; - if(v.count >4){ - mod.getRemoteImageFile(v.path,v.width,v.height) - } - } - } - }); -}); diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/texture.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/texture.js.meta deleted file mode 100644 index 452262b1..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/texture.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3e3a7d2bf5a58cf4aab6cba25d91f22f -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/unity-adapter.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/unity-adapter.js deleted file mode 100644 index 31e545ca..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/unity-adapter.js +++ /dev/null @@ -1,184 +0,0 @@ -const WEBAudio = { - audioInstances: [], - audioContext: {}, - audioWebEnabled: 0, - audioBufferInstances: [], -}; -const disableAudio = false; -const disableAudioOptimization = false; -const UnityAdapter = {}; -UnityAdapter._JS_Sound_Init = function () { - WEBAudio.audioWebEnabled = 0; -}; -UnityAdapter._JS_Sound_Load = function (ptr, length) { - const sound = wx.createInnerAudioContext(); - let soundIndex = -1; - for (let i = 0; i < WEBAudio.audioInstances.length; ++i) { - const audio = WEBAudio.audioInstances[i]; - if (!audio) { - WEBAudio.audioInstances[i] = sound; - soundIndex = i; - break; - } - } - if (soundIndex === -1) { - soundIndex = WEBAudio.audioInstances.push(sound) - 1; - } - let soundBufferIndex = -1; - for (let i = 0; i < WEBAudio.audioBufferInstances.length; ++i) { - const audioBuffer = WEBAudio.audioBufferInstances[i]; - if (audioBuffer.ptr === ptr && audioBuffer.length === length) { - sound.buffer = audioBuffer.filePath; - soundBufferIndex = i; - break; - } - } - if (soundBufferIndex === -1) { - soundBufferIndex = - WEBAudio.audioBufferInstances.push({ - ptr, - length, - filePath: null, - }) - 1; - } - if (!WEBAudio.audioBufferInstances[soundBufferIndex].filePath) { - if (wx.createBufferURL && typeof wx.createBufferURL === 'function') { - const url = wx.createBufferURL(GameGlobal.unityNamespace.Module.HEAPU8.buffer.slice(ptr, ptr + length)); - sound.buffer = url; - WEBAudio.audioBufferInstances[soundBufferIndex].filePath = url; - } - else { - const filePath = `${wx.env.USER_DATA_PATH}/audiowxgameaudio${soundBufferIndex}`; - wx.getFileSystemManager().writeFile({ - filePath, - data: GameGlobal.unityNamespace.Module.HEAPU8.buffer.slice(ptr, ptr + length), - encoding: 'binary', - success() { - sound.buffer = filePath; - WEBAudio.audioBufferInstances[soundBufferIndex].filePath = filePath; - }, - fail() { - sound.error = true; - }, - }); - } - } - return soundIndex; -}; -UnityAdapter._JS_Sound_Create_Channel = function (_callback, _userData) { - if (disableAudio) { - return false; - } - let channelIndex = -1; - for (let i = 0; i < WEBAudio.audioInstances.length; ++i) { - const channel = WEBAudio.audioInstances[i]; - if (!channel) { - WEBAudio.audioContext[i] = wx.createInnerAudioContext(); - channelIndex = i; - break; - } - } - if (channelIndex === -1) { - channelIndex = WEBAudio.audioInstances.push(wx.createInnerAudioContext()) - 1; - } - return channelIndex; -}; -UnityAdapter._JS_Sound_Play = function (bufferInstance, channelInstance, _offset, _delay) { - if (disableAudio) { - return false; - } - // stop sound which is playing in the channel currently. - // UnityAdapter._JS_Sound_Stop(channelInstance, 0); - let sound = WEBAudio.audioInstances[bufferInstance]; - if (sound.buffer) { - sound = WEBAudio.audioInstances[bufferInstance]; - const channel = WEBAudio.audioInstances[channelInstance]; - channel.src = sound.buffer; - sound.duration = channel.duration; - if (channel.play) { - channel.play(); - } - } - else { - console.log('play with null buffer'); - } - return; -}; -UnityAdapter._JS_Sound_SetLoop = function (channelInstance, loop) { - if (disableAudio) { - return false; - } - WEBAudio.audioInstances[channelInstance].loop = Boolean(loop); - return; -}; -UnityAdapter._JS_Sound_Set3D = function (_channelInstance, _threeD) { - // console.log("not support in wxgame"); -}; -UnityAdapter._JS_Sound_Stop = function (channelInstance, delay) { - if (disableAudio) { - return false; - } - const audioInstance = WEBAudio.audioInstances[channelInstance]; - if (delay === 0) { - if (audioInstance.stop) { - audioInstance.stop(); - } - audioInstance.onEnded = function () { }; - } - else { - setTimeout(() => { - if (audioInstance.stop) { - audioInstance.stop(); - } - }, delay); - } - return; -}; -const soundVolumeHandler = {}; -UnityAdapter._JS_Sound_SetVolume = function (channelInstance, v) { - if (disableAudio) { - return false; - } - if (disableAudioOptimization) { - WEBAudio.audioInstances[channelInstance].volume = Number(v.toFixed(2)); - return false; - } - if (soundVolumeHandler[channelInstance] === Number(v.toFixed(2))) { - return false; - } - soundVolumeHandler[channelInstance] = Number(v.toFixed(2)); - WEBAudio.audioInstances[channelInstance].volume = Number(soundVolumeHandler[channelInstance]); - return; -}; -UnityAdapter._JS_Sound_SetPitch = function (channelInstance, v) { - return; // todo 客户端有bug,先屏蔽,等客户端修复再打开 - WEBAudio.audioInstances[channelInstance].playbackRate = v; - return; -}; -UnityAdapter._JS_Sound_GetLoadState = function (bufferInstance) { - if (disableAudio) { - return false; - } - const sound = WEBAudio.audioInstances[bufferInstance]; - if (sound.buffer) - return 0; - if (sound.error) - return 2; - return 1; -}; -UnityAdapter._JS_Sound_ResumeIfNeeded = function () { - // 这里是页面点击的时候会来检查,这里不需要 -}; -UnityAdapter._JS_Sound_GetLength = function (bufferInstance) { - if (disableAudio) { - return false; - } - const sound = WEBAudio.audioInstances[bufferInstance]; - return sound.duration; -}; -UnityAdapter._JS_Sound_ReleaseInstance = function (instance) { - let audioInstance = WEBAudio.audioInstances[instance]; - audioInstance.destroy && audioInstance.destroy(); - audioInstance = null; -}; -GameGlobal.unityNamespace.UnityAdapter = UnityAdapter; diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/unity-adapter.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/unity-adapter.js.meta deleted file mode 100644 index 4ef91198..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/unity-adapter.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 902b36a4306884e4e907d6122b69e6e4 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/userinfo.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/userinfo.js deleted file mode 100755 index d031491f..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/userinfo.js +++ /dev/null @@ -1,88 +0,0 @@ -import response from "./response"; - -const userInfoButtons = {}; -import moduleHelper from "./module-helper"; - -export default { - /*userInfo按钮*/ - WXCreateUserInfoButton(x, y, width, height, lang, withCredentials){ - const button = wx.createUserInfoButton({ - type: 'text', - text: '', - withCredentials, - lang, - style: { - left: x/window.devicePixelRatio, - top: y/window.devicePixelRatio, - width: width/window.devicePixelRatio, - height: height/window.devicePixelRatio, - backgroundColor: 'rgba(0,0,0,0)', - color: 'rgba(0,0,0,0)', - textAlign: 'center', - fontSize: 0, - borderRadius: 0 - } - }); - - const key = new Date().getTime().toString(32)+Math.random().toString(32); - userInfoButtons[key] = button; - return key; - }, - - WXUserInfoButtonShow(id){ - const button = userInfoButtons[id]; - if(!button){ - return false; - } - button.show(); - }, - WXUserInfoButtonDestroy(id){ - const button = userInfoButtons[id]; - if(!button){ - return false; - } - button.destroy(); - delete userInfoButtons[id]; - }, - WXUserInfoButtonHide(id){ - const button = userInfoButtons[id]; - if(!button){ - return false; - } - button.hide(); - }, - WXUserInfoButtonOffTap(id){ - const button = userInfoButtons[id]; - if(!button){ - return false; - } - button.offTap(); - }, - WXUserInfoButtonOnTap(id){ - const button = userInfoButtons[id]; - if(!button){ - return false; - } - button.onTap((res)=>{ - res.userInfo = res.userInfo || {}; - moduleHelper.send('UserInfoButtonOnTapCallback',JSON.stringify({ - callbackId:id, - errCode:res.err_code || (res.errMsg.indexOf('getUserInfo:fail')===0? 1 : 0), - errMsg:res.errMsg || '', - signature:res.signature || '', - encryptedData: res.encryptedData || '', - iv:res.iv|| '', - cloudID:res.cloudID || '', - userInfoRaw:JSON.stringify({ - nickName:res.userInfo.nickName || '', - avatarUrl:res.userInfo.avatarUrl || '', - country:res.userInfo.country || '', - province:res.userInfo.province || '', - city:res.userInfo.city || '', - language:res.userInfo.language || '', - gender:res.userInfo.gender || 0 - }), - })); - }); - }, -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/userinfo.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/userinfo.js.meta deleted file mode 100644 index 65768665..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/userinfo.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 83f0ada0a8df6364d8c38c757412b59a -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/util.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/util.js deleted file mode 100755 index 6a3b6002..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/util.js +++ /dev/null @@ -1,140 +0,0 @@ -import moduleHelper from "./module-helper"; -import { launchEventType } from "../plugin-config"; - -export default { - WXReportGameStart() { - GameGlobal.manager.reportCustomLaunchInfo(); - }, - WXSetGameStage(stageType) { - if (GameGlobal.manager && GameGlobal.manager.setGameStage) { - GameGlobal.manager.setGameStage(stageType); - } - }, - WXReportGameStageCostTime(ms, extInfo) { - if (GameGlobal.manager && GameGlobal.manager.reportGameStageCostTime) { - GameGlobal.manager.reportGameStageCostTime(ms, extInfo); - } - }, - WXReportGameStageError(errorType, errStr, extInfo) { - if (GameGlobal.manager && GameGlobal.manager.reportGameStageError) { - GameGlobal.manager.reportGameStageError(errorType, errStr, extInfo); - } - }, - WXWriteLog(str) { - if (GameGlobal.manager && GameGlobal.manager.writeLog) { - GameGlobal.manager.writeLog(str); - } - }, - WXWriteWarn(str) { - if (GameGlobal.manager && GameGlobal.manager.writeWarn) { - GameGlobal.manager.writeWarn(str); - } - }, - WXHideLoadingPage() { - if (GameGlobal.manager && GameGlobal.manager.hideLoadingPage) { - GameGlobal.manager.hideLoadingPage(); - } - }, - WXReportUserBehaviorBranchAnalytics(branchId, branchDim, eventType){ - wx.reportUserBehaviorBranchAnalytics(branchId, branchDim, eventType); - - }, - WXPreloadConcurrent(count) { - if (GameGlobal.manager && GameGlobal.manager.setConcurrent) { - GameGlobal.manager.setConcurrent(count) - } - }, - WXIsCloudTest() { - if (typeof GameGlobal.isTest !== "undefined" && GameGlobal.isTest ) { - return true; - } - return false; - }, - WXUncaughtException(needAbort) { - function currentStackTrace() { - var err = new Error('WXUncaughtException'); - return err - } - let err = currentStackTrace(); - let fullTrace = err.stack.toString() - let posOfThisFunc = fullTrace.indexOf('WXUncaughtException') - if (posOfThisFunc != -1) fullTrace = fullTrace.substr(posOfThisFunc); - let posOfRaf = fullTrace.lastIndexOf("browserIterationFunc"); - if (posOfRaf != -1) fullTrace = fullTrace.substr(0, posOfRaf); - const realTimelog = wx.getRealtimeLogManager(); - realTimelog.error(fullTrace) - const logmanager = wx.getLogManager() - logmanager.warn(fullTrace) - if (needAbort === true) { - GameGlobal.onCrash(err); - throw err; - } else { - setTimeout(() => { - throw err; - }, 0); - } - }, - WXCleanAllFileCache() { - if (GameGlobal.manager && GameGlobal.manager.cleanCache) { - const key = new Date().getTime().toString(32)+Math.random().toString(32); - GameGlobal.manager.cleanAllCache().then(res => { - moduleHelper.send('CleanAllFileCacheCallback', JSON.stringify({ - callbackId: key, - result: res - })) - }) - return key; - } - return ''; - }, - WXCleanFileCache(fileSize) { - if (GameGlobal.manager && GameGlobal.manager.cleanCache) { - const key = new Date().getTime().toString(32)+Math.random().toString(32); - GameGlobal.manager.cleanCache(fileSize).then(res => { - moduleHelper.send('CleanFileCacheCallback', JSON.stringify({ - callbackId: key, - result: res - })) - }) - return key; - } - return ''; - }, - WXRemoveFile(path) { - if (GameGlobal.manager && GameGlobal.manager.removeFile && path) { - const key = new Date().getTime().toString(32)+Math.random().toString(32); - GameGlobal.manager.removeFile(path).then(res => { - moduleHelper.send('RemoveFileCallback', JSON.stringify({ - callbackId: key, - result: res - })) - }) - return key; - } - return ''; - }, - WXOnLaunchProgress() { - if (GameGlobal.manager && GameGlobal.manager.onLaunchProgress) { - const key = new Date().getTime().toString(32)+Math.random().toString(32); - // 异步执行,保证C#已经记录这个回调ID - setTimeout(() => { - GameGlobal.manager.onLaunchProgress((e) => { - moduleHelper.send('OnLaunchProgressCallback', JSON.stringify({ - callbackId: key, - res: JSON.stringify(Object.assign({}, e.data, { - type: e.type - })) - })) - // 最后一个事件完成,结束监听 - if (e.type === launchEventType.prepareGame) { - moduleHelper.send('RemoveLaunchProgressCallback', JSON.stringify({ - callbackId: key - })) - } - }) - }, 0); - return key; - } - return ''; - } -} \ No newline at end of file diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/util.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/util.js.meta deleted file mode 100644 index 59af445a..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/util.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d55cad75fa457fd4b846737fadb05ee5 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/video.js b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/video.js deleted file mode 100644 index d77b2692..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/video.js +++ /dev/null @@ -1,84 +0,0 @@ -const videos = {}; -const msg = 'Video 不存在!'; -import moduleHelper from "./module-helper"; -export default { - WXCreateVideo(conf){ - const id = new Date().getTime().toString(32)+Math.random().toString(32); - videos[id] = wx.createVideo(JSON.parse(conf)); - return id; - }, - WXVideoPlay(id){ - if(videos[id]){ - videos[id].play(); - }else{ - console.error(msg,id); - } - }, - WXVideoAddListener(id,key){ - if(videos[id]){ - videos[id][key](function(e){ - moduleHelper.send('OnVideoCallback',JSON.stringify({ - callbackId:id, - errMsg:key, - position:e && e.position, - buffered:e && e.buffered, - duration:e && e.duration - })); - if(key === 'onError'){ - console.error(e); - } - }); - }else{ - console.error(msg,id); - } - }, - WXVideoDestroy(id){ - if(videos[id]){ - videos[id].destroy(); - }else{ - console.error(msg,id); - } - }, - WXVideoExitFullScreen(id){ - if(videos[id]){ - videos[id].exitFullScreen(); - }else{ - console.error(msg,id); - } - }, - WXVideoPause(id){ - if(videos[id]){ - videos[id].pause(); - }else{ - console.error(msg,id); - } - }, - WXVideoRequestFullScreen(id,direction){ - if(videos[id]){ - videos[id].requestFullScreen(direction); - }else{ - console.error(msg,id); - } - }, - WXVideoSeek(id,time){ - if(videos[id]){ - videos[id].seek(time); - }else{ - console.error(msg,id); - } - }, - WXVideoStop(id){ - if(videos[id]){ - videos[id].stop(); - }else{ - console.error(msg,id); - } - }, - WXVideoRemoveListener(id,key){ - if(videos[id]){ - videos[id][key](); - }else{ - console.error(msg,id); - } - } -} diff --git a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/video.js.meta b/Assets/WX-WASM-SDK/wechat-default/unity-sdk/video.js.meta deleted file mode 100644 index 2131fd34..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/unity-sdk/video.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6a6308a0f76484fdba32c7689bd849a8 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/wasmcode.meta b/Assets/WX-WASM-SDK/wechat-default/wasmcode.meta deleted file mode 100644 index 4f5a5e06..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/wasmcode.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e9ea9747ed54d45f298559f942d4b632 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/wasmcode/game.js b/Assets/WX-WASM-SDK/wechat-default/wasmcode/game.js deleted file mode 100755 index e69de29b..00000000 diff --git a/Assets/WX-WASM-SDK/wechat-default/wasmcode/game.js.meta b/Assets/WX-WASM-SDK/wechat-default/wasmcode/game.js.meta deleted file mode 100644 index d459bcbf..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/wasmcode/game.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 762b2c3487d6b3446866de624278f9fe -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/weapp-adapter.js b/Assets/WX-WASM-SDK/wechat-default/weapp-adapter.js deleted file mode 100644 index 528ad223..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/weapp-adapter.js +++ /dev/null @@ -1,1636 +0,0 @@ -var isWK = false; -try{ - isWK = wx.getSystemInfoSync().renderer == 'h5'; -}catch(e){ - isWK = typeof(window)!='undefined' && window.XMLHttpRequest; -} -/******/ (function(modules) { // webpackBootstrap - /******/ // The module cache - /******/ var installedModules = {}; - - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - - /******/ // Check if module is in cache - /******/ if(installedModules[moduleId]) - /******/ return installedModules[moduleId].exports; - - /******/ // Create a new module (and put it into the cache) - /******/ var module = installedModules[moduleId] = { - /******/ exports: {}, - /******/ id: moduleId, - /******/ loaded: false - /******/ }; - - /******/ // Execute the module function - /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - - /******/ // Flag the module as loaded - /******/ module.loaded = true; - - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - - - /******/ // expose the modules object (__webpack_modules__) - /******/ __webpack_require__.m = modules; - - /******/ // expose the module cache - /******/ __webpack_require__.c = installedModules; - - /******/ // __webpack_public_path__ - /******/ __webpack_require__.p = ""; - - /******/ // Load entry module and return exports - /******/ return __webpack_require__(0); - /******/ }) -/************************************************************************/ -/******/ ([ - /* 0 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var _window2 = __webpack_require__(1); - - var _window = _interopRequireWildcard(_window2); - - var _HTMLElement = __webpack_require__(5); - - var _HTMLElement2 = _interopRequireDefault(_HTMLElement); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - - var global = GameGlobal; - - function inject() { - _window.addEventListener = function (type, listener) { - _window.document.addEventListener(type, listener); - }; - _window.removeEventListener = function (type, listener) { - _window.document.removeEventListener(type, listener); - }; - - if (_window.canvas) { - _window.canvas.addEventListener = _window.addEventListener; - _window.canvas.removeEventListener = _window.removeEventListener; - } - - var _wx$getSystemInfoSync = wx.getSystemInfoSync(), - platform = _wx$getSystemInfoSync.platform; - - // 开发者工具无法重定义 window - - - if (platform === 'devtools') { - for (var key in _window) { - var descriptor = Object.getOwnPropertyDescriptor(global, key); - - if (!descriptor || descriptor.configurable === true) { - Object.defineProperty(window, key, { - value: _window[key] - }); - } - } - - for (var _key in _window.document) { - var _descriptor = Object.getOwnPropertyDescriptor(global.document, _key); - - if (!_descriptor || _descriptor.configurable === true) { - Object.defineProperty(global.document, _key, { - value: _window.document[_key] - }); - } - } - window.parent = window; - } else { - for (var _key2 in _window) { - global[_key2] = _window[_key2]; - } - global.window = _window; - window = global; - window.top = window.parent = window; - } - } - - if (!GameGlobal.__isAdapterInjected) { - GameGlobal.__isAdapterInjected = true; - inject(); - } - - /***/ }), - /* 1 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.cancelAnimationFrame = exports.requestAnimationFrame = exports.clearInterval = exports.clearTimeout = exports.setInterval = exports.setTimeout = exports.canvas = exports.location = exports.localStorage = exports.HTMLElement = exports.FileReader = exports.Audio = exports.Image = exports.WebSocket = /*exports.XMLHttpRequest =*/ exports.navigator = exports.document = undefined; - if(!isWK){ - exports.XMLHttpRequest = undefined; - } - - var _WindowProperties = __webpack_require__(2); - - Object.keys(_WindowProperties).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function get() { - return _WindowProperties[key]; - } - }); - }); - - var _constructor = __webpack_require__(4); - - Object.keys(_constructor).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function get() { - return _constructor[key]; - } - }); - }); - - var _Canvas = __webpack_require__(10); - - var _Canvas2 = _interopRequireDefault(_Canvas); - - var _document2 = __webpack_require__(11); - - var _document3 = _interopRequireDefault(_document2); - - var _navigator2 = __webpack_require__(18); - - var _navigator3 = _interopRequireDefault(_navigator2); - - var _XMLHttpRequest2 = __webpack_require__(19); - - var _XMLHttpRequest3 = _interopRequireDefault(_XMLHttpRequest2); - - var _WebSocket2 = __webpack_require__(20); - - var _WebSocket3 = _interopRequireDefault(_WebSocket2); - - var _Image2 = __webpack_require__(12); - - var _Image3 = _interopRequireDefault(_Image2); - - var _Audio2 = __webpack_require__(13); - - var _Audio3 = _interopRequireDefault(_Audio2); - - var _FileReader2 = __webpack_require__(21); - - var _FileReader3 = _interopRequireDefault(_FileReader2); - - var _HTMLElement2 = __webpack_require__(5); - - var _HTMLElement3 = _interopRequireDefault(_HTMLElement2); - - var _localStorage2 = __webpack_require__(22); - - var _localStorage3 = _interopRequireDefault(_localStorage2); - - var _location2 = __webpack_require__(23); - - var _location3 = _interopRequireDefault(_location2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.document = _document3.default; - exports.navigator = _navigator3.default; - if(!isWK){ - exports.XMLHttpRequest = _XMLHttpRequest3.default; - } - //exports.XMLHttpRequest = _XMLHttpRequest3.default; - exports.WebSocket = _WebSocket3.default; - exports.Image = _Image3.default; - exports.Audio = _Audio3.default; - exports.FileReader = _FileReader3.default; - exports.HTMLElement = _HTMLElement3.default; - exports.localStorage = _localStorage3.default; - exports.location = _location3.default; - - // 模拟web中的CustomEvent接口 - function CustomEvent(event, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: undefined - }; - var evt = { - type: event, - bubbles: params.bubbles, - cancelable: params.cancelable, - detail: params.detail - }; - return evt; - }; - - exports.CustomEvent = CustomEvent; - - // 暴露全局的 canvas - var canvas = new _Canvas2.default(); - - exports.canvas = canvas; - exports.setTimeout = setTimeout; - exports.setInterval = setInterval; - exports.clearTimeout = clearTimeout; - exports.clearInterval = clearInterval; - exports.requestAnimationFrame = requestAnimationFrame; - exports.cancelAnimationFrame = cancelAnimationFrame; - - /***/ }), - /* 2 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.performance = exports.ontouchend = exports.ontouchmove = exports.ontouchstart = exports.screen = exports.devicePixelRatio = exports.innerHeight = exports.innerWidth = undefined; - - var _performance2 = __webpack_require__(3); - - var _performance3 = _interopRequireDefault(_performance2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var _wx$getSystemInfoSync = wx.getSystemInfoSync(), - screenWidth = _wx$getSystemInfoSync.screenWidth, - screenHeight = _wx$getSystemInfoSync.screenHeight, - devicePixelRatio = _wx$getSystemInfoSync.devicePixelRatio; - - var innerWidth = exports.innerWidth = screenWidth; - var innerHeight = exports.innerHeight = screenHeight; - exports.devicePixelRatio = devicePixelRatio; - var screen = exports.screen = { - availWidth: innerWidth, - availHeight: innerHeight - }; - var ontouchstart = exports.ontouchstart = null; - var ontouchmove = exports.ontouchmove = null; - var ontouchend = exports.ontouchend = null; - - exports.performance = _performance3.default; - - /***/ }), - /* 3 */ - /***/ (function(module, exports) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - var performance = void 0; - - if (wx.getPerformance) { - var _wx$getSystemInfoSync = wx.getSystemInfoSync(), - platform = _wx$getSystemInfoSync.platform; - - var wxPerf = wx.getPerformance(); - var initTime = wxPerf.now(); - - var clientPerfAdapter = Object.assign({}, wxPerf, { - now: function now() { - return (wxPerf.now() - initTime) / 1000; - } - }); - - performance = platform === 'devtools' ? wxPerf : clientPerfAdapter; - } - - exports.default = performance; - - /***/ }), - /* 4 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.HTMLCanvasElement = exports.HTMLImageElement = undefined; - - var _HTMLElement3 = __webpack_require__(5); - - var _HTMLElement4 = _interopRequireDefault(_HTMLElement3); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var HTMLImageElement = exports.HTMLImageElement = function (_HTMLElement) { - _inherits(HTMLImageElement, _HTMLElement); - - function HTMLImageElement() { - _classCallCheck(this, HTMLImageElement); - - return _possibleConstructorReturn(this, (HTMLImageElement.__proto__ || Object.getPrototypeOf(HTMLImageElement)).call(this, 'img')); - } - - return HTMLImageElement; - }(_HTMLElement4.default); - - var HTMLCanvasElement = exports.HTMLCanvasElement = function (_HTMLElement2) { - _inherits(HTMLCanvasElement, _HTMLElement2); - - function HTMLCanvasElement() { - _classCallCheck(this, HTMLCanvasElement); - - return _possibleConstructorReturn(this, (HTMLCanvasElement.__proto__ || Object.getPrototypeOf(HTMLCanvasElement)).call(this, 'canvas')); - } - - return HTMLCanvasElement; - }(_HTMLElement4.default); - - /***/ }), - /* 5 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _Element2 = __webpack_require__(6); - - var _Element3 = _interopRequireDefault(_Element2); - - var _util = __webpack_require__(9); - - var _WindowProperties = __webpack_require__(2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var HTMLElement = function (_Element) { - _inherits(HTMLElement, _Element); - - function HTMLElement() { - var tagName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - _classCallCheck(this, HTMLElement); - - var _this = _possibleConstructorReturn(this, (HTMLElement.__proto__ || Object.getPrototypeOf(HTMLElement)).call(this)); - - _this.className = ''; - _this.childern = []; - _this.style = { - width: _WindowProperties.innerWidth + 'px', - height: _WindowProperties.innerHeight + 'px' - }; - _this.insertBefore = _util.noop; - _this.innerHTML = ''; - - _this.tagName = tagName.toUpperCase(); - return _this; - } - - _createClass(HTMLElement, [{ - key: 'setAttribute', - value: function setAttribute(name, value) { - this[name] = value; - } - }, { - key: 'getAttribute', - value: function getAttribute(name) { - return this[name]; - } - }, { - key: 'getBoundingClientRect', - value: function getBoundingClientRect() { - return { - top: 0, - left: 0, - width: _WindowProperties.innerWidth, - height: _WindowProperties.innerHeight - }; - } - }, { - key: 'focus', - value: function focus() {} - }, { - key: 'clientWidth', - get: function get() { - var ret = parseInt(this.style.fontSize, 10) * this.innerHTML.length; - - return Number.isNaN(ret) ? 0 : ret; - } - }, { - key: 'clientHeight', - get: function get() { - var ret = parseInt(this.style.fontSize, 10); - - return Number.isNaN(ret) ? 0 : ret; - } - }]); - - return HTMLElement; - }(_Element3.default); - - exports.default = HTMLElement; - - /***/ }), - /* 6 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _Node2 = __webpack_require__(7); - - var _Node3 = _interopRequireDefault(_Node2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var ELement = function (_Node) { - _inherits(ELement, _Node); - - function ELement() { - _classCallCheck(this, ELement); - - var _this = _possibleConstructorReturn(this, (ELement.__proto__ || Object.getPrototypeOf(ELement)).call(this)); - - _this.className = ''; - _this.children = []; - return _this; - } - - return ELement; - }(_Node3.default); - - exports.default = ELement; - - /***/ }), - /* 7 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _EventTarget2 = __webpack_require__(8); - - var _EventTarget3 = _interopRequireDefault(_EventTarget2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var Node = function (_EventTarget) { - _inherits(Node, _EventTarget); - - function Node() { - _classCallCheck(this, Node); - - var _this = _possibleConstructorReturn(this, (Node.__proto__ || Object.getPrototypeOf(Node)).call(this)); - - _this.childNodes = []; - return _this; - } - - _createClass(Node, [{ - key: 'appendChild', - value: function appendChild(node) { - if (node instanceof Node) { - this.childNodes.push(node); - } else { - throw new TypeError('Failed to executed \'appendChild\' on \'Node\': parameter 1 is not of type \'Node\'.'); - } - } - }, { - key: 'cloneNode', - value: function cloneNode() { - var copyNode = Object.create(this); - - Object.assign(copyNode, this); - return copyNode; - } - }, { - key: 'removeChild', - value: function removeChild(node) { - var index = this.childNodes.findIndex(function (child) { - return child === node; - }); - - if (index > -1) { - return this.childNodes.splice(index, 1); - } - return null; - } - }]); - - return Node; - }(_EventTarget3.default); - - exports.default = Node; - - /***/ }), - /* 8 */ - /***/ (function(module, exports) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var _events = new WeakMap(); - - var EventTarget = function () { - function EventTarget() { - _classCallCheck(this, EventTarget); - - _events.set(this, {}); - } - - _createClass(EventTarget, [{ - key: 'addEventListener', - value: function addEventListener(type, listener) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - var events = _events.get(this); - - if (!events) { - events = {}; - _events.set(this, events); - } - if (!events[type]) { - events[type] = []; - } - events[type].push(listener); - - if (options.capture) { - console.warn('EventTarget.addEventListener: options.capture is not implemented.'); - } - if (options.once) { - console.warn('EventTarget.addEventListener: options.once is not implemented.'); - } - if (options.passive) { - console.warn('EventTarget.addEventListener: options.passive is not implemented.'); - } - } - }, { - key: 'removeEventListener', - value: function removeEventListener(type, listener) { - var listeners = _events.get(this)[type]; - - if (listeners && listeners.length > 0) { - for (var i = listeners.length; i--; i > 0) { - if (listeners[i] === listener) { - listeners.splice(i, 1); - break; - } - } - } - } - }, { - key: 'dispatchEvent', - value: function dispatchEvent() { - var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - var listeners = _events.get(this)[event.type]; - - if (listeners) { - for (var i = 0; i < listeners.length; i++) { - listeners[i](event); - } - } - } - }]); - - return EventTarget; - }(); - - exports.default = EventTarget; - - /***/ }), - /* 9 */ - /***/ (function(module, exports) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.noop = noop; - function noop() {} - - /***/ }), - /* 10 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = Canvas; - - var _constructor = __webpack_require__(4); - - var _HTMLElement = __webpack_require__(5); - - var _HTMLElement2 = _interopRequireDefault(_HTMLElement); - - var _document = __webpack_require__(11); - - var _document2 = _interopRequireDefault(_document); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var hasModifiedCanvasPrototype = false; - var hasInit2DContextConstructor = false; - var hasInitWebGLContextConstructor = false; - - function Canvas() { - var canvas = wx.createCanvas(); - - canvas.type = 'canvas'; - - canvas.__proto__.__proto__ = new _HTMLElement2.default('canvas'); - - var _getContext = canvas.getContext; - - canvas.getBoundingClientRect = function () { - var ret = { - top: 0, - left: 0, - width: window.innerWidth, - height: window.innerHeight - }; - return ret; - }; - - return canvas; - } - - /***/ }), - /* 11 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _window = __webpack_require__(1); - - var window = _interopRequireWildcard(_window); - - var _HTMLElement = __webpack_require__(5); - - var _HTMLElement2 = _interopRequireDefault(_HTMLElement); - - var _Image = __webpack_require__(12); - - var _Image2 = _interopRequireDefault(_Image); - - var _Audio = __webpack_require__(13); - - var _Audio2 = _interopRequireDefault(_Audio); - - var _Canvas = __webpack_require__(10); - - var _Canvas2 = _interopRequireDefault(_Canvas); - - __webpack_require__(16); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - - var events = {}; - - var document = { - readyState: 'complete', - visibilityState: 'visible', - documentElement: window, - hidden: false, - style: {}, - location: window.location, - ontouchstart: null, - ontouchmove: null, - ontouchend: null, - - head: new _HTMLElement2.default('head'), - body: new _HTMLElement2.default('body'), - - createElement: function createElement(tagName) { - if (tagName === 'canvas') { - return new _Canvas2.default(); - } else if (tagName === 'audio') { - return new _Audio2.default(); - } else if (tagName === 'img') { - return new _Image2.default(); - } - - return new _HTMLElement2.default(tagName); - }, - getElementById: function getElementById(id) { - if (id === window.canvas.id) { - return window.canvas; - } - return null; - }, - getElementsByTagName: function getElementsByTagName(tagName) { - if (tagName === 'head') { - return [document.head]; - } else if (tagName === 'body') { - return [document.body]; - } else if (tagName === 'canvas') { - return [window.canvas]; - } - return []; - }, - getElementsByName: function getElementsByName(tagName) { - if (tagName === 'head') { - return [document.head]; - } else if (tagName === 'body') { - return [document.body]; - } else if (tagName === 'canvas') { - return [window.canvas]; - } - return []; - }, - querySelector: function querySelector(query) { - if (query === 'head') { - return document.head; - } else if (query === 'body') { - return document.body; - } else if (query === 'canvas') { - return window.canvas; - } else if (query === '#' + window.canvas.id) { - return window.canvas; - } - return null; - }, - querySelectorAll: function querySelectorAll(query) { - if (query === 'head') { - return [document.head]; - } else if (query === 'body') { - return [document.body]; - } else if (query === 'canvas') { - return [window.canvas]; - } - return []; - }, - addEventListener: function addEventListener(type, listener) { - if (!events[type]) { - events[type] = []; - } - events[type].push(listener); - }, - removeEventListener: function removeEventListener(type, listener) { - var listeners = events[type]; - - if (listeners && listeners.length > 0) { - for (var i = listeners.length; i--; i > 0) { - if (listeners[i] === listener) { - listeners.splice(i, 1); - break; - } - } - } - }, - dispatchEvent: function dispatchEvent(event) { - var listeners = events[event.type]; - - if (listeners) { - for (var i = 0; i < listeners.length; i++) { - listeners[i](event); - } - } - } - }; - - exports.default = document; - - /***/ }), - /* 12 */ - /***/ (function(module, exports) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = Image; - function Image() { - var image = wx.createImage(); - - return image; - } - - /***/ }), - /* 13 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _HTMLAudioElement2 = __webpack_require__(14); - - var _HTMLAudioElement3 = _interopRequireDefault(_HTMLAudioElement2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var HAVE_NOTHING = 0; - var HAVE_METADATA = 1; - var HAVE_CURRENT_DATA = 2; - var HAVE_FUTURE_DATA = 3; - var HAVE_ENOUGH_DATA = 4; - - var _innerAudioContext = new WeakMap(); - var _src = new WeakMap(); - var _loop = new WeakMap(); - var _autoplay = new WeakMap(); - - var Audio = function (_HTMLAudioElement) { - _inherits(Audio, _HTMLAudioElement); - - function Audio(url) { - _classCallCheck(this, Audio); - - var _this = _possibleConstructorReturn(this, (Audio.__proto__ || Object.getPrototypeOf(Audio)).call(this)); - - _this.HAVE_NOTHING = HAVE_NOTHING; - _this.HAVE_METADATA = HAVE_METADATA; - _this.HAVE_CURRENT_DATA = HAVE_CURRENT_DATA; - _this.HAVE_FUTURE_DATA = HAVE_FUTURE_DATA; - _this.HAVE_ENOUGH_DATA = HAVE_ENOUGH_DATA; - _this.readyState = HAVE_NOTHING; - - - _src.set(_this, ''); - - var innerAudioContext = wx.createInnerAudioContext(); - - _innerAudioContext.set(_this, innerAudioContext); - - innerAudioContext.onCanplay(function () { - _this.dispatchEvent({ type: 'load' }); - _this.dispatchEvent({ type: 'loadend' }); - _this.dispatchEvent({ type: 'canplay' }); - _this.dispatchEvent({ type: 'canplaythrough' }); - _this.dispatchEvent({ type: 'loadedmetadata' }); - _this.readyState = HAVE_CURRENT_DATA; - }); - innerAudioContext.onPlay(function () { - _this.dispatchEvent({ type: 'play' }); - }); - innerAudioContext.onPause(function () { - _this.dispatchEvent({ type: 'pause' }); - }); - innerAudioContext.onEnded(function () { - _this.dispatchEvent({ type: 'ended' }); - _this.readyState = HAVE_ENOUGH_DATA; - }); - innerAudioContext.onError(function () { - _this.dispatchEvent({ type: 'error' }); - }); - - if (url) { - _innerAudioContext.get(_this).src = url; - } - return _this; - } - - _createClass(Audio, [{ - key: 'load', - value: function load() { - console.warn('HTMLAudioElement.load() is not implemented.'); - } - }, { - key: 'play', - value: function play() { - _innerAudioContext.get(this).play(); - } - }, { - key: 'pause', - value: function pause() { - _innerAudioContext.get(this).pause(); - } - }, { - key: 'canPlayType', - value: function canPlayType() { - var mediaType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - if (typeof mediaType !== 'string') { - return ''; - } - - if (mediaType.indexOf('audio/mpeg') > -1 || mediaType.indexOf('audio/mp4')) { - return 'probably'; - } - return ''; - } - }, { - key: 'cloneNode', - value: function cloneNode() { - var newAudio = new Audio(); - newAudio.loop = _innerAudioContext.get(this).loop; - newAudio.autoplay = _innerAudioContext.get(this).autoplay; - newAudio.src = this.src; - return newAudio; - } - }, { - key: 'currentTime', - get: function get() { - return _innerAudioContext.get(this).currentTime; - }, - set: function set(value) { - _innerAudioContext.get(this).seek(value); - } - }, { - key: 'src', - get: function get() { - return _src.get(this); - }, - set: function set(value) { - _src.set(this, value); - _innerAudioContext.get(this).src = value; - } - }, { - key: 'loop', - get: function get() { - return _innerAudioContext.get(this).loop; - }, - set: function set(value) { - _innerAudioContext.get(this).loop = value; - } - }, { - key: 'autoplay', - get: function get() { - return _innerAudioContext.get(this).autoplay; - }, - set: function set(value) { - _innerAudioContext.get(this).autoplay = value; - } - }, { - key: 'paused', - get: function get() { - return _innerAudioContext.get(this).paused; - } - }]); - - return Audio; - }(_HTMLAudioElement3.default); - - exports.default = Audio; - - /***/ }), - /* 14 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _HTMLMediaElement2 = __webpack_require__(15); - - var _HTMLMediaElement3 = _interopRequireDefault(_HTMLMediaElement2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var HTMLAudioElement = function (_HTMLMediaElement) { - _inherits(HTMLAudioElement, _HTMLMediaElement); - - function HTMLAudioElement() { - _classCallCheck(this, HTMLAudioElement); - - return _possibleConstructorReturn(this, (HTMLAudioElement.__proto__ || Object.getPrototypeOf(HTMLAudioElement)).call(this, 'audio')); - } - - return HTMLAudioElement; - }(_HTMLMediaElement3.default); - - exports.default = HTMLAudioElement; - - /***/ }), - /* 15 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _HTMLElement2 = __webpack_require__(5); - - var _HTMLElement3 = _interopRequireDefault(_HTMLElement2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var HTMLMediaElement = function (_HTMLElement) { - _inherits(HTMLMediaElement, _HTMLElement); - - function HTMLMediaElement(type) { - _classCallCheck(this, HTMLMediaElement); - - return _possibleConstructorReturn(this, (HTMLMediaElement.__proto__ || Object.getPrototypeOf(HTMLMediaElement)).call(this, type)); - } - - _createClass(HTMLMediaElement, [{ - key: 'addTextTrack', - value: function addTextTrack() {} - }, { - key: 'captureStream', - value: function captureStream() {} - }, { - key: 'fastSeek', - value: function fastSeek() {} - }, { - key: 'load', - value: function load() {} - }, { - key: 'pause', - value: function pause() {} - }, { - key: 'play', - value: function play() {} - }]); - - return HTMLMediaElement; - }(_HTMLElement3.default); - - exports.default = HTMLMediaElement; - - /***/ }), - /* 16 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - __webpack_require__(17); - - /***/ }), - /* 17 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - var _window = __webpack_require__(1); - - var window = _interopRequireWildcard(_window); - - var _document = __webpack_require__(11); - - var _document2 = _interopRequireDefault(_document); - - var _util = __webpack_require__(9); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var TouchEvent = function TouchEvent(type) { - _classCallCheck(this, TouchEvent); - - this.target = window.canvas; - this.currentTarget = window.canvas; - this.touches = []; - this.targetTouches = []; - this.changedTouches = []; - this.preventDefault = _util.noop; - this.stopPropagation = _util.noop; - - this.type = type; - }; - - function touchEventHandlerFactory(type) { - return function (event) { - var touchEvent = new TouchEvent(type); - - touchEvent.touches = event.touches; - touchEvent.targetTouches = Array.prototype.slice.call(event.touches); - touchEvent.changedTouches = event.changedTouches; - touchEvent.timeStamp = event.timeStamp; - _document2.default.dispatchEvent(touchEvent); - }; - } - - wx.onTouchStart(touchEventHandlerFactory('touchstart')); - wx.onTouchMove(touchEventHandlerFactory('touchmove')); - wx.onTouchEnd(touchEventHandlerFactory('touchend')); - wx.onTouchCancel(touchEventHandlerFactory('touchcancel')); - - /***/ }), - /* 18 */ - /***/ (function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _util = __webpack_require__(9); - - // TODO 需要 wx.getSystemInfo 获取更详细信息 - var _wx$getSystemInfoSync = wx.getSystemInfoSync(), - platform = _wx$getSystemInfoSync.platform; - - var navigator = { - platform: platform, - language: 'zh-cn', - appVersion: '5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', - userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301 MicroMessenger/6.6.0 MiniGame NetType/WIFI Language/zh_CN', - onLine: true, // TODO 用 wx.getNetworkStateChange 和 wx.onNetworkStateChange 来返回真实的状态 - - // TODO 用 wx.getLocation 来封装 geolocation - geolocation: { - getCurrentPosition: _util.noop, - watchPosition: _util.noop, - clearWatch: _util.noop - } - }; - - exports.default = navigator; - - /***/ }), - /* 19 */ - /***/ (function(module, exports) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var _url = new WeakMap(); - var _method = new WeakMap(); - var _requestHeader = new WeakMap(); - var _responseHeader = new WeakMap(); - var _requestTask = new WeakMap(); - - function _triggerEvent(type) { - if (typeof this['on' + type] === 'function') { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - this['on' + type].apply(this, args); - } - } - - function _changeReadyState(readyState) { - this.readyState = readyState; - _triggerEvent.call(this, 'readystatechange'); - } - - var XMLHttpRequest = function () { - // TODO 没法模拟 HEADERS_RECEIVED 和 LOADING 两个状态 - function XMLHttpRequest() { - _classCallCheck(this, XMLHttpRequest); - - this.onabort = null; - this.onerror = null; - this.onload = null; - this.onloadstart = null; - this.onprogress = null; - this.ontimeout = null; - this.onloadend = null; - this.onreadystatechange = null; - this.readyState = 0; - this.response = null; - this.responseText = null; - this.responseType = ''; - this.responseXML = null; - this.status = 0; - this.statusText = ''; - this.upload = {}; - this.withCredentials = false; - - _requestHeader.set(this, { - 'content-type': 'application/x-www-form-urlencoded' - }); - _responseHeader.set(this, {}); - } - - /* - * TODO 这一批事件应该是在 XMLHttpRequestEventTarget.prototype 上面的 - */ - - - _createClass(XMLHttpRequest, [{ - key: 'abort', - value: function abort() { - var myRequestTask = _requestTask.get(this); - - if (myRequestTask) { - myRequestTask.abort(); - } - } - }, { - key: 'getAllResponseHeaders', - value: function getAllResponseHeaders() { - var responseHeader = _responseHeader.get(this); - - return Object.keys(responseHeader).map(function (header) { - return header + ': ' + responseHeader[header]; - }).join('\n'); - } - }, { - key: 'getResponseHeader', - value: function getResponseHeader(header) { - return _responseHeader.get(this)[header]; - } - }, { - key: 'open', - value: function open(method, url /* async, user, password 这几个参数在小程序内不支持*/) { - _method.set(this, method); - _url.set(this, url); - _changeReadyState.call(this, XMLHttpRequest.OPENED); - } - }, { - key: 'overrideMimeType', - value: function overrideMimeType() {} - }, { - key: 'send', - value: function send() { - var _this = this; - - var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - if (this.readyState !== XMLHttpRequest.OPENED) { - throw new Error("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED."); - } else { - if(data instanceof Uint8Array){ - // unity 过来的请求会出现Uint8Array的数组,而客户端这里处理有问题,先这样兼容 - data = Uint8Array.from(data).buffer; - } - let responseType = this.responseType; - wx.request({ - data: data, - url: _url.get(this), - method: _method.get(this), - header: _requestHeader.get(this), - responseType: this.responseType, - enableHttp2:true, - enableQuic:true, - success: function success(_ref) { - var data = _ref.data, - statusCode = _ref.statusCode, - header = _ref.header; - - if (typeof data !== 'string' && !(data instanceof ArrayBuffer)) { - try { - data = JSON.stringify(data); - } catch (e) { - data = data; - } - } - - _this.status = statusCode; - _responseHeader.set(_this, header); - _triggerEvent.call(_this, 'loadstart'); - _changeReadyState.call(_this, XMLHttpRequest.HEADERS_RECEIVED); - _changeReadyState.call(_this, XMLHttpRequest.LOADING); - - _this.response = data; - - if(responseType === 'text'){ - if (data instanceof ArrayBuffer) { - _this.responseText = ''; - var bytes = new Uint8Array(data); - var len = bytes.byteLength; - - for (var i = 0; i < len; i++) { - _this.responseText += String.fromCharCode(bytes[i]); - } - } else { - _this.responseText = data; - } - } - - _changeReadyState.call(_this, XMLHttpRequest.DONE); - _triggerEvent.call(_this, 'load'); - _triggerEvent.call(_this, 'loadend'); - }, - fail: function fail(_ref2) { - var errMsg = _ref2.errMsg; - - // TODO 规范错误 - if (errMsg.indexOf('abort') !== -1) { - _triggerEvent.call(_this, 'abort'); - } else { - _triggerEvent.call(_this, 'error', errMsg); - } - _triggerEvent.call(_this, 'loadend'); - } - }); - } - } - }, { - key: 'setRequestHeader', - value: function setRequestHeader(header, value) { - var myHeader = _requestHeader.get(this); - - myHeader[header] = value; - _requestHeader.set(this, myHeader); - } - }]); - - return XMLHttpRequest; - }(); - - XMLHttpRequest.UNSEND = 0; - XMLHttpRequest.OPENED = 1; - XMLHttpRequest.HEADERS_RECEIVED = 2; - XMLHttpRequest.LOADING = 3; - XMLHttpRequest.DONE = 4; - if(!isWK){ - exports.default = XMLHttpRequest; - } - - - /***/ }), - /* 20 */ - /***/ (function(module, exports) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var _socketTask = new WeakMap(); - - var WebSocket = function () { - // TODO 更新 binaryType - // The connection is in the process of closing. - // The connection is not yet open. - function WebSocket(url) { - var _this = this; - - var protocols = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - - _classCallCheck(this, WebSocket); - - this.binaryType = ''; - this.bufferedAmount = 0; - this.extensions = ''; - this.onclose = null; - this.onerror = null; - this.onmessage = null; - this.onopen = null; - this.protocol = ''; - this.readyState = 3; - - if (typeof url !== 'string' || !/(^ws:\/\/)|(^wss:\/\/)/.test(url)) { - throw new TypeError('Failed to construct \'WebSocket\': The URL \'' + url + '\' is invalid'); - } - - this.url = url; - this.readyState = WebSocket.CONNECTING; - - var socketTask = wx.connectSocket({ - url: url, - protocols: Array.isArray(protocols) ? protocols : [protocols] - }); - - _socketTask.set(this, socketTask); - - socketTask.onClose(function (res) { - _this.readyState = WebSocket.CLOSED; - if (typeof _this.onclose === 'function') { - _this.onclose(res); - } - }); - - socketTask.onMessage(function (res) { - if (typeof _this.onmessage === 'function') { - _this.onmessage(res); - } - }); - - socketTask.onOpen(function () { - _this.readyState = WebSocket.OPEN; - if (typeof _this.onopen === 'function') { - _this.onopen(); - } - }); - - socketTask.onError(function (res) { - if (typeof _this.onerror === 'function') { - _this.onerror(new Error(res.errMsg)); - } - }); - - return this; - } // TODO 小程序内目前获取不到,实际上需要根据服务器选择的 sub-protocol 返回 - // TODO 更新 bufferedAmount - // The connection is closed or couldn't be opened. - - // The connection is open and ready to communicate. - - - _createClass(WebSocket, [{ - key: 'close', - value: function close(code, reason) { - this.readyState = WebSocket.CLOSING; - var socketTask = _socketTask.get(this); - - socketTask.close({ - code: code, - reason: reason - }); - } - }, { - key: 'send', - value: function send(data) { - if (typeof data !== 'string' && !(data instanceof ArrayBuffer) && !((typeof data) === 'object')) { - throw new TypeError('Failed to send message: The data ' + data + ' is invalid'); - } - - var socketTask = _socketTask.get(this); - - socketTask.send({ - data: data - }); - } - }]); - - return WebSocket; - }(); - - WebSocket.CONNECTING = 0; - WebSocket.OPEN = 1; - WebSocket.CLOSING = 2; - WebSocket.CLOSED = 3; - exports.default = WebSocket; - - /***/ }), - /* 21 */ - /***/ (function(module, exports) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /* - * TODO 使用 wx.readFile 来封装 FileReader - */ - var FileReader = function () { - function FileReader() { - _classCallCheck(this, FileReader); - } - - _createClass(FileReader, [{ - key: "construct", - value: function construct() {} - }]); - - return FileReader; - }(); - - exports.default = FileReader; - - /***/ }), - /* 22 */ - /***/ (function(module, exports) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - var localStorage = { - get length() { - var _wx$getStorageInfoSyn = wx.getStorageInfoSync(), - keys = _wx$getStorageInfoSyn.keys; - - return keys.length; - }, - - key: function key(n) { - var _wx$getStorageInfoSyn2 = wx.getStorageInfoSync(), - keys = _wx$getStorageInfoSyn2.keys; - - return keys[n]; - }, - getItem: function getItem(key) { - return wx.getStorageSync(key); - }, - setItem: function setItem(key, value) { - return wx.setStorageSync(key, value); - }, - removeItem: function removeItem(key) { - wx.removeStorageSync(key); - }, - clear: function clear() { - wx.clearStorageSync(); - } - }; - - exports.default = localStorage; - - /***/ }), - /* 23 */ - /***/ (function(module, exports) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - var location = { - href: 'game.js', - reload: function reload() {} - }; - - exports.default = location; - - /***/ }) - /******/ ]); diff --git a/Assets/WX-WASM-SDK/wechat-default/weapp-adapter.js.meta b/Assets/WX-WASM-SDK/wechat-default/weapp-adapter.js.meta deleted file mode 100644 index aa8cfdeb..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/weapp-adapter.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 92b35ac1c44645648915f7ace32ce687 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/workers.meta b/Assets/WX-WASM-SDK/wechat-default/workers.meta deleted file mode 100644 index 11f8c831..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/workers.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cc4e889baa120413389707fa9bbc6d64 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/workers/response.meta b/Assets/WX-WASM-SDK/wechat-default/workers/response.meta deleted file mode 100644 index 2ba845bc..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/workers/response.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6fd755f5d7cb3471ea8d968b6465702d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WX-WASM-SDK/wechat-default/workers/response/index.js b/Assets/WX-WASM-SDK/wechat-default/workers/response/index.js deleted file mode 100644 index cd7c1fad..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/workers/response/index.js +++ /dev/null @@ -1,73 +0,0 @@ -// 消息类型 -const messageType = { - config: 0, // 检查是否支持worker写文件 - writeFile: 1, // 写文件 -} - -const fs = worker.getFileSystemManager ? worker.getFileSystemManager() : null; -const createSharedArrayBuffer = worker.createSharedArrayBuffer; - -function compareVersion(_v1, _v2) { - return ( - _v1 - .split('.') - .map((v) => v.padStart(2, '0')) - .join('') >= - _v2 - .split('.') - .map((v) => v.padStart(2, '0')) - .join('') - ); -} - -worker.onMessage((res) => { - const {type, payload} = res; - if (type === messageType.writeFile) { - const {filePath, data, isSharedBuffer} = payload - let content = data - if (isSharedBuffer) { - content = data.buffer - } - fs.writeFile({ - filePath, - data: content, - success: () => { - worker.postMessage({ - type: messageType.writeFile, - payload: { - isok: true, - filePath, - } - }) - }, - fail: err => { - worker.postMessage({ - type: messageType.writeFile, - payload: { - isok: false, - filePath, - err - } - }) - } - }) - } - if (type === messageType.config) { - const {systemInfo} = payload - const {platform, version} = systemInfo - - // 安卓才需要使用worker写文件 - const isAndroid = platform.toLocaleLowerCase() === 'android' - // 8.0.18以下版本出现写文件报错 - const isClientValid = compareVersion(version, '8.0.18') - - worker.postMessage({ - type: messageType.config, - payload: { - supportWorkerFs: isAndroid && !!fs && isClientValid, - supportSharedBuffer: isAndroid && !!createSharedArrayBuffer, - } - }) - } -}) - diff --git a/Assets/WX-WASM-SDK/wechat-default/workers/response/index.js.meta b/Assets/WX-WASM-SDK/wechat-default/workers/response/index.js.meta deleted file mode 100644 index 0dfb2d07..00000000 --- a/Assets/WX-WASM-SDK/wechat-default/workers/response/index.js.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c805046e0eaa84f29a18a93f60c9ff45 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WebGLTemplates.meta b/Assets/WebGLTemplates.meta deleted file mode 100644 index 765ad863..00000000 --- a/Assets/WebGLTemplates.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: dc36b64efb2384510b56f6f3f6da57ac -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WebGLTemplates/WXTemplate.meta b/Assets/WebGLTemplates/WXTemplate.meta deleted file mode 100644 index 8c9ccbbe..00000000 --- a/Assets/WebGLTemplates/WXTemplate.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 37275e15b9bcc462f85402ba5ac50ce5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WebGLTemplates/WXTemplate/index.html b/Assets/WebGLTemplates/WXTemplate/index.html deleted file mode 100644 index 5bdeccd1..00000000 --- a/Assets/WebGLTemplates/WXTemplate/index.html +++ /dev/null @@ -1,797 +0,0 @@ - - - - - - - - Unity WebGL Player | %UNITY_WEB_NAME% - - - - - - - - -
- - - - diff --git a/Assets/WebGLTemplates/WXTemplate/index.html.meta b/Assets/WebGLTemplates/WXTemplate/index.html.meta deleted file mode 100644 index e2fb4b27..00000000 --- a/Assets/WebGLTemplates/WXTemplate/index.html.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: e8f97b36f4f314df1b6c6e60c2b0906a -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WebGLTemplates/WXTemplate/thumbnail.png b/Assets/WebGLTemplates/WXTemplate/thumbnail.png deleted file mode 100644 index 7eb46274..00000000 Binary files a/Assets/WebGLTemplates/WXTemplate/thumbnail.png and /dev/null differ diff --git a/Assets/WebGLTemplates/WXTemplate/thumbnail.png.meta b/Assets/WebGLTemplates/WXTemplate/thumbnail.png.meta deleted file mode 100644 index e077d1c2..00000000 --- a/Assets/WebGLTemplates/WXTemplate/thumbnail.png.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d8a1dcb512f394b7187ac255c4eb2222 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WebGLTemplates/WXTemplate2020.meta b/Assets/WebGLTemplates/WXTemplate2020.meta deleted file mode 100644 index 1b10c7fb..00000000 --- a/Assets/WebGLTemplates/WXTemplate2020.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 88b66178940ce4014af41387852c27d1 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WebGLTemplates/WXTemplate2020/index.html b/Assets/WebGLTemplates/WXTemplate2020/index.html deleted file mode 100644 index ce856696..00000000 --- a/Assets/WebGLTemplates/WXTemplate2020/index.html +++ /dev/null @@ -1,859 +0,0 @@ - - - - - - - Unity WebGL Player | {{{ PRODUCT_NAME }}} - - - -
- -
- -
-
-
-
- - -
- - - - - - diff --git a/Assets/WebGLTemplates/WXTemplate2020/index.html.meta b/Assets/WebGLTemplates/WXTemplate2020/index.html.meta deleted file mode 100644 index be90d0c9..00000000 --- a/Assets/WebGLTemplates/WXTemplate2020/index.html.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 0a1dcb5e36001403b96030ff715906fa -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/WebGLTemplates/WXTemplate2020/thumbnail.png b/Assets/WebGLTemplates/WXTemplate2020/thumbnail.png deleted file mode 100644 index b9152ac4..00000000 Binary files a/Assets/WebGLTemplates/WXTemplate2020/thumbnail.png and /dev/null differ diff --git a/Assets/WebGLTemplates/WXTemplate2020/thumbnail.png.meta b/Assets/WebGLTemplates/WXTemplate2020/thumbnail.png.meta deleted file mode 100644 index 60ce8e72..00000000 --- a/Assets/WebGLTemplates/WXTemplate2020/thumbnail.png.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 2fc5c63ddf7924a90a8d391563d72888 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json index bd8dd655..46f0fcb5 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,18 +1,18 @@ { "dependencies": { - "com.unity.2d.animation": "3.2.16", - "com.unity.2d.pixel-perfect": "2.1.0", + "com.unity.2d.animation": "7.0.6", + "com.unity.2d.pixel-perfect": "5.0.1", "com.unity.2d.psdimporter": "6.0.4", "com.unity.2d.sprite": "1.0.0", "com.unity.2d.spriteshape": "7.0.5", "com.unity.2d.tilemap": "1.0.0", "com.unity.collab-proxy": "1.17.2", - "com.unity.ide.rider": "1.2.1", - "com.unity.ide.visualstudio": "2.0.14", + "com.unity.ide.rider": "3.0.15", + "com.unity.ide.visualstudio": "2.0.16", "com.unity.ide.vscode": "1.2.5", "com.unity.test-framework": "1.1.31", - "com.unity.textmeshpro": "2.1.4", - "com.unity.timeline": "1.2.18", + "com.unity.textmeshpro": "3.0.6", + "com.unity.timeline": "1.6.4", "com.unity.ugui": "1.0.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index c4d5fd2b..b5d3ebc9 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -2,7 +2,7 @@ "dependencies": { "com.unity.2d.animation": { "version": "7.0.6", - "depth": 1, + "depth": 0, "source": "registry", "dependencies": { "com.unity.2d.common": "6.0.3", @@ -32,7 +32,7 @@ "url": "https://packages.unity.cn" }, "com.unity.2d.pixel-perfect": { - "version": "2.1.0", + "version": "5.0.1", "depth": 0, "source": "registry", "dependencies": {}, @@ -99,16 +99,16 @@ "url": "https://packages.unity.cn" }, "com.unity.ide.rider": { - "version": "1.2.1", + "version": "3.0.15", "depth": 0, "source": "registry", "dependencies": { - "com.unity.test-framework": "1.1.1" + "com.unity.ext.nunit": "1.0.6" }, "url": "https://packages.unity.cn" }, "com.unity.ide.visualstudio": { - "version": "2.0.14", + "version": "2.0.16", "depth": 0, "source": "registry", "dependencies": { @@ -160,7 +160,7 @@ "url": "https://packages.unity.cn" }, "com.unity.textmeshpro": { - "version": "2.1.4", + "version": "3.0.6", "depth": 0, "source": "registry", "dependencies": { @@ -169,7 +169,7 @@ "url": "https://packages.unity.cn" }, "com.unity.timeline": { - "version": "1.2.18", + "version": "1.6.4", "depth": 0, "source": "registry", "dependencies": { diff --git a/ProjectSettings/BurstAotSettings_WebGL.json b/ProjectSettings/BurstAotSettings_WebGL.json new file mode 100644 index 00000000..771d37b7 --- /dev/null +++ b/ProjectSettings/BurstAotSettings_WebGL.json @@ -0,0 +1,14 @@ +{ + "MonoBehaviour": { + "Version": 4, + "EnableBurstCompilation": true, + "EnableOptimisations": true, + "EnableSafetyChecks": false, + "EnableDebugInAllBuilds": false, + "CpuMinTargetX32": 0, + "CpuMaxTargetX32": 0, + "CpuMinTargetX64": 0, + "CpuMaxTargetX64": 0, + "OptimizeFor": 0 + } +} diff --git a/ProjectSettings/CommonBurstAotSettings.json b/ProjectSettings/CommonBurstAotSettings.json new file mode 100644 index 00000000..0293dafc --- /dev/null +++ b/ProjectSettings/CommonBurstAotSettings.json @@ -0,0 +1,6 @@ +{ + "MonoBehaviour": { + "Version": 4, + "DisabledWarnings": "" + } +} diff --git a/ProjectSettings/MemorySettings.asset b/ProjectSettings/MemorySettings.asset new file mode 100644 index 00000000..5b5facec --- /dev/null +++ b/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 677241de..efaa61b8 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -80,7 +80,7 @@ PlayerSettings: androidFullscreenMode: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 - runInBackground: 0 + runInBackground: 1 captureSingleScreen: 0 muteOtherAudioSources: 0 Prepare IOS For Recording: 0 @@ -334,9 +334,6 @@ PlayerSettings: - m_BuildTarget: AndroidPlayer m_APIs: 150000000b000000 m_Automatic: 0 - - m_BuildTarget: WebGLSupport - m_APIs: 08000000 - m_Automatic: 0 m_BuildTargetVRSettings: [] openGLRequireES31: 0 openGLRequireES31AEP: 0 @@ -603,14 +600,14 @@ PlayerSettings: webGLMemorySize: 16 webGLExceptionSupport: 1 webGLNameFilesAsHashes: 0 - webGLDataCaching: 0 - webGLDebugSymbols: 1 - webGLEmscriptenArgs: ' -s TOTAL_MEMORY=256MB' + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: webGLModulesDirectory: - webGLTemplate: PROJECT:WXTemplate + webGLTemplate: APPLICATION:Default webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 - webGLCompressionFormat: 2 + webGLCompressionFormat: 1 webGLLinkerTarget: 1 webGLThreadsSupport: 0 webGLWasmStreaming: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 625776a6..d5797253 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.4.38f1c1 -m_EditorVersionWithRevision: 2019.4.38f1c1 (df80985e05f0) +m_EditorVersion: 2021.3.6f1c1 +m_EditorVersionWithRevision: 2021.3.6f1c1 (07401303b748) diff --git a/ProjectSettings/SceneTemplateSettings.json b/ProjectSettings/SceneTemplateSettings.json new file mode 100644 index 00000000..6f3e60fd --- /dev/null +++ b/ProjectSettings/SceneTemplateSettings.json @@ -0,0 +1,167 @@ +{ + "templatePinStates": [], + "dependencyTypeInfos": [ + { + "userAdded": false, + "type": "UnityEngine.AnimationClip", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Animations.AnimatorController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.AnimatorOverrideController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Audio.AudioMixerController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ComputeShader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Cubemap", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.GameObject", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.LightingDataAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": false + }, + { + "userAdded": false, + "type": "UnityEngine.LightingSettings", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Material", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.MonoScript", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicMaterial", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.VolumeProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.SceneAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": false + }, + { + "userAdded": false, + "type": "UnityEngine.Shader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ShaderVariantCollection", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Timeline.TimelineAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + } + ], + "defaultDependencyTypeInfo": { + "userAdded": false, + "type": "", + "ignore": false, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + "newSceneOverride": 0 +} \ No newline at end of file diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset index 46ccee0a..17683801 100644 --- a/ProjectSettings/UnityConnectSettings.asset +++ b/ProjectSettings/UnityConnectSettings.asset @@ -9,6 +9,7 @@ UnityConnectSettings: m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events m_EventUrl: https://cdp.cloud.unity3d.com/v1/events m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com m_CNEventUrl: https://cdp.cloud.unity.cn/v1/events m_CNConfigUrl: https://cdp.cloud.unity.cn/config m_TestInitMode: 0 diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 00000000..dca28814 --- /dev/null +++ b/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/Assets/WX-WASM-SDK/wechat-default/data-package/game.js b/ProjectSettings/boot.config similarity index 100% rename from Assets/WX-WASM-SDK/wechat-default/data-package/game.js rename to ProjectSettings/boot.config