diff --git a/Demo/API_V2/Assets/API/APISO.asset b/Demo/API_V2/Assets/API/APISO.asset index 8a770bd0f..4a4c9164d 100644 --- a/Demo/API_V2/Assets/API/APISO.asset +++ b/Demo/API_V2/Assets/API/APISO.asset @@ -13,27 +13,27 @@ MonoBehaviour: m_Name: APISO m_EditorClassIdentifier: categoryList: - - {fileID: 11400000, guid: 587fe4b03da9d44779ac921ffdb216a7, type: 2} - {fileID: 11400000, guid: 82450cc74b3b4439da53b9f0f2298454, type: 2} - - {fileID: 11400000, guid: 24d9eba5a9b3048b59cf7e5495bb999d, type: 2} - - {fileID: 11400000, guid: 9977a581037b84833a32b508e00eb1a2, type: 2} - - {fileID: 11400000, guid: 56f316e0e10ba419bbf19bd7a68bfc4c, type: 2} - - {fileID: 11400000, guid: 6f0972f5fdc56c543b23c9873d760bf5, type: 2} - - {fileID: 11400000, guid: a461b8cd70d9e4e23ad1cc953bec31e9, type: 2} - - {fileID: 11400000, guid: 7ef06699cee7846b7823e4cc421418eb, type: 2} - - {fileID: 11400000, guid: 55de20d536f8c4689bbd80553d87fe46, type: 2} - - {fileID: 11400000, guid: f2c56d751bb7c4c398db7c1db352517d, type: 2} - {fileID: 11400000, guid: b4a6196f623dd4435a4f3bd70af92d06, type: 2} + - {fileID: 11400000, guid: 96c20c2f2bb504877a24cb359162c323, type: 2} + - {fileID: 11400000, guid: a461b8cd70d9e4e23ad1cc953bec31e9, type: 2} - {fileID: 11400000, guid: 6f6fdc677ed96437eb1fa0e7e272b6d8, type: 2} - - {fileID: 11400000, guid: 8c2a99491f3c0446097220cd580dfe38, type: 2} - {fileID: 11400000, guid: 59792dcce94fc48f6ab5654a02c78c6d, type: 2} - - {fileID: 11400000, guid: b34629c67a7664a428561dd0b3621995, type: 2} - - {fileID: 11400000, guid: b363337bfb49b490e81fbfac3612f793, type: 2} + - {fileID: 11400000, guid: 9977a581037b84833a32b508e00eb1a2, type: 2} - {fileID: 11400000, guid: 2bf0b496956fe4d89af32d301c33d9a6, type: 2} - - {fileID: 11400000, guid: 96c20c2f2bb504877a24cb359162c323, type: 2} + - {fileID: 11400000, guid: b363337bfb49b490e81fbfac3612f793, type: 2} + - {fileID: 11400000, guid: f2c56d751bb7c4c398db7c1db352517d, type: 2} + - {fileID: 11400000, guid: 55de20d536f8c4689bbd80553d87fe46, type: 2} + - {fileID: 11400000, guid: 6f0972f5fdc56c543b23c9873d760bf5, type: 2} + - {fileID: 11400000, guid: 8c2a99491f3c0446097220cd580dfe38, type: 2} + - {fileID: 11400000, guid: 56f316e0e10ba419bbf19bd7a68bfc4c, type: 2} + - {fileID: 11400000, guid: 7ef06699cee7846b7823e4cc421418eb, type: 2} + - {fileID: 11400000, guid: 587fe4b03da9d44779ac921ffdb216a7, type: 2} + - {fileID: 11400000, guid: 24d9eba5a9b3048b59cf7e5495bb999d, type: 2} + - {fileID: 11400000, guid: b34629c67a7664a428561dd0b3621995, type: 2} nativeAbilityList: + - {fileID: 11400000, guid: 3ccd91abf96ad407d92ada7e93eda0a4, type: 2} - {fileID: 11400000, guid: aad449a913b0c444fb827d7f3eafad70, type: 2} - - {fileID: 11400000, guid: a999a30c61ceb450ca9ec0652c439b69, type: 2} - {fileID: 11400000, guid: 90da3e9d88868495d85959bf329b7dfd, type: 2} + - {fileID: 11400000, guid: a999a30c61ceb450ca9ec0652c439b69, type: 2} - {fileID: 11400000, guid: 879518ab20abe40c7b42d213d2b57bdd, type: 2} - - {fileID: 11400000, guid: 3ccd91abf96ad407d92ada7e93eda0a4, type: 2} diff --git a/Demo/API_V2/Assets/API/Base/BaseSO.asset b/Demo/API_V2/Assets/API/Base/BaseSO.asset index db9a5e265..e853b67da 100644 --- a/Demo/API_V2/Assets/API/Base/BaseSO.asset +++ b/Demo/API_V2/Assets/API/Base/BaseSO.asset @@ -16,11 +16,11 @@ MonoBehaviour: categoryName: "\u57FA\u7840" categorySprite: {fileID: 21300000, guid: a43db3a4b5b124728be9ff9ac754f5de, type: 3} entryList: - - {fileID: 11400000, guid: d21307f6da1da4d7bb1322558c508822, type: 2} + - {fileID: 11400000, guid: 3996b93c3d76d47088845abcebf960fb, type: 2} - {fileID: 11400000, guid: fc015bc2bdd084428ab1dc7cf5b87fba, type: 2} + - {fileID: 11400000, guid: e535490610e214b1cabe9378cb46ea5a, type: 2} - {fileID: 11400000, guid: 29b8eb105fe9d400f9a79bdb140e85c9, type: 2} - - {fileID: 11400000, guid: 3996b93c3d76d47088845abcebf960fb, type: 2} + - {fileID: 11400000, guid: d21307f6da1da4d7bb1322558c508822, type: 2} - {fileID: 11400000, guid: 9d4267fc1b8274349a253ca28e0340d7, type: 2} - {fileID: 11400000, guid: e6944788ab3d04858bc3c6cf1f2f7273, type: 2} - - {fileID: 11400000, guid: e535490610e214b1cabe9378cb46ea5a, type: 2} categoryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Facility/FacilitySO.asset b/Demo/API_V2/Assets/API/Facility/FacilitySO.asset index 44f67c6a1..5d971a60b 100644 --- a/Demo/API_V2/Assets/API/Facility/FacilitySO.asset +++ b/Demo/API_V2/Assets/API/Facility/FacilitySO.asset @@ -16,10 +16,10 @@ MonoBehaviour: categoryName: "\u8BBE\u5907" categorySprite: {fileID: 21300000, guid: 53dd2b1922e5142ec8a53037f362fc56, type: 3} entryList: - - {fileID: 11400000, guid: bbbc9b983d6d34ad3bac2921509f612f, type: 2} - - {fileID: 11400000, guid: c17ae0ce755f04419b700825b20fd386, type: 2} - {fileID: 11400000, guid: a24af43ae51914d26b0bf637c283dab2, type: 2} - {fileID: 11400000, guid: 4eba2c9f2f2064e4081be74302ca4c33, type: 2} + - {fileID: 11400000, guid: bbbc9b983d6d34ad3bac2921509f612f, type: 2} + - {fileID: 11400000, guid: c17ae0ce755f04419b700825b20fd386, type: 2} - {fileID: 11400000, guid: ac09abff5d8bc48bbabd08bde820b58b, type: 2} - {fileID: 11400000, guid: 3bf339b994c544db3860ddf0a0dc8e20, type: 2} - {fileID: 11400000, guid: e92d94924be504167a342e42e1162f21, type: 2} diff --git a/Demo/API_V2/Assets/API/FileSystem/FileSystemSO.asset b/Demo/API_V2/Assets/API/FileSystem/FileSystemSO.asset index 684eea210..5d57840cb 100644 --- a/Demo/API_V2/Assets/API/FileSystem/FileSystemSO.asset +++ b/Demo/API_V2/Assets/API/FileSystem/FileSystemSO.asset @@ -25,8 +25,8 @@ MonoBehaviour: - {fileID: 11400000, guid: 65ab1b01a722b4542a14fcf9decca3de, type: 2} - {fileID: 11400000, guid: 19b80cb144f0c4ea28a4ddca7a2c2f09, type: 2} - {fileID: 11400000, guid: 0aa5d76237c844275add1612c47bddaa, type: 2} - - {fileID: 11400000, guid: 73c05fc1ffae94ec1b69a00ee261d529, type: 2} - {fileID: 11400000, guid: 65a826f5f949544d8990e673231bb80f, type: 2} + - {fileID: 11400000, guid: 73c05fc1ffae94ec1b69a00ee261d529, type: 2} - {fileID: 11400000, guid: 3a901e80b59ad4aafbe373ee6a8df2d8, type: 2} - {fileID: 11400000, guid: e7ea0be62dc6543b0a8dc629489c5e7e, type: 2} categoryOrder: 11 diff --git a/Demo/API_V2/Assets/API/GUI/Menu/MenuSO.asset b/Demo/API_V2/Assets/API/GUI/Menu/MenuSO.asset index d5b3155c2..1cfc53bc6 100644 --- a/Demo/API_V2/Assets/API/GUI/Menu/MenuSO.asset +++ b/Demo/API_V2/Assets/API/GUI/Menu/MenuSO.asset @@ -30,3 +30,4 @@ MonoBehaviour: - buttonText: "\u83B7\u53D6\u83DC\u5355\u6309\u94AE\u5E03\u5C40\u4F4D\u7F6E\u4FE1\u606F" - buttonText: "\u8BBE\u7F6E\u72B6\u6001\u680F\u6DF1\u8272" initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Media/CameraAPI/CameraAPISO.asset b/Demo/API_V2/Assets/API/Media/CameraAPI/CameraAPISO.asset index ee91bef88..7fa17fd04 100644 --- a/Demo/API_V2/Assets/API/Media/CameraAPI/CameraAPISO.asset +++ b/Demo/API_V2/Assets/API/Media/CameraAPI/CameraAPISO.asset @@ -23,3 +23,4 @@ MonoBehaviour: initialButtonText: "\u5F00\u59CB\u76D1\u542C\u5E27\u6570\u636E" extraButtonList: [] initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Media/VideoDecoder/VideoDecoderSO.asset b/Demo/API_V2/Assets/API/Media/VideoDecoder/VideoDecoderSO.asset index 439bed1a0..49698540e 100644 --- a/Demo/API_V2/Assets/API/Media/VideoDecoder/VideoDecoderSO.asset +++ b/Demo/API_V2/Assets/API/Media/VideoDecoder/VideoDecoderSO.asset @@ -24,3 +24,4 @@ MonoBehaviour: - buttonText: "\u8DF3\u8F6C" - buttonText: "\u83B7\u5F97\u4E0B\u4E00\u5E27" initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/NativeVideo/NativeVideoSO.asset b/Demo/API_V2/Assets/API/NativeVideo/NativeVideoSO.asset index a928a6271..5dfb95db4 100644 --- a/Demo/API_V2/Assets/API/NativeVideo/NativeVideoSO.asset +++ b/Demo/API_V2/Assets/API/NativeVideo/NativeVideoSO.asset @@ -16,7 +16,7 @@ MonoBehaviour: categoryName: "\u89C6\u9891" categorySprite: {fileID: 0} entryList: - - {fileID: 11400000, guid: 5073e277b29d95642abb3c49fe94eea0, type: 2} - {fileID: 11400000, guid: 27654a238f98e4f7e8756e4caed418e1, type: 2} + - {fileID: 11400000, guid: 5073e277b29d95642abb3c49fe94eea0, type: 2} - {fileID: 11400000, guid: ebd496025e81f434bb6b5b487cfbf2ed, type: 2} categoryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Network/Download/DownloadSO.asset b/Demo/API_V2/Assets/API/Network/Download/DownloadSO.asset index 37f2c98a2..2307e8864 100644 --- a/Demo/API_V2/Assets/API/Network/Download/DownloadSO.asset +++ b/Demo/API_V2/Assets/API/Network/Download/DownloadSO.asset @@ -21,3 +21,4 @@ MonoBehaviour: initialButtonText: "\u4E0B\u8F7D" extraButtonList: [] initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Network/TCPSocket/TCPSocketSO.asset b/Demo/API_V2/Assets/API/Network/TCPSocket/TCPSocketSO.asset index 630acca80..ef1bca86c 100644 --- a/Demo/API_V2/Assets/API/Network/TCPSocket/TCPSocketSO.asset +++ b/Demo/API_V2/Assets/API/Network/TCPSocket/TCPSocketSO.asset @@ -28,3 +28,4 @@ MonoBehaviour: - buttonText: "\u53D1\u9001" - buttonText: "\u5173\u95ED" initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Network/UDPSocket/UDPSocketSO.asset b/Demo/API_V2/Assets/API/Network/UDPSocket/UDPSocketSO.asset index f08686ccc..a66295ac8 100644 --- a/Demo/API_V2/Assets/API/Network/UDPSocket/UDPSocketSO.asset +++ b/Demo/API_V2/Assets/API/Network/UDPSocket/UDPSocketSO.asset @@ -31,3 +31,4 @@ MonoBehaviour: - buttonText: Send - buttonText: "\u5173\u95ED" initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Network/UnityWebRequest/WebRequest SO.asset b/Demo/API_V2/Assets/API/Network/UnityWebRequest/WebRequest SO.asset index e6e4288c0..bcbc507f9 100644 --- a/Demo/API_V2/Assets/API/Network/UnityWebRequest/WebRequest SO.asset +++ b/Demo/API_V2/Assets/API/Network/UnityWebRequest/WebRequest SO.asset @@ -23,3 +23,4 @@ MonoBehaviour: - buttonText: Post - buttonText: Get initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Network/Upload/UploadSO.asset b/Demo/API_V2/Assets/API/Network/Upload/UploadSO.asset index 69254c3a6..2ea6c27bc 100644 --- a/Demo/API_V2/Assets/API/Network/Upload/UploadSO.asset +++ b/Demo/API_V2/Assets/API/Network/Upload/UploadSO.asset @@ -21,3 +21,4 @@ MonoBehaviour: initialButtonText: "\u4E0A\u4F20\u6587\u4EF6" extraButtonList: [] initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent.meta b/Demo/API_V2/Assets/API/Share/Favorites.meta similarity index 77% rename from Demo/API_V2/Assets/API/Share/ShareEvent.meta rename to Demo/API_V2/Assets/API/Share/Favorites.meta index d4394be43..6f601e589 100644 --- a/Demo/API_V2/Assets/API/Share/ShareEvent.meta +++ b/Demo/API_V2/Assets/API/Share/Favorites.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d64fd360adb174de2a8807156ddcdf9b +guid: 41b7ef81e794eea47a4a2ee28593105d folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Demo/API_V2/Assets/API/Share/Favorites/Favorites.cs b/Demo/API_V2/Assets/API/Share/Favorites/Favorites.cs new file mode 100644 index 000000000..45d26e095 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/Favorites/Favorites.cs @@ -0,0 +1,155 @@ +using WeChatWASM; +using System; +using UnityEngine; + +public class Favorites : Details +{ + private bool _isListeningAddToFavorites = false; + private Action> _onAddToFavorites; + private string localImagePath; + + protected override void TestAPI(string[] args) + { + // 如果已经在监听中,只执行切换监听的操作,避免重复下载 + if (_isListeningAddToFavorites) + { + onAddToFavorites(); + return; + } + + // 根据对应参数,执行DownloadFileImage()下载图片 + if (GetOptionString(1, "") == "本地图片文件路径") + { + DownloadFileImage(); + } + else + { + InitializeFavoritesCallback(); + onAddToFavorites(); + } + } + + private void ShowLoading() + { + WX.ShowLoading(new ShowLoadingOption() + { + title = "正在下载图片...", + mask = true + }); + } + + private void HideLoading() + { + WX.HideLoading(new HideLoadingOption()); + } + + private void DownloadFileImage() + { + ShowLoading(); + WX.DownloadFile(new DownloadFileOption() + { + url = "https://mmgame.qpic.cn/image/b941692c4de1a46c180c84569cc24c20389bf176794048becdf2421e61483fd0/0", + success = (res) => + { + Debug.Log("WX.DownloadFile success"); + if (res.statusCode == 200) + { + Debug.Log(res.tempFilePath); + var fs = WX.GetFileSystemManager(); + // 将临时文件保存为本地缓存文件 + localImagePath = fs.SaveFileSync(res.tempFilePath, WX.env.USER_DATA_PATH + "/favoriteImage.jpg"); + Debug.Log($"本地缓存文件保存路径: {localImagePath}"); + InitializeFavoritesCallback(); + onAddToFavorites(); + } + }, + fail = (res) => + { + Debug.Log("WX.DownloadFile fail"); + }, + complete = (res) => + { + Debug.Log("WX.DownloadFile complete"); + HideLoading(); + } + }); + } + + //设置收藏回调函数 + private void InitializeFavoritesCallback() + { + string title = GetOptionString(0, ""); + string imageUrl = GetOptionString(1, ""); + bool disableForward = !GetOptionBool(2, false); + string query = GetOptionString(3, ""); + + if (imageUrl == "本地图片文件路径") + { + imageUrl = localImagePath; + } + + _onAddToFavorites = (callback) => + { + callback( + new OnAddToFavoritesListenerResult + { + title = title, + imageUrl = imageUrl, + disableForward = disableForward, + query = query + } + ); + Debug.Log($"收藏回调参数 - 标题: {title}, 图片URL: {imageUrl}, 禁止转发: {disableForward}, Query: {query}"); + }; + } + + //切换收藏监听状态 + public void onAddToFavorites() + { + if (!_isListeningAddToFavorites) + { + WX.OnAddToFavorites(_onAddToFavorites); + Debug.Log("开始监听收藏"); + // 添加开始监听时的提示 + WX.ShowToast(new ShowToastOption() + { + title = "已开启收藏监听", + icon = "none", + duration = 1500 + }); + } + else + { + WX.OffAddToFavorites(_onAddToFavorites); + Debug.Log("取消监听收藏"); + // 添加取消监听时的提示 + WX.ShowToast(new ShowToastOption() + { + title = "已取消收藏监听", + icon = "none", + duration = 1500 + }); + } + _isListeningAddToFavorites = !_isListeningAddToFavorites; + GameManager.Instance.detailsController.ChangeInitialButtonText( + _isListeningAddToFavorites ? "取消监听收藏" : "开始监听收藏" + ); + } + + private void OnDestroy() + { + if (_isListeningAddToFavorites) + { + WX.OffAddToFavorites(_onAddToFavorites); + Debug.Log("清理收藏监听"); + } + + // 清理本地文件 + if (!string.IsNullOrEmpty(localImagePath)) + { + var fs = WX.GetFileSystemManager(); + fs.UnlinkSync(localImagePath); + Debug.Log("清理本地图片成功"); + } + } +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2.cs.meta b/Demo/API_V2/Assets/API/Share/Favorites/Favorites.cs.meta similarity index 83% rename from Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2.cs.meta rename to Demo/API_V2/Assets/API/Share/Favorites/Favorites.cs.meta index a76c0a125..6c83f41a8 100644 --- a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2.cs.meta +++ b/Demo/API_V2/Assets/API/Share/Favorites/Favorites.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: df5054e67d6f542b6a1791f6f60e01ac +guid: c68a29f7fb299d3438b5993a69b5c5d6 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Demo/API_V2/Assets/API/Share/Favorites/FavoritesSO.asset b/Demo/API_V2/Assets/API/Share/Favorites/FavoritesSO.asset new file mode 100644 index 000000000..73dd833dc --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/Favorites/FavoritesSO.asset @@ -0,0 +1,40 @@ +%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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} + m_Name: FavoritesSO + m_EditorClassIdentifier: + entryName: "\u6536\u85CF\u76D1\u542C" + entryOrder: 0 + entryScriptTypeName: Favorites + entryAPI: OnAddToFavorites | OffAddToFavorites + entryDescription: "\u76D1\u542C\u7528\u6237\u70B9\u51FB\u83DC\u5355\u300C\u6536\u85CF\u300D\u6309\u94AE\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6\n\uFF08\u5B89\u53537.0.15\u8D77\u652F\u6301\uFF0CiOS + \u6682\u4E0D\u652F\u6301\uFF09\n\u6CE8\u610F\uFF1A\u7A7A\u9009\u9879\u5219\u4F7F\u7528\u9ED8\u8BA4\u503C" + optionList: + - optionName: title + availableOptions: + - "\u6536\u85CF\u6807\u9898" + - + - optionName: imageUrl + availableOptions: + - https://mmocgame.qpic.cn/wechatgame/QgsibLsZPBy1uwWJnNNPeRXjBMKm327We8xrXWxGMM4cFKUZaqy0SU8TcudBf72sE/0 + - "\u672C\u5730\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84" + - + - optionName: disableForward + availableOptions: + - false + - true + - optionName: query + availableOptions: + - key1=val1 + initialButtonText: "\u5F00\u59CB\u76D1\u542C\u6536\u85CF" + extraButtonList: [] + initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEventSO.asset.meta b/Demo/API_V2/Assets/API/Share/Favorites/FavoritesSO.asset.meta similarity index 79% rename from Demo/API_V2/Assets/API/Share/ShareEvent/ShareEventSO.asset.meta rename to Demo/API_V2/Assets/API/Share/Favorites/FavoritesSO.asset.meta index 4a74cf686..f4c1f0c9d 100644 --- a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEventSO.asset.meta +++ b/Demo/API_V2/Assets/API/Share/Favorites/FavoritesSO.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 805c0a637a7d34742adf65b16186a448 +guid: 4bdaaff4820c8eb4e9de6e076f490ab0 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Demo/API_V2/Assets/API/Share/ShareAppMessage.meta b/Demo/API_V2/Assets/API/Share/ShareAppMessage.meta index 80acdc658..efcf97784 100644 --- a/Demo/API_V2/Assets/API/Share/ShareAppMessage.meta +++ b/Demo/API_V2/Assets/API/Share/ShareAppMessage.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 377095d55118941fd8b30a361114427d +guid: d09702cfaf2f7a346b9e65dbb7fb31a7 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs index 710414858..57dffb9f0 100644 --- a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs +++ b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs @@ -1,17 +1,157 @@ using UnityEngine; using WeChatWASM; +using System; +using LitJson; public class ShareAppMessage : Details { - // 测试 API + private bool _isListening = false; + + private readonly Action _onShow = (res) => + { + var result = "onShow\n" + JsonMapper.ToJson(res); + GameManager.Instance.detailsController.AddResult( + new ResultData() { initialContentText = result } + ); + }; + + private readonly Action _onHide = (res) => + { + var result = "onHide\n" + JsonMapper.ToJson(res); + GameManager.Instance.detailsController.AddResult( + new ResultData() { initialContentText = result } + ); + }; + + private string localImagePath; protected override void TestAPI(string[] args) { - Share(); + if (!_isListening) + { + WX.OnShow(_onShow); + WX.OnHide(_onHide); + } + else + { + WX.OffShow(_onShow); + WX.OffHide(_onHide); + } + _isListening = !_isListening; + GameManager.Instance.detailsController.ChangeInitialButtonText( + _isListening ? "取消监听" : "开始监听" + ); + if (GetOptionString(1, "") == "本地图片文件路径") + { + DownloadFileImage(); + } + else + { + shareAppMessage(); + } + } + private void ShowLoading() + { + WX.ShowLoading(new ShowLoadingOption() + { + title = "正在下载图片...", + mask = true + }); + } + private void HideLoading() + { + WX.HideLoading(new HideLoadingOption()); + } + + private void DownloadFileImage() + { + ShowLoading(); + WX.DownloadFile(new DownloadFileOption() + { + url = "https://mmgame.qpic.cn/image/b941692c4de1a46c180c84569cc24c20389bf176794048becdf2421e61483fd0/0", + success = (res) => + { + Debug.Log("WX.DownloadFile success"); + if (res.statusCode == 200) + { + Debug.Log(res.tempFilePath); + var fs = WX.GetFileSystemManager(); + // 将临时文件保存为本地缓存文件 + localImagePath = fs.SaveFileSync(res.tempFilePath, WX.env.USER_DATA_PATH + "/shareImage.jpg"); + Debug.Log($"本地缓存文件保存路径: {localImagePath}"); + shareAppMessage(); + } + }, + fail = (res) => + { + Debug.Log("WX.DownloadFile fail"); + }, + complete = (res) => + { + Debug.Log("WX.DownloadFile complete"); + HideLoading(); + } + }); + } + + + private void shareAppMessage() + { + string title = GetOptionString(0, ""); + string imageUrl = GetOptionString(1, ""); + string imageUrlId = GetOptionString(2, ""); + bool toCurrentGroupValue = GetOptionBool(3, true); + string query = GetOptionString(4, ""); + + //SO里面的配置参数 + string contentText = $"分享参数信息:\n" + + $"标题:{title}\n" + + $"图片URL:{imageUrl}\n" + + $"图片ID:{imageUrlId}\n" + + $"是否分享到当前群:{toCurrentGroupValue}\n" + + $"分享参数:{query}"; + + // 如果选择了本地图片文件路径,使用下载保存到本地的文件路径 + if (imageUrl == "本地图片文件路径") + { + imageUrl = localImagePath; + } + + WX.ShareAppMessage(new ShareAppMessageOption() + { + title = title, + imageUrl = imageUrl, + imageUrlId = imageUrlId, + toCurrentGroup = toCurrentGroupValue, + query = query, + }); + + WX.ShowModal(new ShowModalOption() + { + title = "分享成功", + content = contentText, + showCancel = false, + confirmText = "好的", + success = (res) => + { + Debug.Log("分享成功"); + }, + fail = (res) => + { + Debug.Log("分享失败"); + } + }); } - // 分享 - private void Share() + private void OnDestroy() { - WX.ShareAppMessage(new ShareAppMessageOption() { title = "小游戏分享" }); + // 清理文件 + if (!string.IsNullOrEmpty(localImagePath)) + { + var fs = WX.GetFileSystemManager(); + fs.UnlinkSync(localImagePath); + Debug.Log("清理本地图片成功"); + } + WX.OffShow(_onShow); + WX.OffHide(_onHide); } -} +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs.meta b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs.meta index db5fb4d96..3ecf03ce8 100644 --- a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs.meta +++ b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessage.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c1ae2ce22a9504861b919caf718ec486 +guid: 8eb384adaf65e2a4b9cb1f6506c12cd8 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset index 73b817776..4512cea14 100644 --- a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset +++ b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset @@ -12,12 +12,32 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} m_Name: ShareAppMessageSO m_EditorClassIdentifier: - entryName: "\u5206\u4EAB\u5E94\u7528\u4FE1\u606F" + entryName: "\u5206\u4EAB\u8F6C\u53D1" entryOrder: 0 entryScriptTypeName: ShareAppMessage - entryAPI: shareAppMessage - entryDescription: - optionList: [] - initialButtonText: "\u5206\u4EAB" + entryAPI: ShareAppMessage + entryDescription: "title\uFF1A\u4E0D\u4F20\u5219\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D\u5C0F\u6E38\u620F\u7684\u6635\u79F0\u3002\n\u4E3B\u52A8\u62C9\u8D77\u8F6C\u53D1\uFF0C\u8FDB\u5165\u9009\u62E9\u901A\u8BAF\u5F55\u754C\u9762\u3002\n\u6CE8\u610F\uFF1A\u7A7A\u9009\u9879\u5219\u4F7F\u7528\u9ED8\u8BA4\u503C" + optionList: + - optionName: title + availableOptions: + - "\u5C0F\u6E38\u620F\u5206\u4EAB" + - + - optionName: imageUrl + availableOptions: + - https://mmocgame.qpic.cn/wechatgame/QgsibLsZPBy1uwWJnNNPeRXjBMKm327We8xrXWxGMM4cFKUZaqy0SU8TcudBf72sE/0 + - "\u672C\u5730\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84" + - + - optionName: imageUrlId + availableOptions: + - CoH3v3JtRc2ajuDvZyhHXQ== + - + - optionName: toCurrentGroup + availableOptions: + - false + - true + - optionName: query + availableOptions: + - key1=val1 + initialButtonText: "\u4E3B\u52A8\u8F6C\u53D1\u5206\u4EAB" extraButtonList: [] initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset.meta b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset.meta index caff7954c..9db092ff0 100644 --- a/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset.meta +++ b/Demo/API_V2/Assets/API/Share/ShareAppMessage/ShareAppMessageSO.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 102555321c0dd4bc3ae36bf3514c2052 +guid: 82f8461435201ae4b8a61a442878e16b NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEvent.cs b/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEvent.cs deleted file mode 100644 index 60d4f1631..000000000 --- a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEvent.cs +++ /dev/null @@ -1,229 +0,0 @@ -using System; -using System.Collections.Generic; -using LitJson; -using UnityEngine; -using WeChatWASM; - -public class ShareEvent : Details -{ - private bool _isListeningShareTimeline = false; - - private readonly Action> _onShareTimelineCallback = ( - callback - ) => - { - callback( - new OnShareTimelineListenerResult - { - imageUrl = "xxx", - imagePreviewUrl = "yy", - imagePreviewUrlId = "xx", - imageUrlId = "xxx", - path = "xx", - query = "xx", - title = "test", - } - ); - }; - - private readonly Action _onShareMessageToFriend = (res) => - { - var result = "onShareMessageToFriend\n" + JsonMapper.ToJson(res); - GameManager.Instance.detailsController.AddResult( - new ResultData() { initialContentText = result } - ); - }; - - private readonly Action> _onShareAppMessageCallback = ( - callback - ) => - { - callback( - new WXShareAppMessageParam - { - title = "转发标题", - imageUrl = "xx", - query = "key1=val1&key2=val2" - } - ); - }; - - private void Start() - { - GameManager.Instance.detailsController.BindExtraButtonAction(0, showShareMenu); - GameManager.Instance.detailsController.BindExtraButtonAction(1, hideShareMenu); - GameManager.Instance.detailsController.BindExtraButtonAction(2, showShareImageMenu); - GameManager.Instance.detailsController.BindExtraButtonAction(3, setMessageToFriendQuery); - GameManager.Instance.detailsController.BindExtraButtonAction(4, setHandoffQuery); - GameManager.Instance.detailsController.BindExtraButtonAction(5, onShareTimeline); - GameManager.Instance.detailsController.BindExtraButtonAction(6, onShareMessageToFriend); - GameManager.Instance.detailsController.BindExtraButtonAction(7, onShareAppMessage); - } - - // 测试 API - protected override void TestAPI(string[] args) - { - updateShareMenu(); - } - - public void updateShareMenu() - { - var parameter = new UpdatableMessageFrontEndParameter[] - { - new UpdatableMessageFrontEndParameter { name = "xxx", value = "yyy" }, - new UpdatableMessageFrontEndParameter { name = "zz", value = "kk" } - }; - - var info = new UpdatableMessageFrontEndTemplateInfo { parameterList = parameter }; - - WX.UpdateShareMenu( - new UpdateShareMenuOption - { - isPrivateMessage = true, - activityId = "xxx", - templateInfo = info, - success = (res) => - { - WX.ShowToast(new ShowToastOption { title = "设置成功" }); - }, - fail = (res) => - { - Debug.Log("fail" + res.errMsg); - }, - complete = (res) => - { - Debug.Log("complete"); - } - } - ); - } - - public void showShareMenu() - { - WX.ShowShareMenu( - new ShowShareMenuOption - { - withShareTicket = true, - menus = new string[] { "shareAppMessage", "shareTimeline" }, - success = (res) => - { - Debug.Log("success"); - }, - fail = (res) => - { - Debug.Log("fail" + res.errMsg); - }, - complete = (res) => - { - Debug.Log("complete"); - } - } - ); - } - - public void hideShareMenu() - { - WX.HideShareMenu( - new HideShareMenuOption - { - menus = new string[] { "shareAppMessage", "shareTimeline" }, - success = (res) => - { - Debug.Log("success"); - }, - fail = (res) => - { - Debug.Log("fail" + res.errMsg); - }, - complete = (res) => - { - Debug.Log("complete"); - } - } - ); - } - - public void showShareImageMenu() - { - WX.DownloadFile( - new DownloadFileOption - { - url = "xxxxx", - success = (res) => - { - WX.ShowShareImageMenu( - new ShowShareImageMenuOption - { - path = res.tempFilePath, - style = "default", - success = (res) => - { - Debug.Log("success"); - }, - fail = (res) => - { - Debug.Log("fail" + res.errMsg); - }, - complete = (res) => - { - Debug.Log("complete"); - } - } - ); - } - } - ); - } - - public void setMessageToFriendQuery() - { - var isSuccess = WX.SetMessageToFriendQuery( - new SetMessageToFriendQueryOption { shareMessageToFriendScene = 1, query = "abcd" } - ); - WX.ShowToast(new ShowToastOption { title = isSuccess ? "true" : "false" }); - } - - public void setHandoffQuery() - { - var isSuccess = WX.SetHandoffQuery("xxx"); - WX.ShowToast(new ShowToastOption { title = isSuccess ? "true" : "false" }); - } - - public void onShareTimeline() - { - if (!_isListeningShareTimeline) - { - WX.OnShareTimeline(_onShareTimelineCallback); - } - else - { - WX.OffShareTimeline(_onShareTimelineCallback); - } - _isListeningShareTimeline = !_isListeningShareTimeline; - GameManager.Instance.detailsController.ChangeExtraButtonText( - 5, - _isListeningShareTimeline ? "取消监听分享到朋友圈" : "开始监听分享到朋友圈" - ); - } - - public void onShareMessageToFriend() - { - WX.OnShareMessageToFriend(_onShareMessageToFriend); - } - - public void onShareAppMessage() - { - var defaultParam = new WXShareAppMessageParam - { - title = "转发标题", - imageUrl = "xx", - query = "key1=val1&key2=val2" - }; - WX.OnShareAppMessage(defaultParam, _onShareAppMessageCallback); - } - - private void OnDestroy() - { - WX.OffShareTimeline(_onShareTimelineCallback); - } -} diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEventSO.asset b/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEventSO.asset deleted file mode 100644 index ec0a53927..000000000 --- a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEventSO.asset +++ /dev/null @@ -1,31 +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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} - m_Name: ShareEventSO - m_EditorClassIdentifier: - entryName: "\u8F6C\u53D11" - entryOrder: 0 - entryScriptTypeName: ShareEvent - entryAPI: "\u8F6C\u53D1\u76F8\u5173api" - entryDescription: "\u8F6C\u53D1\u529F\u80FD\u53EF\u80FD\u9700\u8981\u76F8\u5173\u6743\u9650" - optionList: [] - initialButtonText: "\u66F4\u65B0\u8F6C\u53D1\u5C5E\u6027" - extraButtonList: - - buttonText: "\u663E\u793A\u5F53\u524D\u9875\u9762\u7684\u8F6C\u53D1\u6309\u94AE" - - buttonText: "\u9690\u85CF\u5F53\u524D\u9875\u9762\u7684\u8F6C\u53D1\u6309\u94AE" - - buttonText: "\u6253\u5F00\u5206\u4EAB\u56FE\u7247\u5F39\u7A97" - - buttonText: "\u8BBE\u7F6Esharetofriend\u5B57\u6BB5" - - buttonText: "\u8BBE\u7F6E\u63A5\u529B\u53C2\u6570" - - buttonText: "\u5F00\u59CB\u76D1\u542C\u5206\u4EAB\u5230\u670B\u53CB\u5708" - - buttonText: "\u76D1\u542Csharetofriend" - - buttonText: "\u76D1\u542C\u53F3\u4E0A\u89D2\u83DC\u5355\u7684\u8F6C\u53D1" - initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2.cs b/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2.cs deleted file mode 100644 index 12ce36102..000000000 --- a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2.cs +++ /dev/null @@ -1,156 +0,0 @@ -using System; -using System.Collections.Generic; -using LitJson; -using UnityEngine; -using WeChatWASM; - -public class ShareEvent2 : Details -{ - private bool _isListeningHandoff = false; - private bool _isListeningCopyUrl = false; - private bool _isListeningAddToFavorites = false; - - private readonly Action> _onHandoff = (callback) => - { - callback(new OnHandoffListenerResult { query = "xxxx" }); - }; - - private readonly Action> _onCopyUrl = (callback) => - { - callback(new OnCopyUrlListenerResult { query = "xx" }); - }; - - private readonly Action> _onAddToFavorites = ( - callback - ) => - { - callback( - new OnAddToFavoritesListenerResult - { - title = "收藏标题", - imageUrl = "xx", - query = "key1=val1&key2=val2", - disableForward = false - } - ); - }; - - private void Start() - { - GameManager.Instance.detailsController.BindExtraButtonAction(0, onCopyUrl); - GameManager.Instance.detailsController.BindExtraButtonAction(1, onAddToFavorites); - GameManager.Instance.detailsController.BindExtraButtonAction(2, getShareInfo); - GameManager.Instance.detailsController.BindExtraButtonAction(3, authPrivateMessage); - } - - // 测试 API - protected override void TestAPI(string[] args) - { - onHandoff(); - } - - public void onHandoff() - { - if (!_isListeningHandoff) - { - WX.OnHandoff(_onHandoff); - } - else - { - WX.OffHandoff(_onHandoff); - } - _isListeningHandoff = !_isListeningHandoff; - GameManager.Instance.detailsController.ChangeInitialButtonText( - _isListeningHandoff ? "取消监听在电脑上打开" : "开始监听在电脑上打开" - ); - } - - public void onCopyUrl() - { - if (!_isListeningCopyUrl) - { - WX.OnCopyUrl(_onCopyUrl); - } - else - { - WX.OffCopyUrl(_onCopyUrl); - } - _isListeningCopyUrl = !_isListeningCopyUrl; - GameManager.Instance.detailsController.ChangeExtraButtonText( - 0, - _isListeningCopyUrl ? "取消监听复制链接" : "开始监听复制链接" - ); - } - - public void onAddToFavorites() - { - if (!_isListeningAddToFavorites) - { - WX.OnAddToFavorites(_onAddToFavorites); - } - else - { - WX.OffAddToFavorites(_onAddToFavorites); - } - _isListeningAddToFavorites = !_isListeningAddToFavorites; - GameManager.Instance.detailsController.ChangeExtraButtonText( - 1, - _isListeningAddToFavorites ? "取消监听收藏" : "开始监听收藏" - ); - } - - public void getShareInfo() - { - WX.GetShareInfo( - new GetShareInfoOption - { - shareTicket = "xxx", - timeout = 2000, - success = (res) => - { - Debug.Log("success"); - }, - fail = (res) => - { - Debug.Log("fail" + res.errMsg); - }, - complete = (res) => - { - Debug.Log("complete"); - } - } - ); - } - - public void authPrivateMessage() - { - WX.AuthPrivateMessage( - new AuthPrivateMessageOption - { - shareTicket = "xxxxxx", - success = (res) => - { - Debug.Log("authPrivateMessage success" + JsonMapper.ToJson(res)); - // res - // { - // errMsg: 'authPrivateMessage:ok' - // valid: true - // iv: 'xxxx', - // encryptedData: 'xxxxxx' - // } - }, - fail = (res) => - { - Debug.Log("authPrivateMessage fail" + res.errMsg); - } - } - ); - } - - private void OnDestroy() - { - WX.OffHandoff(_onHandoff); - WX.OffCopyUrl(_onCopyUrl); - WX.OffAddToFavorites(_onAddToFavorites); - } -} diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent2.meta b/Demo/API_V2/Assets/API/Share/ShareImageMenu.meta similarity index 77% rename from Demo/API_V2/Assets/API/Share/ShareEvent2.meta rename to Demo/API_V2/Assets/API/Share/ShareImageMenu.meta index d2071e336..4ce76a398 100644 --- a/Demo/API_V2/Assets/API/Share/ShareEvent2.meta +++ b/Demo/API_V2/Assets/API/Share/ShareImageMenu.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6ac1c23530f334ed8bf710a30e20cac3 +guid: 944ee0aae0bcb1c4d9966cf200053081 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenu.cs b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenu.cs new file mode 100644 index 000000000..5d5b87109 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenu.cs @@ -0,0 +1,114 @@ +using WeChatWASM; +using UnityEngine; + +public class ShowShareImageMenu : Details +{ + private string localImagePath; + private string tempImagePath; + + protected override void TestAPI(string[] args) + { + if (GetOptionString(0, "") == "本地路径") + { + DownloadFileImage(true); + } + else + { + DownloadFileImage(false); + } + } + + private void ShowLoading() + { + WX.ShowLoading(new ShowLoadingOption() + { + title = "正在下载图片...", + mask = true + }); + } + + private void HideLoading() + { + WX.HideLoading(new HideLoadingOption()); + } + + private void DownloadFileImage(bool saveAsLocal) + { + ShowLoading(); + WX.DownloadFile(new DownloadFileOption() + { + url = "https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg", + success = (res) => + { + Debug.Log("WX.DownloadFile success"); + if (res.statusCode == 200) + { + tempImagePath = res.tempFilePath; + + if (saveAsLocal) + { + var fs = WX.GetFileSystemManager(); + // 将临时文件保存为本地缓存文件 + localImagePath = fs.SaveFileSync(res.tempFilePath, WX.env.USER_DATA_PATH + "/shareImage.jpg"); + Debug.Log($"本地缓存文件保存路径: {localImagePath}"); + } + else + { + Debug.Log($"临时文件路径: {tempImagePath}"); + } + showShareImageMenu(); + } + }, + fail = (res) => + { + Debug.Log("WX.DownloadFile fail"); + }, + complete = (res) => + { + Debug.Log("WX.DownloadFile complete"); + HideLoading(); + } + }); + } + + public void showShareImageMenu() + { + string pathType = GetOptionString(0, ""); + bool needShowEntrance = GetOptionBool(1, false); + string entrancePath = GetOptionString(2, ""); + + string imagePath = pathType == "本地路径" ? localImagePath : tempImagePath; + + WX.ShowShareImageMenu( + new ShowShareImageMenuOption + { + path = imagePath, + needShowEntrance = needShowEntrance, + entrancePath = entrancePath, + success = (res) => + { + Debug.Log("success"); + }, + fail = (res) => + { + Debug.Log("fail" + res.errMsg); + }, + complete = (res) => + { + Debug.Log("complete"); + } + } + ); + } + + private void OnDestroy() + { + // 清理本地文件 + if (!string.IsNullOrEmpty(localImagePath)) + { + var fs = WX.GetFileSystemManager(); + fs.UnlinkSync(localImagePath); + Debug.Log("清理本地图片成功"); + } + } +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEvent.cs.meta b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenu.cs.meta similarity index 83% rename from Demo/API_V2/Assets/API/Share/ShareEvent/ShareEvent.cs.meta rename to Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenu.cs.meta index 224691608..976f332b0 100644 --- a/Demo/API_V2/Assets/API/Share/ShareEvent/ShareEvent.cs.meta +++ b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenu.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b4e4926be3ae2474a953f7604fe5fc66 +guid: 975ebcc7ab80a6945a62d6b7ede8c8b3 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenuSO.asset b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenuSO.asset new file mode 100644 index 000000000..297cb2669 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenuSO.asset @@ -0,0 +1,33 @@ +%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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} + m_Name: ShareImageMenuSO + m_EditorClassIdentifier: + entryScriptTypeName: ShowShareImageMenu + entryName: "\u5206\u4EAB\u56FE\u7247\u5F39\u7A97" + entryAPI: ShowShareImageMenu + entryDescription: "\u6253\u5F00\u5206\u4EAB\u56FE\u7247\u5F39\u7A97" + optionList: + - optionName: path + availableOptions: + - "\u672C\u5730\u8DEF\u5F84" + - "\u4E34\u65F6\u8DEF\u5F84" + - optionName: needShowEntrance + availableOptions: + - false + - true + - optionName: entrancePath + availableOptions: + - '''''' + initialButtonText: "\u6253\u5F00\u5206\u4EAB\u56FE\u7247\u5F39\u7A97" + extraButtonList: [] + initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2SO.asset.meta b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenuSO.asset.meta similarity index 79% rename from Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2SO.asset.meta rename to Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenuSO.asset.meta index fd19d3d2c..605b7a1a6 100644 --- a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2SO.asset.meta +++ b/Demo/API_V2/Assets/API/Share/ShareImageMenu/ShareImageMenuSO.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0512619a7c8064a079849e6f0a8b140f +guid: 2ba9a02a26c73e048b5307d234540ade NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Demo/API_V2/Assets/API/Share/ShareInfo.meta b/Demo/API_V2/Assets/API/Share/ShareInfo.meta new file mode 100644 index 000000000..f418a724b --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareInfo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cd4ffea4c8c421c4f82696b0e3a8803f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfo.cs b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfo.cs new file mode 100644 index 000000000..4404a3f26 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfo.cs @@ -0,0 +1,126 @@ +using WeChatWASM; +using UnityEngine; +using LitJson; +using System; +using UnityEditor; + +public class ShareInfo : Details +{ + private static bool isSetupInitialized = false; + private string CloudID; + + protected override void TestAPI(string[] args) + { + if (!isSetupInitialized) + { + GetGroupEnterInfoButton(); + isSetupInitialized = true; + } + else + { + Debug.Log("Share setup already initialized, skip initialization."); + } + } + + // 分享信息按钮 + private void GetGroupEnterInfoButton() + { + InitCloudFunction();//初始化云函数 + WX.UpdateShareMenu(new UpdateShareMenuOption + { + withShareTicket = true, + success = (res) => + { + Debug.Log("分享菜单配置成功"); + }, + fail = (res) => + { + Debug.Log("分享菜单配置失败"); + } + }); + WX.OnShow((res) => + { + Debug.Log("Scene:" + res.scene); + Debug.Log("shareTicket:" + res.shareTicket); + Debug.Log("chatType:" + res.chatType); + + getGroupEnterInfo(); + }); + } + + // 获取分享Shareticket信息 + private void getGroupEnterInfo() + { + // 从基础库 v2.17.3 开始,推荐用 wx.getGroupEnterInfo 替代wx.getShareInfo接口 + WX.GetGroupEnterInfo(new GetGroupEnterInfoOption + { + success = (res) => + { + Debug.Log("GetGroupEnterInfo success"); + Debug.Log("errMsg:" + res.errMsg); + Debug.Log("encryptedData:" + res.encryptedData); + Debug.Log("iv:" + res.iv); + Debug.Log("CloudID:" + res.cloudID); + CloudID = res.cloudID; + CloudCallFunction();// 传入CloudID调用 + }, + fail = (res) => + { + Debug.Log("GetGroupEnterInfo fail:" + res.errMsg); + }, + complete = (res) => + { + Debug.Log("GetGroupEnterInfo complete"); + } + }); + } + // 初始化云函数 + private void InitCloudFunction() + { + WX.cloud.Init(new ICloudConfig + { + env = "dev-h504y"//需填入 云开发环境ID + }); + } + // data + private class CloudCallFunctionData + { + public string shareCloudData; + } + + // 调用云函数 + private void CloudCallFunction() + { + var data = new CloudCallFunctionData() + { + shareCloudData = WX.cloud.CloudID(CloudID), // 通过GetShareInfo接口获取的CloudID + }; + + WX.cloud.CallFunction(new CallFunctionParam() + { + name = "myFunction", // 须在云函数侧创建对应函数 + data = data, + success = (res) => + { + WX.ShowModal(new ShowModalOption() + { + content = "Cloud CallFunction Success: " + JsonMapper.ToJson(res) + }); + }, + fail = (res) => + { + WX.ShowModal(new ShowModalOption() + { + content = "Cloud CallFunction Fail: " + JsonMapper.ToJson(res) + }); + }, + complete = (res) => + { + WX.ShowModal(new ShowModalOption() + { + content = "Cloud CallFunction Complete: " + JsonMapper.ToJson(res) + }); + } + }); + } +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfo.cs.meta b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfo.cs.meta new file mode 100644 index 000000000..8731dd192 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f196339b54639442901fd1890be8c0a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfoSO.asset b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfoSO.asset new file mode 100644 index 000000000..2e3ab0015 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfoSO.asset @@ -0,0 +1,24 @@ +%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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} + m_Name: ShareInfoSO + m_EditorClassIdentifier: + entryName: "\u83B7\u53D6\u7FA4\u804A\u4FE1\u606F" + entryOrder: 0 + entryScriptTypeName: ShareInfo + entryAPI: GetGroupEnterInfo + entryDescription: "\u83B7\u53D6\u8F6C\u53D1\u8BE6\u7EC6\u4FE1\u606F\uFF08\u4E3B\u8981\u662F\u83B7\u53D6\u7FA4ID\uFF09\u3002\n\u4ECE\u7FA4\u804A\u5185\u7684\u5C0F\u7A0B\u5E8F\u6D88\u606F\u5361\u7247\u6253\u5F00\u5C0F\u7A0B\u5E8F\u65F6\uFF0C\u8C03\u7528\u6B64\u63A5\u53E3\u624D\u6709\u6548\u3002\n\u4ECE\u57FA\u7840\u5E93 + v2.17.3 \u5F00\u59CB\uFF0C\u63A8\u8350\u7528 wx.getGroupEnterInfo \u66FF\u4EE3\u6B64\u63A5\u53E3\u3002" + optionList: [] + initialButtonText: "\u83B7\u53D6\u7FA4\u804A\u4FE1\u606F" + extraButtonList: [] + initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfoSO.asset.meta b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfoSO.asset.meta new file mode 100644 index 000000000..53330a40c --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareInfo/ShareInfoSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9ee7e215d0456b488d2a691988d3377 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareMenu.meta b/Demo/API_V2/Assets/API/Share/ShareMenu.meta new file mode 100644 index 000000000..f1432707c --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareMenu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1ec1d4ecf5aae804f93feae8994f3c5b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenu.cs b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenu.cs new file mode 100644 index 000000000..0714f358e --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenu.cs @@ -0,0 +1,91 @@ +using UnityEngine; +using WeChatWASM; + +public class ShareMenu : Details +{ + private bool _isShowingShare = false; + + protected override void TestAPI(string[] args) + { + showShareMenu(); + } + + public void showShareMenu() + { + _isShowingShare = !_isShowingShare; + + if (_isShowingShare) + { + WX.ShowShareMenu( + new ShowShareMenuOption + { + withShareTicket = true, + menus = new string[] { "shareAppMessage", "shareTimeline" }, + success = (res) => + { + ShowToast("已显示转发按钮"); + Debug.Log("success"); + }, + fail = (res) => + { + ShowToast("显示转发失败"); + Debug.Log("fail" + res.errMsg); + }, + complete = (res) => + { + Debug.Log("complete"); + } + } + ); + } + else + { + WX.HideShareMenu( + new HideShareMenuOption + { + menus = new string[] { "shareAppMessage", "shareTimeline" }, + success = (res) => + { + ShowToast("已隐藏转发按钮"); + Debug.Log("success"); + }, + fail = (res) => + { + ShowToast("隐藏转发失败"); + Debug.Log("fail" + res.errMsg); + }, + complete = (res) => + { + Debug.Log("complete"); + } + } + ); + } + + GameManager.Instance.detailsController.ChangeInitialButtonText( + _isShowingShare ? "隐藏转发按钮" : "显示转发按钮" + ); + } + + private void ShowToast(string message) + { + WX.ShowToast(new ShowToastOption() + { + title = message, + icon = "none", + duration = 1500, + mask = false + }); + } + + private void OnDestroy() + { + WX.ShowShareMenu( + new ShowShareMenuOption + { + withShareTicket = true, + menus = new string[] { "shareAppMessage", "shareTimeline" }, + } + ); + } +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenu.cs.meta b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenu.cs.meta new file mode 100644 index 000000000..625206452 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenu.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3cbc8c1391bff754299b28b70f3ccd53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenuSO.asset b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenuSO.asset new file mode 100644 index 000000000..835097f34 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenuSO.asset @@ -0,0 +1,25 @@ +%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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} + m_Name: ShareMenuSO + m_EditorClassIdentifier: + entryName: "\u663E\u793A\u8F6C\u53D1" + entryOrder: 0 + entryScriptTypeName: ShareMenu + entryAPI: 'ShowShareMenu + + HideShareMenu' + entryDescription: "\u8BBE\u7F6E\u53F3\u4E0A\u89D2\u70B9\u5F00\u7684\u8BE6\u60C5\u754C\u9762\u4E2D\u7684\u5206\u4EAB\u6309\u94AE\u662F\u5426\u53EF\u7528\n" + optionList: [] + initialButtonText: "\u663E\u793A\u8F6C\u53D1\u6309\u94AE" + extraButtonList: [] + initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenuSO.asset.meta b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenuSO.asset.meta new file mode 100644 index 000000000..a7766191a --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareMenu/ShareMenuSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67f658e249949454a9336842877eacb2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareSO.asset b/Demo/API_V2/Assets/API/Share/ShareSO.asset index 991563cc5..1e1a1b190 100644 --- a/Demo/API_V2/Assets/API/Share/ShareSO.asset +++ b/Demo/API_V2/Assets/API/Share/ShareSO.asset @@ -15,8 +15,5 @@ MonoBehaviour: isNative: 0 categoryName: "\u8F6C\u53D1" categorySprite: {fileID: 21300000, guid: fcb0815b78313407ba299719f527350d, type: 3} - entryList: - - {fileID: 11400000, guid: 102555321c0dd4bc3ae36bf3514c2052, type: 2} - - {fileID: 11400000, guid: 805c0a637a7d34742adf65b16186a448, type: 2} - - {fileID: 11400000, guid: 0512619a7c8064a079849e6f0a8b140f, type: 2} + entryList: [] categoryOrder: 2 diff --git a/Demo/API_V2/Assets/API/Share/ShareTimeline.meta b/Demo/API_V2/Assets/API/Share/ShareTimeline.meta new file mode 100644 index 000000000..3dacb5848 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareTimeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b0cb13a03589a3f4f8633a69a0a479e6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimeline.cs b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimeline.cs new file mode 100644 index 000000000..97f28f437 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimeline.cs @@ -0,0 +1,158 @@ +using WeChatWASM; +using System; +using UnityEngine; + +public class ShareTimeline : Details +{ + private bool _isListeningShareTimeline = false; + private Action> _onShareTimelineCallback; + private string localImagePath; + + protected override void TestAPI(string[] args) + { + // 如果已经在监听中,只执行切换监听的操作 + if (_isListeningShareTimeline) + { + onShareTimeline(); + return; + } + + // 根据参数决定是否需要下载本地图片 + if (GetOptionString(1, "") == "本地图片文件路径") + { + DownloadFileImage(); + } + else + { + InitializeTimelineCallback(); + onShareTimeline(); + } + } + + private void ShowLoading() + { + WX.ShowLoading(new ShowLoadingOption() + { + title = "正在下载图片...", + mask = true + }); + } + + private void HideLoading() + { + WX.HideLoading(new HideLoadingOption()); + } + + private void DownloadFileImage() + { + ShowLoading(); + WX.DownloadFile(new DownloadFileOption() + { + url = "https://mmgame.qpic.cn/image/b941692c4de1a46c180c84569cc24c20389bf176794048becdf2421e61483fd0/0", + success = (res) => + { + Debug.Log("WX.DownloadFile success"); + if (res.statusCode == 200) + { + Debug.Log(res.tempFilePath); + var fs = WX.GetFileSystemManager(); + // 将临时文件保存为本地缓存文件 + localImagePath = fs.SaveFileSync(res.tempFilePath, WX.env.USER_DATA_PATH + "/timelineImage.jpg"); + Debug.Log($"本地缓存文件保存路径: {localImagePath}"); + InitializeTimelineCallback(); + onShareTimeline(); + } + }, + fail = (res) => + { + Debug.Log("WX.DownloadFile fail"); + }, + complete = (res) => + { + Debug.Log("WX.DownloadFile complete"); + HideLoading(); + } + }); + } + + private void InitializeTimelineCallback() + { + string title = GetOptionString(0, ""); + string imageUrl = GetOptionString(1, ""); + string imageUrlId = GetOptionString(2, ""); + string imagePreviewUrl = GetOptionString(3, ""); + string imagePreviewUrlId = GetOptionString(4, ""); + string query = GetOptionString(5, ""); + + // 如果使用本地图片,替换为本地路径 + if (imageUrl == "本地图片文件路径") + { + imageUrl = localImagePath; + } + + _onShareTimelineCallback = (callback) => + { + callback( + new OnShareTimelineListenerResult + { + title = title, + imageUrl = imageUrl, + imageUrlId = imageUrlId, + imagePreviewUrl = imagePreviewUrl, + imagePreviewUrlId = imagePreviewUrlId, + query = query + } + ); + Debug.Log($"朋友圈分享回调参数 - 标题: {title}, 图片URL: {imageUrl}, 图片ID: {imageUrlId}, 预览图URL: {imagePreviewUrl}, 预览图ID: {imagePreviewUrlId}, Query: {query}"); + }; + } + + public void onShareTimeline() + { + if (!_isListeningShareTimeline) + { + WX.OnShareTimeline(_onShareTimelineCallback); + Debug.Log("开始监听朋友圈分享"); + // 添加开始监听时的提示 + WX.ShowToast(new ShowToastOption() + { + title = "已开启朋友圈分享监听", + icon = "none", + duration = 1500 + }); + } + else + { + WX.OffShareTimeline(_onShareTimelineCallback); + Debug.Log("取消监听朋友圈分享"); + // 添加取消监听时的提示 + WX.ShowToast(new ShowToastOption() + { + title = "已取消朋友圈分享监听", + icon = "none", + duration = 1500 + }); + } + _isListeningShareTimeline = !_isListeningShareTimeline; + GameManager.Instance.detailsController.ChangeInitialButtonText( + _isListeningShareTimeline ? "取消监听分享到朋友圈" : "开始监听分享到朋友圈" + ); + } + + private void OnDestroy() + { + if (_isListeningShareTimeline) + { + WX.OffShareTimeline(_onShareTimelineCallback); + Debug.Log("清理朋友圈分享监听"); + } + + // 清理本地文件 + if (!string.IsNullOrEmpty(localImagePath)) + { + var fs = WX.GetFileSystemManager(); + fs.UnlinkSync(localImagePath); + Debug.Log("清理本地图片成功"); + } + } +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimeline.cs.meta b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimeline.cs.meta new file mode 100644 index 000000000..9aa3bbe11 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimeline.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b753484e4f7a5d4f9d357263ef368d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimelineSO.asset b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimelineSO.asset new file mode 100644 index 000000000..2e435067f --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimelineSO.asset @@ -0,0 +1,48 @@ +%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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} + m_Name: ShareTimelineSO + m_EditorClassIdentifier: + entryName: "\u76D1\u542C\u5206\u4EAB\u5230\u670B\u53CB\u5708" + entryOrder: 0 + entryScriptTypeName: ShareTimeline + entryAPI: OnShareTimeline | OffShareTimeline + entryDescription: "\u8F6C\u53D1\u529F\u80FD\u53EF\u80FD\u9700\u8981\u76F8\u5173\u6743\u9650\n\u76D1\u542C\u7528\u6237\u70B9\u51FB\u53F3\u4E0A\u89D2\u83DC\u5355\u7684\u300C\u5206\u4EAB\u5230\u670B\u53CB\u5708\u300D\u6309\u94AE\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6\u3002\n\u672C\u63A5\u53E3\u4E3A + Beta \u7248\u672C\uFF0C\u6682\u53EA\u5728 Android \u5E73\u53F0\u652F\u6301\u3002\n\u6CE8\u610F\uFF1A\u7A7A\u9009\u9879\u5219\u4F7F\u7528\u9ED8\u8BA4\u503C" + optionList: + - optionName: title + availableOptions: + - "\u5206\u4EAB\u5230\u670B\u53CB\u5708" + - + - optionName: imageUrl + availableOptions: + - https://mmocgame.qpic.cn/wechatgame/QgsibLsZPBy1uwWJnNNPeRXjBMKm327We8xrXWxGMM4cFKUZaqy0SU8TcudBf72sE/0 + - "\u672C\u5730\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84" + - + - optionName: imageUrlId + availableOptions: + - CoH3v3JtRc2ajuDvZyhHXQ== + - + - optionName: imagePreviewUrl + availableOptions: + - "\u670B\u53CB\u5708\u9884\u89C8\u56FE\u94FE\u63A5" + - https://mmocgame.qpic.cn/wechatgame/QgsibLsZPBy1uwWJnNNPeRXjBMKm327We8xrXWxGMM4cFKUZaqy0SU8TcudBf72sE/0 + - optionName: imagePreviewUrlId + availableOptions: + - "\u670B\u53CB\u5708\u9884\u89C8\u56FE\u56FE\u7247\u7F16\u53F7" + - CoH3v3JtRc2ajuDvZyhHXQ== + - optionName: query + availableOptions: + - key1=val1 + initialButtonText: "\u5F00\u59CB\u76D1\u542C\u5206\u4EAB\u5230\u670B\u53CB\u5708" + extraButtonList: [] + initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimelineSO.asset.meta b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimelineSO.asset.meta new file mode 100644 index 000000000..415f9e2d9 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/ShareTimeline/ShareTimelineSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ad02ddcd43d7e5439afe0b165d92460 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/linkHand.meta b/Demo/API_V2/Assets/API/Share/linkHand.meta new file mode 100644 index 000000000..408534b85 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/linkHand.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20f31f23950db8648b6b04015bd98188 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/linkHand/linkHand.cs b/Demo/API_V2/Assets/API/Share/linkHand/linkHand.cs new file mode 100644 index 000000000..1f263dbc6 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/linkHand/linkHand.cs @@ -0,0 +1,35 @@ +using WeChatWASM; +using System; + +public class linkHand : Details +{ + private bool _isListeningCopyUrl = false; + private readonly Action> _onCopyUrl = (callback) => + { + callback(new OnCopyUrlListenerResult { query = "xx" }); + }; + + protected override void TestAPI(string[] args) + { + onCopyUrl(); + } + public void onCopyUrl() + { + if (!_isListeningCopyUrl) + { + WX.OnCopyUrl(_onCopyUrl); + } + else + { + WX.OffCopyUrl(_onCopyUrl); + } + _isListeningCopyUrl = !_isListeningCopyUrl; + GameManager.Instance.detailsController.ChangeInitialButtonText( + _isListeningCopyUrl ? "取消监听复制链接" : "开始监听复制链接" + ); + } + private void OnDestroy() + { + WX.OffCopyUrl(_onCopyUrl); + } +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/linkHand/linkHand.cs.meta b/Demo/API_V2/Assets/API/Share/linkHand/linkHand.cs.meta new file mode 100644 index 000000000..1388ffb3f --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/linkHand/linkHand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e94ce1c2d91599d4a850c8a27f11b66c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/linkHand/linkHandSO.asset b/Demo/API_V2/Assets/API/Share/linkHand/linkHandSO.asset new file mode 100644 index 000000000..0e501aec1 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/linkHand/linkHandSO.asset @@ -0,0 +1,24 @@ +%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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} + m_Name: linkHandSO + m_EditorClassIdentifier: + entryName: "\u76D1\u542C\u590D\u5236\u94FE\u63A5" + entryOrder: 0 + entryScriptTypeName: linkHand + entryAPI: OnCopyUrl | OffCopyUrl + entryDescription: "\u76D1\u542C\u7528\u6237\u70B9\u51FB\u53F3\u4E0A\u89D2\u83DC\u5355\u7684\u300C\u590D\u5236\u94FE\u63A5\u300D\u6309\u94AE\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6\u3002\n\u672C\u63A5\u53E3\u4E3A + Beta \u7248\u672C\uFF0C\u6682\u53EA\u5728 Android \u5E73\u53F0\u652F\u6301\u3002" + optionList: [] + initialButtonText: "\u5F00\u59CB\u76D1\u542C\u590D\u5236\u94FE\u63A5" + extraButtonList: [] + initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/linkHand/linkHandSO.asset.meta b/Demo/API_V2/Assets/API/Share/linkHand/linkHandSO.asset.meta new file mode 100644 index 000000000..4e7003cce --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/linkHand/linkHandSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84dc36325409b724a9dafb6e1f0e1da6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/onPcHand.meta b/Demo/API_V2/Assets/API/Share/onPcHand.meta new file mode 100644 index 000000000..7111c5c92 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onPcHand.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d134949cb89b4714aaec7f81045a9523 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/onPcHand/onPcHand.cs b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHand.cs new file mode 100644 index 000000000..e96c59d58 --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHand.cs @@ -0,0 +1,50 @@ +using WeChatWASM; +using System; +using UnityEngine; + +public class onPcHand : Details +{ + private bool _isListeningHandoff = false; + private readonly Action> _onHandoff = (callback) => +{ + var result = new OnHandoffListenerResult + { + query = "key1=value2&key2=value2" + }; + callback(result); + Debug.Log($"return query: {result.query}"); +}; + + protected override void TestAPI(string[] args) + { + onHandoff(); + } + private void Start() + { + GameManager.Instance.detailsController.BindExtraButtonAction(0, setHandoffQuery); + } + public void onHandoff() + { + if (!_isListeningHandoff) + { + WX.OnHandoff(_onHandoff); + } + else + { + WX.OffHandoff(_onHandoff); + } + _isListeningHandoff = !_isListeningHandoff; + GameManager.Instance.detailsController.ChangeInitialButtonText( + _isListeningHandoff ? "取消监听在电脑上打开" : "开始监听在电脑上打开" + ); + } + public void setHandoffQuery() + { + var isSuccess = WX.SetHandoffQuery("xxx"); + WX.ShowToast(new ShowToastOption { title = isSuccess ? "true" : "false" }); + } + private void OnDestroy() + { + WX.OffHandoff(_onHandoff); + } +} diff --git a/Demo/API_V2/Assets/API/Share/onPcHand/onPcHand.cs.meta b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHand.cs.meta new file mode 100644 index 000000000..778e74b2b --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea41a2380d5e6fa46ac8335f7f81d652 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2SO.asset b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHandSO.asset similarity index 53% rename from Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2SO.asset rename to Demo/API_V2/Assets/API/Share/onPcHand/onPcHandSO.asset index 7b9404a4a..0da3a71c1 100644 --- a/Demo/API_V2/Assets/API/Share/ShareEvent2/ShareEvent2SO.asset +++ b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHandSO.asset @@ -10,18 +10,15 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} - m_Name: ShareEvent2SO + m_Name: onPcHandSO m_EditorClassIdentifier: - entryName: "\u8F6C\u53D12" + entryName: "\u76D1\u542C\u5728\u7535\u8111\u4E0A\u6253\u5F00" entryOrder: 0 - entryScriptTypeName: ShareEvent2 - entryAPI: "\u8F6C\u53D1\u76F8\u5173api" - entryDescription: "\u8F6C\u53D1\u529F\u80FD\u53EF\u80FD\u9700\u8981\u76F8\u5173\u6743\u9650" + entryScriptTypeName: onPcHand + entryAPI: OnHandoff | OffHandoff | SetHandoffQuery + entryDescription: "\u76D1\u542C\u7528\u6237\u70B9\u51FB\u83DC\u5355\u300C\u5728\u7535\u8111\u4E0A\u6253\u5F00\u300D\u6309\u94AE\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6" optionList: [] initialButtonText: "\u5F00\u59CB\u76D1\u542C\u5728\u7535\u8111\u4E0A\u6253\u5F00" extraButtonList: - - buttonText: "\u5F00\u59CB\u76D1\u542C\u590D\u5236\u94FE\u63A5" - - buttonText: "\u5F00\u59CB\u76D1\u542C\u6536\u85CF" - - buttonText: "\u83B7\u53D6\u8F6C\u53D1\u8BE6\u7EC6\u4FE1\u606F" - - buttonText: "\u9A8C\u8BC1\u79C1\u5BC6\u6D88\u606F" + - buttonText: "\u8BBE\u7F6E\u63A5\u529B\u53C2\u6570" initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/onPcHand/onPcHandSO.asset.meta b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHandSO.asset.meta new file mode 100644 index 000000000..8fcb850cf --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onPcHand/onPcHandSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6a5988630a88f5c4a928361f8529bdf2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/onShareAppMessage.meta b/Demo/API_V2/Assets/API/Share/onShareAppMessage.meta new file mode 100644 index 000000000..fa2653f2f --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onShareAppMessage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 44c1e5662ded52544a40896c7c66f613 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessage.cs b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessage.cs new file mode 100644 index 000000000..f78943d5e --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessage.cs @@ -0,0 +1,84 @@ +using WeChatWASM; +using System; +using LitJson; +using UnityEngine; + +public class onShareAppMessage : Details +{ + private readonly Action> _onShareAppMessageCallback = ( + callback + ) => + { + callback( + new WXShareAppMessageParam + { + title = "转发标题2", + imageUrl = "https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg", + query = "key1=val1" + } + ); + }; + private bool _isListeningShare = false; + + private readonly Action _onShow = (res) => + { + var result = "onShow\n" + JsonMapper.ToJson(res); + GameManager.Instance.detailsController.AddResult( + new ResultData() { initialContentText = result } + ); + }; + + private readonly Action _onHide = (res) => + { + var result = "onHide\n" + JsonMapper.ToJson(res); + GameManager.Instance.detailsController.AddResult( + new ResultData() { initialContentText = result } + ); + }; + protected override void TestAPI(string[] args) + { + OnShareAppMessage(); + } + public void OnShareAppMessage() + { + if (!_isListeningShare) + { + var defaultParam = new WXShareAppMessageParam + { + title = "转发标题1", + imageUrl = "https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg", + query = "key1=val1" + }; + WX.OnShareAppMessage(defaultParam, _onShareAppMessageCallback); + WX.ShowToast(new ShowToastOption + { + title = "开始监听转发", + icon = "none" + }); + WX.OnShow(_onShow); + WX.OnHide(_onHide); + } + else + { + var defaultParam = new WXShareAppMessageParam + { + title = default, + imageUrl = "xxx", + query = "key1=val1" + }; + WX.OnShareAppMessage(defaultParam); + WX.ShowToast(new ShowToastOption + { + title = "取消监听转发", + icon = "none" + }); + WX.OffShow(_onShow); + WX.OffHide(_onHide); + } + + _isListeningShare = !_isListeningShare; + GameManager.Instance.detailsController.ChangeInitialButtonText( + _isListeningShare ? "取消监听转发" : "开始监听转发" + ); + } +} \ No newline at end of file diff --git a/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessage.cs.meta b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessage.cs.meta new file mode 100644 index 000000000..c0402561c --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e787ee1e7c3e9724083082f33ab87a55 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessageSO.asset b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessageSO.asset new file mode 100644 index 000000000..6d386725b --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessageSO.asset @@ -0,0 +1,23 @@ +%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: 57c8415214254e23a63d9bfb8c6bbf62, type: 3} + m_Name: onShareAppMessageSO + m_EditorClassIdentifier: + entryName: "\u76D1\u542C\u8F6C\u53D1" + entryOrder: 0 + entryScriptTypeName: onShareAppMessage + entryAPI: OnShareAppMessage + entryDescription: "\u76D1\u542C\u7528\u6237\u70B9\u51FB\u53F3\u4E0A\u89D2\u83DC\u5355\u7684\u300C\u8F6C\u53D1\u300D\u6309\u94AE\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6\n\u88AB\u52A8\u8F6C\u53D1\uFF0C\u53EF\u901A\u8FC7\u8FD4\u56DE\u81EA\u5B9A\u4E49\u8F6C\u53D1\u53C2\u6570\u6765\u4FEE\u6539\u8F6C\u53D1\u5361\u7247\u7684\u5185\u5BB9\uFF0C\u5426\u5219\u4F7F\u7528\u9ED8\u8BA4\u5185\u5BB9\u3002" + optionList: [] + initialButtonText: "\u5F00\u59CB\u76D1\u542C\u8F6C\u53D1" + extraButtonList: [] + initialResultList: [] diff --git a/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessageSO.asset.meta b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessageSO.asset.meta new file mode 100644 index 000000000..4171b19bc --- /dev/null +++ b/Demo/API_V2/Assets/API/Share/onShareAppMessage/onShareAppMessageSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f854158c3e3d7c646a22ba9e8a6f3b43 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/Scripts/DetailsEntry/Details.cs b/Demo/API_V2/Assets/Scripts/DetailsEntry/Details.cs index 69545825f..fd3719b74 100644 --- a/Demo/API_V2/Assets/Scripts/DetailsEntry/Details.cs +++ b/Demo/API_V2/Assets/Scripts/DetailsEntry/Details.cs @@ -55,6 +55,13 @@ protected string GetOptionString(int optionIndex, string defaultValue = "") } return defaultValue; } + //获得选项Bool类型值 + protected bool GetOptionBool(int optionIndex, bool defaultValue) + { + return options != null && optionIndex < options.Length && bool.TryParse(options[optionIndex], out bool value) + ? value + : defaultValue; + } // 打印当前选项的值 protected void LogCurrentOptions() { diff --git a/Demo/API_V2/Assets/Scripts/PrivateMessage.meta b/Demo/API_V2/Assets/Scripts/PrivateMessage.meta new file mode 100644 index 000000000..2689b2ab5 --- /dev/null +++ b/Demo/API_V2/Assets/Scripts/PrivateMessage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a83db5429dc2fd5409af94c88ed1ab18 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessage.cs b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessage.cs new file mode 100644 index 000000000..a70f13203 --- /dev/null +++ b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessage.cs @@ -0,0 +1,35 @@ +using UnityEngine; +using WeChatWASM; +using LitJson; + +public class PrivateMessage : Details +{ + protected override void TestAPI(string[] args) + { + + } + public void authPrivateMessage() + { + WX.AuthPrivateMessage( + new AuthPrivateMessageOption + { + shareTicket = "xxxxxx", + success = (res) => + { + Debug.Log("authPrivateMessage success" + JsonMapper.ToJson(res)); + // res + // { + // errMsg: 'authPrivateMessage:ok' + // valid: true + // iv: 'xxxx', + // encryptedData: 'xxxxxx' + // } + }, + fail = (res) => + { + Debug.Log("authPrivateMessage fail" + res.errMsg); + } + } + ); + } +} diff --git a/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessage.cs.meta b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessage.cs.meta new file mode 100644 index 000000000..acc845946 --- /dev/null +++ b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 161771bdcd292e94f8331d4a052d7819 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessageSO.asset b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessageSO.asset new file mode 100644 index 000000000..4e5107ca7 --- /dev/null +++ b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessageSO.asset @@ -0,0 +1,24 @@ +%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: fb48e4613a53bb941a20036d7c08fefb, type: 3} + m_Name: PrivateMessageSO + m_EditorClassIdentifier: + entryScriptTypeName: PrivateMessage + entryName: "\u9A8C\u8BC1\u79C1\u5BC6\u6D88\u606F" + entryAPI: wx.authPrivateMessage + entryDescription: "\u9A8C\u8BC1\u79C1\u5BC6\u6D88\u606F\u3002\u7528\u6CD5\u8BE6\u60C5\u89C1 + \u5C0F\u7A0B\u5E8F\u79C1\u5BC6\u6D88\u606F\u4F7F\u7528\u6307\u5357" + optionList: [] + initialButtonText: "\u79C1\u5BC6\u6D88\u606F\u9A8C\u8BC1" + extraButtonList: [] + initialResultList: [] + entryOrder: 0 diff --git a/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessageSO.asset.meta b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessageSO.asset.meta new file mode 100644 index 000000000..41ef14b44 --- /dev/null +++ b/Demo/API_V2/Assets/Scripts/PrivateMessage/PrivateMessageSO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 519da7c63574fd3499e390e73184682f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: