A powerful Unity Editor extension that provides a circular button interface for quick access to custom actions. Activate with Ctrl+Q
hotkey to display a radial menu of available actions at your mouse position.
Ctrl+Q
to instantly open the action menuYou can import the Quick Action package into your Unity project using one of the following methods:
For VRChat developers: Add to VCC via VPM Listing
https://github.com/Yueby/QuickAction.git
Packages
folderCreate a new script and add a simple action:
using UnityEngine;
using UnityEditor;
using Yueby.QuickActions; // Don't forget to import the namespace
public class MyActions
{
[QuickAction("Tools/Hello World", "Display a greeting message")]
public static void HelloWorld()
{
Debug.Log("Hello from Quick Action!");
}
[QuickAction("Tools/Create Cube", "Create a cube in the scene", Priority = -100)]
public static void CreateCube()
{
var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.name = "Quick Action Cube";
Selection.activeGameObject = cube;
}
}
Ctrl+Q
in the Unity EditorCtrl+Q
or click to execute the actionThe QuickActionAttribute
is used to mark methods as quick actions:
[QuickAction(path, description, Priority = priority, ValidateFunction = "ValidationMethod")]
Parameters:
path
(required): Action path using forward slashes (e.g., “Tools/My Action”)description
(optional): Action description for tooltipsPriority
(optional): Display priority (lower numbers appear first)ValidateFunction
(optional): Method name for conditional enablingAction methods must be:
static
public
or private
void
Validation functions must be:
static
public
or private
bool
Validation functions can also control action visibility and checked state using:
QuickAction.SetVisible(path, bool)
: Show/hide actionsQuickAction.SetChecked(path, bool)
: Set checked state (shows checkmark)QuickAction.GetVisible(path)
: Get visibility stateQuickAction.GetChecked(path)
: Get checked stateusing UnityEngine;
using UnityEditor;
using Yueby.QuickActions;
public class BasicActions
{
[QuickAction("Debug/Clear Console", "Clear the console window")]
public static void ClearConsole()
{
var assembly = System.Reflection.Assembly.GetAssembly(typeof(SceneView));
var type = assembly.GetType("UnityEditor.LogEntries");
var method = type.GetMethod("Clear");
method.Invoke(new object(), null);
}
[QuickAction("GameObject/Create Empty at Origin", "Create empty GameObject at world origin")]
public static void CreateEmptyAtOrigin()
{
var go = new GameObject("Empty GameObject");
go.transform.position = Vector3.zero;
Selection.activeGameObject = go;
}
}
using UnityEngine;
using UnityEditor;
using Yueby.QuickActions;
public class ConditionalActions
{
[QuickAction("Selection/Delete Selected", "Delete selected GameObjects", ValidateFunction = "HasSelection")]
public static void DeleteSelected()
{
if (Selection.gameObjects.Length > 0)
{
foreach (var go in Selection.gameObjects)
{
Undo.DestroyObjectImmediate(go);
}
}
}
private static bool HasSelection()
{
bool hasSelection = Selection.gameObjects.Length > 0;
// Only show this action when objects are selected
QuickAction.SetVisible("Selection/Delete Selected", hasSelection);
return hasSelection;
}
[QuickAction("Play Mode/Stop Play", "Stop play mode", ValidateFunction = "IsPlaying")]
public static void StopPlay()
{
EditorApplication.isPlaying = false;
}
private static bool IsPlaying()
{
return EditorApplication.isPlaying;
}
}
using UnityEngine;
using UnityEditor;
using Yueby.QuickActions;
public class StateActions
{
private static bool _featureEnabled = false;
[QuickAction("Settings/Toggle Feature", "Enable/disable a feature", ValidateFunction = "ValidateFeature")]
public static void ToggleFeature()
{
_featureEnabled = !_featureEnabled;
Debug.Log($"Feature {(_featureEnabled ? "enabled" : "disabled")}");
}
private static bool ValidateFeature()
{
// Show checkmark when feature is enabled
QuickAction.SetChecked("Settings/Toggle Feature", _featureEnabled);
return true;
}
[QuickAction("Tools/Debug Mode", "Toggle debug mode", ValidateFunction = "ValidateDebugMode")]
public static void ToggleDebugMode()
{
Debug.unityLogger.logEnabled = !Debug.unityLogger.logEnabled;
}
private static bool ValidateDebugMode()
{
// Show current debug mode state
QuickAction.SetChecked("Tools/Debug Mode", Debug.unityLogger.logEnabled);
return true;
}
}
using UnityEngine;
using UnityEditor;
using Yueby.QuickActions;
public class HierarchicalActions
{
[QuickAction("Tools/Utilities/Screenshot", "Take a screenshot")]
public static void TakeScreenshot()
{
ScreenCapture.CaptureScreenshot("screenshot.png");
Debug.Log("Screenshot saved as screenshot.png");
}
[QuickAction("Tools/Utilities/Open Persistent Data", "Open persistent data path")]
public static void OpenPersistentData()
{
EditorUtility.RevealInFinder(Application.persistentDataPath);
}
[QuickAction("Tools/Scene/Save Scene", "Save current scene")]
public static void SaveScene()
{
EditorSceneManager.SaveScene(EditorSceneManager.GetActiveScene());
}
}
Quick Action provides specialized SceneView integration features, including:
"Tools/Build/Build Player"
instead of "Build"
"GameObject/Primitives/Create Cube"
Undo
operations for reversible actionsusing Yueby.QuickActions;
[QuickAction(string path, string description = null)]
Path
: Action path (required)Description
: Action description (optional)Priority
: Display priority (optional, default: 0)ValidateFunction
: Validation method name (optional)This package is provided under the MIT License.
yueby.tools.quick-action
未設定
1.0.4
2022.3.22f1 以降
なし
なし
なし
未設定
Yueby