Repository navigation
JBehaviour Loop Failed #511
Description
Activity
public JBehaviour Activate()
{
//主线程
ThreadMgr.QueueOnMainThread(() =>
{
Awake();
var duration = 1f / ((float)Application.targetFrameRate <= 0
? FpsMonitor.FPS
: Application.targetFrameRate);
duration = duration / TimeScale;
ThreadMgr.QueueOnMainThread(() =>
{
OnEnable();
Start();
}, duration);
});
return this;
}测试下来是因为在 JBehaviour 执行 Activate是 FpsMonitor.FPS值为0,导致duration值很大。
Reacted by JasonXuDeveloper - 傑This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
If this issue is still relevant, please comment or remove the stale label.This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
If this issue is still relevant, please comment or remove the stale label.This issue was closed due to inactivity. Feel free to reopen if still relevant.
This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
If this issue is still relevant, please comment or remove the stale label.This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
If this issue is still relevant, please comment or remove the stale label.This issue was closed due to inactivity. Feel free to reopen if still relevant.
在热更方法 RunGame 里动态创建JBehaviour,最开始创建的前几个的Loop方法不会执行。
需要打包环境测试,在JBehaviour.cs里屏蔽掉如下代码:
//编辑器下可视化
if (Application.isEditor)
{
var id = AddClassBind(gameObject, activeAfter, typeof(T));
var ret = (T)JBehaviours[id];
ret.Check();
return ret;
}
可以在Unity编辑器下重现,前提是FpsMonitor里的_backupFrames初始化为0;