Giter VIP home page Giter VIP logo

minigame-unity-webgl-transform's Issues

微信小游戏内存泄露

image

小游戏发布到手机运行时,左上角的Memory Used数据在不停上升,然后会开始掉帧

image

我以为是内存泄漏,于是用微信开发者工具中的内存监测工具看了下,也用Unity的Memory Profile工具看了下,发现好像没有泄漏。

image

image

在2020LTS 版本转换失败

我在2019版本是可以的,想测一下其他版本兼容性。在2020.3.21f1上,机型mac, 授权到不弹出任何信息,运行打包出的webggl, 报错,显示找不到引入文件。看一下,在这一行

<script src="%UNITY_WEBGL_LOADER_URL%"></script>

宏没给替换,在2019打包正常的文件里这一行为

<script src="Build/UnityLoader.js"></script>

然后发现2020打包出来的webgl中Build文件夹里没有UnityLoader.js这个文件。
好像是在2020里打包没进行完全,但也没有报错误。

wasm 分包异常

按文档对游戏进行wasm分包,分包完成后要求在设备上测试,就报异常了:

message:Error: 非法的文件,错误信息:invalid file: webgl.wasm.framework.unityweb.js, undefined:32978: SyntaxError: Unexpected end of input,;GameGlobal.unityNamespace.useWasmCodeSplit = true;GameGlobal.unityNamespace.WASM_SPLIT_SUB_VERSION = 0; ^SyntaxError: Unexpected end of input [20220224 17:05:56][wxd3ab13cb733c6ed7]
appid: wxd3ab13cb733c6ed7
openid: o6zAJs63XZo94y2iBfkoJHZ-A8Vs
ideVersion: 1.05.2201240
osType: win32-x64
time: 2022-02-24 17:05:58

image
image

看情况,应该是分包成功了的

求陀螺仪及设备方向接口

wx.stopDeviceMotionListening(Object object)
wx.startDeviceMotionListening(Object object)
wx.onDeviceMotionChange(function callback)
wx.offDeviceMotionChange(function callback)
wx.stopGyroscope(Object object)
wx.startGyroscope(Object object)
wx.onGyroscopeChange(function callback)
wx.offGyroscopeChange(function callback)

2021-11-20日附近的某次更新,导致原来可以的现在无法转换

报错信息
Screen Shot 2021-11-22 at 10 34 36 am
找到代码中报错的位置
Screen Shot 2021-11-22 at 10 35 12 am
根据报错信息可以看出原因是尝试拷贝一个不存在的文件。我用unity build成webgl是成功的,生成的build目录如下
Screen Shot 2021-11-22 at 10 41 22 am
git diff
Screen Shot 2021-11-22 at 10 49 36 am

更新之后多了个配置
Screen Shot 2021-11-22 at 10 41 55 am
看代码好像是之前asset bundle的配置的扩展,我想知道如果我用unity的addressable需不需要配这个?
Screen Shot 2021-11-22 at 10 54 56 am

使用WebGL2.0(alpha)构建后 实体机无法打开

Unity版本:2020.3.27f1
插件版本:2022-1-26

使用WebGL2.0(alpha)构建后 微信开发者工具可正常运行 推送到PC微信也可正常运行

但推送到手机后 无法打开并报以下错误

MiniProgramError
Cannot read property 'clearColor' of null
TypeError: Cannot read property 'clearColor' of null
at e.value (wxe5a48f1ed5f544b7/plugin.js:188:18663)
at e.value (wxe5a48f1ed5f544b7/plugin.js:188:18090)

报错图片

我的手机运行游戏会闪退

之前还好好的,我用git回退到旧版本也不行
别人的手机可以正常打开游戏
我的手机等加载完之后微信就闪退了,没有任何提示,该怎么查

mac os 导出报错,unity 2020.3

Win32Exception: ApplicationName='/Users/xxx/bsgit/lazyeye-unity/Assets/WX-WASM-SDK/Editor/PVRTexToolCLI', CommandLine=' -help', CurrentDirectory='', Native error= mono-io-layer-error (2)
System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <0463b2ef957545c0a51b42f372cd4fbb>:0)
System.Diagnostics.Process.Start () (at <0463b2ef957545c0a51b42f372cd4fbb>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
WeChatWASM.PicCompressor.TestPVRTC () (at Assets/WX-WASM-SDK/Editor/PicCompressor.cs:371)
WeChatWASM.WXEditorWindow.MacSetAuth () (at Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs:90)
WeChatWASM.WXEditorWindow.DoExport () (at Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs:1239)
WeChatWASM.WXEditorWindow.OnGUI () (at Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs:1172)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:403)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:381)
UnityEditor.DockArea.OldOnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:372)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:353)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:663)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:635)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:628)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:594)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:583)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/IMGUIContainer.cs:516)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Events/EventHandler.cs:125)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Events/MouseCaptureDispatchingStrategy.cs:83)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/EventDispatcher.cs:373)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/EventDispatcher.cs:336)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/EventDispatcher.cs:299)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/EventDispatcher.cs:264)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/EventDispatcher.cs:75)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/EventDispatcher.cs:364)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/EventDispatcher.cs:216)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Panel.cs:372)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:461)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:209)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:74)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/UIElementsUtility.cs:28)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

插件未授权使用

导入本demo也是,就是什么也没做,卡在UnityPlugin,点击添加插件,弹出“可添加的插件信息为空,请重新编译”
编译器提示
无法访问此网站网址为 devtools://openapplyplugin/ 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。
ERR_INVALID_URL

微信小游戏真机关闭调试模式,无法使用Addressable加载CDN的AB包

打开调试模式一切正常,关闭后等到调用Addressables.LoadAssetAsync(...)时:
RemoteProviderException: TextDataProvider : Unable to load from url : https:xxx/StreamingAssets/aa/settings.json
UnityWebRequest result: Unknown Error
微信后台的合法域名已配置(其实用的云开发,配置不配置都一样),webgl.data.unityweb.bin.txt等都正常加载,因为已经进入了游戏,只有Addressables无法使用。

另外还有个其他问题不知何解,加载远程天空盒材质(6面)并设置后,天空以及场景都变黑,几乎看不见,调用DynamicGI.UpdateEnvironment()也无果,打印出材质的属性也都正常。在电脑网页上进入webgl版是没有问题的,微信小游戏真机则不行。

导出报错

image

image

image

使用的插件是:minigame.202201251131.unitypackage
unity版本是2020.3.21f1c1个人版

wasm 生成错误

webgl 目录下生成的代码名为 webgl.asm.code.unityweb ,转换代码中会强制读取 webgl.wasm.code.unityweb 产生报错。我的 unity 版本为 2019.4.16f1c1

VideoPlayer支持

image
当前版本使用VideoPlayer时出现如上错误,希望后面版本能够支持此组件,谢谢~
Unity版本:2019.4.28f1
插件版本:202107092059

LUA不兼容报错

转换出WEBGL有个报错,我们使用了SLUA
LinkError: WebAssembly.instantiate(): Import #6 module="env" function="luaO_nilobject" error: global import must be a number or WebAssembly.Global object

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.