There was an error while loading. Please reload this page.
1 parent 7025c5a commit e534fb8Copy full SHA for e534fb8
Assets/Game Programming Patterns/Game Loop Pattern/Example/GameLoopPatternExample.cs
@@ -18,7 +18,7 @@ void Start()
18
{
19
//进行游戏循环
20
//DoGameLoop();
21
- Debug.Log("Unity已经内建了游戏循环模式,即Update( ),自己实现会导致卡死。这边仅保留代码框架,不作调用");
+ Debug.Log("Unity已经内建了游戏循环模式,即Update( ),按《游戏编程模式》书中的原版实现会导致卡死。这边仅保留代码框架,不作调用。");
22
}
23
24
void Update()
@@ -71,15 +71,15 @@ public void DoGameLoop()
71
double elapsed = current - previous;
72
previous = current;
73
lag += elapsed;
74
- //ProcessInput();
+ ProcessInput();
75
76
while (lag >= MS_PER_UPDATE)
77
78
- //Update();
+ Update();
79
lag -= MS_PER_UPDATE;
80
81
82
- //Render();
+ Render();
83
84
85
0 commit comments