Skip to content

Instantly share code, notes, and snippets.

@tnayuki
Created April 19, 2018 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnayuki/925348893d38b10a4ebc23d889b2af36 to your computer and use it in GitHub Desktop.
Save tnayuki/925348893d38b10a4ebc23d889b2af36 to your computer and use it in GitHub Desktop.
Unityを殺すコード
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