Created
April 19, 2018 08:52
-
-
Save tnayuki/925348893d38b10a4ebc23d889b2af36 to your computer and use it in GitHub Desktop.
Unityを殺すコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.Runtime.InteropServices; | |
public class NewBehaviourScript : MonoBehaviour { | |
[DllImport("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")] | |
public static extern IntPtr objc_msgSend(IntPtr receiver, IntPtr selector); | |
[MenuItem("Unity/Force Shutdown")] | |
public static void ForceShutdown() | |
{ | |
objc_msgSend((IntPtr)4, (IntPtr)4); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment