unity-linux-gamemode/Assets/LinuxGameMode.cs
2018-11-30 15:02:50 +00:00

28 lines
646 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.InteropServices;
public class LinuxGameMode : MonoBehaviour
{
#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
[DllImport("UnityGameMode")]
private static extern int UnityEnterGameMode();
[DllImport("UnityGameMode")]
private static extern int UnityExitGameMode();
#endif
private void Start()
{
#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
UnityEnterGameMode();
#endif
}
private void End()
{
#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
UnityExitGameMode();
#endif
}
}