Scene View Pie Menu
Package to easily create pie menus in the scene view.
wischeropp.jonas.scene-view-pie-menu 
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/scene-view-pie-menu.git README Markdown
Copy this to your project's README.md
## Installation
Add **Scene View Pie Menu** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/scene-view-pie-menu.git
```
[](https://www.pkglnk.dev/pkg/scene-view-pie-menu)README
Scene View Pie Menu
This small unity package makes it easy to create pie menus in the scene view to trigger custom actions. The pie menu works similar to the blender pie menu.
Usage
Create a PieMenu object with PieMenuEntrys and trigger its Perform method with a ClutchShortcut (see example).
Overloads of the PieMenuEntry constructor allow setting the icon with a custom texture or by a string value, to use unity build in icons. A non-exhaustive icon list can be found here.
Example
The following example shows how this package can be used to create the pie menu in the demo.
using JonasWischeropp.Unity.EditorTools.SceneView;
using UnityEditor;
using UnityEditor.ShortcutManagement;
using UnityEngine;
public static class DrawModePieMenu {
static PieMenu overlay = new PieMenu(new PieMenuEntry[]{
CreateEntry("Shaded", "TreeEditor.Material", DrawCameraMode.Normal),
CreateEntry("Wireframe", "TreeEditor.Geometry On", DrawCameraMode.Wireframe),
CreateEntry("Shaded Wireframe", "d_PreMatSphere", DrawCameraMode.TexturedWire),
});
[ClutchShortcut("Draw Mode Pie Menu", typeof(SceneView), KeyCode.Z)]
static void PerformPieMenu(ShortcutArguments arguments) {
overlay.Perform(arguments);
}
static PieMenuEntry CreateEntry(string name, string icon, DrawCameraMode mode) {
return new PieMenuEntry(name, icon,
() => SceneView.lastActiveSceneView.cameraMode = SceneView.GetBuiltinCameraMode(mode),
() => SceneView.lastActiveSceneView.cameraMode == SceneView.GetBuiltinCameraMode(mode)
);
}
}
I would recommend to disable
Project Settings > Input Manager > Use Physical Keys. Otherwise, triggering a shortcut likeKeyCode.Zwould for example require pressingYon aQWERTZkeyboard because of the swapped key locations.
Setup
Installation using the Package Manager:
- Click on the
+in thePackage Managerwindow - Chose
Add package from git URL... - Insert the following URL
https://github.com/JonasWischeropp/unity-scene-view-pie-menu.git
A specific release version can be specified by appending#<version>(e.g....e-menu.git#1.1.0). - Press the
Add-Button
No comments yet. Be the first!