forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServerEntryPoint.cs
More file actions
28 lines (27 loc) · 722 Bytes
/
Copy pathServerEntryPoint.cs
File metadata and controls
28 lines (27 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#if UNITY_DOTSRUNTIME
using Unity.Platforms;
using Unity.Runtime;
using Unity.Runtime.EntryPoint;
namespace DOTSRuntime.Server
{
public class ServerMain
{
public static void Main()
{
Program.Initialize();
var unity = UnityInstance.Initialize();
unity.OnTick = (double timestampInSeconds) =>
{
var shouldContinue = unity.Update(timestampInSeconds);
return shouldContinue;
};
PlatformEvents.OnQuit += (sender, evt) =>
{
unity.Deinitialize();
Program.Shutdown();
};
RunLoop.EnterMainLoop(unity.OnTick);
}
}
}
#endif