当我在统一编辑器中运行游戏时,它运行良好。当我编译为 WebGL 并在 Firefox 中打开页面时,出现以下错误:
中止@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:3058219:43 _pthread_create@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:9360:2 __ZN6il2cpp2os10ThreadImpl3RunEPFvPvES2_ [il2cpp::os::ThreadImpl::Run(void (* (void*), void*)]@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2653112:47 __ZN6il2cpp2os6Thread3RunEPFvPvES2_ [il2cpp::os::Thread::Run(void (*)(void*), void*)]@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2874729:9 dynCall_iiii@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2963923:9 invoke_iiii@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:17416:10 __ZN6il2cpp6icalls8mscorlib6System9Threading6Thread15Thread_internalEP12Il2CppThreadP14Il2CppDelegate [il2cpp::icalls::mscorlib::System::Threading::Thread::Thread_internal(Il2CppThread*, Il2CppDelegate*)]@blob:null/0e57772a-69dc486614bb:1-22dc486614bb:1- _Thread_Start_m1419497481@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:1791638:7 _SocketTcp_Connect_m1201015870@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2181642:3 __ZN16VirtFuncInvoker0IbE6InvokeEjPv [VirtFuncInvoker0::Invoke(unsigned int, void*)]@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2811156:7 _TPeer_Connect_m3119387828@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:1340847:7 __ZN16VirtFuncInvoker2IbP8String_tS1_E6InvokeEjPvS1_S1_ [VirtFuncInvoker2::Invoke(unsigned int, void*, String_t*, String_t*)]@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2745912:7 dynCall_iiiiii@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2942910:9 invoke_iiiiii@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:16256:10 _PhotonPeer_Connect_m3702473380@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:1759101:8 __ZN16VirtFuncInvoker2IbP8String_tS1_E6InvokeEjPvS1_S1_ [VirtFuncInvoker2::Invoke(unsigned int, void*, String_t*, String_t*)]@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2745912:7 _PhotonClient_ConnectToServer_m837296971@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:1097111:8 _NetWorker_ConnectToServer_m931114268@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2760409:9 _Game_ConnectToServer_m115951967@blob:null/0e57772a-6990-46ba-afc3-1dc4b6f931bb:2770978:9
我认为在这种方法中: peer.Connect(connection, appName) 应用程序尝试启动新线程,但 WebGL 不支持多线程