PlayDisplayDialog.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | using UnityEditor; public class PlayDisplayDialog { [MenuItem( "Custom Menu/Play" )] public static void Play() { bool playOutput = EditorUtility.DisplayDialog( "Play" , "Are you sure you want to enter play mode?" , "Yes" , "No" ); if (playOutput) EditorApplication.EnterPlaymode(); else EditorUtility.DisplayDialog( "Canceled" , "You canceled the play mode." , "OK" ); } } |