mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Utils.IsHeadless so it can be reused by other classes if needed.
This commit is contained in:
parent
2a9d7e2df3
commit
d3afa9f26f
@ -85,7 +85,7 @@ public virtual void Awake()
|
|||||||
InitializeSingleton();
|
InitializeSingleton();
|
||||||
|
|
||||||
// headless mode? then start the server
|
// headless mode? then start the server
|
||||||
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null && startOnHeadless)
|
if (Utils.IsHeadless() && startOnHeadless)
|
||||||
{
|
{
|
||||||
Application.targetFrameRate = 60;
|
Application.targetFrameRate = 60;
|
||||||
StartServer();
|
StartServer();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
|
||||||
namespace Mirror
|
namespace Mirror
|
||||||
{
|
{
|
||||||
@ -184,5 +185,11 @@ public static float[] UnpackUShortIntoThreeFloats(ushort combined, float minTarg
|
|||||||
float w = ScaleByteToFloat(upper, 0x00, 0x1F, minTarget, maxTarget);
|
float w = ScaleByteToFloat(upper, 0x00, 0x1F, minTarget, maxTarget);
|
||||||
return new float[]{u, v, w};
|
return new float[]{u, v, w};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// headless mode detection
|
||||||
|
public static bool IsHeadless()
|
||||||
|
{
|
||||||
|
return SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user