Skip to content

Instantly share code, notes, and snippets.

@Druixd
Created April 24, 2025 16:13
Show Gist options
  • Save Druixd/35c60fb74432dfb5d2d1f506d813af6a to your computer and use it in GitHub Desktop.
Save Druixd/35c60fb74432dfb5d2d1f506d813af6a to your computer and use it in GitHub Desktop.
A handy Unity Editor script that adds a custom menu item (Tools > Toggle Fast Play Mode) to quickly enable or disable Fast Enter Play Mode using a keyboard shortcut (Ctrl+Shift+F / Cmd+Shift+F). Perfect for speeding up your iteration loop while prototyping or debugging! Usage: Drop this script into an Editor folder in your Unity project. Then us…
using UnityEditor;
using UnityEngine;
public static class ToggleFastPlayModeMenu
{
[MenuItem("Tools/Toggle Fast Play Mode %#f")] // Ctrl+Shift+F or Cmd+Shift+F
public static void ToggleFastMode()
{
EditorSettings.enterPlayModeOptionsEnabled = !EditorSettings.enterPlayModeOptionsEnabled;
string state = EditorSettings.enterPlayModeOptionsEnabled ? "Enabled" : "Disabled";
Debug.Log($"Fast Play Mode {state}");
// Optional: Show notification in GameView
var gameView = EditorWindow.GetWindow(System.Type.GetType("UnityEditor.GameView,UnityEditor"));
gameView.ShowNotification(new GUIContent($"Fast Play Mode {state}"));
}
[MenuItem("Tools/Toggle Fast Play Mode %#f", true)]
public static bool ToggleFastMode_Validate()
{
Menu.SetChecked("Tools/Toggle Fast Play Mode", EditorSettings.enterPlayModeOptionsEnabled);
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment