c# - Unity 帮助解决 HTML5 Build 上的 Uncaught Abort
问题描述
由于某种原因,当单击一个按钮导致我的游戏崩溃时会触发一个调用。知道如何解决这个问题吗?
我有很多其他的调用,没有一个给出问题。我将 Enable Exceptions 选项设置为 None 并且游戏在 Unity 中运行良好。
如果您可以指出相关的内容,我可以提供有关该错误的更多信息。
public void OnClick()
{
if (buyCoal.interactable == true)
{
trainObject.trainMovementStart();
if (SceneManager.GetActiveScene().name == "Level1" || SceneManager.GetActiveScene().name == "Level2")
Invoke("coal_refill", 6f);
if (SceneManager.GetActiveScene().name == "Level3")
Invoke("coal_refill", 12f);
Money.UseMoney(coalcost);
buyCoalAudio.Play();
countdown += 1; //agora é count up
tipCoalReady = 2;
buyCoalButtonIndex = 0; //DISABLE COAL Buy Button
coal_stock_countdown.text = countdown.ToString();
coaltipCounter += 1;
}
}
void coal_refill()
{
ThermoElectric.quota += 17.5m;
Invoke("reactivateBuyCoalButton", 5f);
}
void reactivateBuyCoalButton()
{
buyCoalButtonIndex = 1;
}
错误日志:
由于堆栈跟踪 [Object.stackTrace] (ed63bf36d25f876fa57fb81632b59202.unitywebAbor.8:225v56p)处的 jsStackTrace ( ed63bf36d25f876fa57fb81632b59202.unityweb
:8:22380) 处的错误导致未捕获的中止 (145) 调用错误处理程序ssl.hwcdn.net/html/1680115/PowerTheGrid_Level3_v7.2_HTML5/Build/3998187b7e8feaa618a93b293c0e6812.js:4:11065)
解决方案
推荐阅读
- python - Python 3.x 缓慢
- python - AES265 Python 到 C# 的转换失败
- r - 当 x 和 y 比例非常不同时,如何设置坐标限制?
- twitter - Twitter-autohook 在部署时不起作用
- node.js - 如何使用 discord.js 音乐机器人在歌曲中寻找一个点?
- javascript - 过滤后保持行值相同。(谷歌应用脚本,电子表格)
- c++ - 代码和宽松原子的编译器/硬件优化
- python - 具有 Python 协议的域的正则表达式
- vba - 如何在 Excel VBA 中为字符串添加空格
- python - Python检查参数是某个对象的列表