
[ad_1]
I created some MenuMerchandise
capabilities for navigating, that are presently displayed on the menu toolbar. The C# code:
utilizing UnityEditor;
utilizing UnityEngine;
public class Menu : MonoBehaviour {
static void rotateView(Quaternion rotation) {
SceneView.lastActiveSceneView.LookAt(SceneView.lastActiveSceneView.pivot, rotation);
SceneView.lastActiveSceneView.Repaint();
}
[MenuItem("View/Front _1")] // FRONT
static void FrontView() {
rotateView(Quaternion.Euler(0, 180, 0));
}
[MenuItem("View/Back &1")] // BACK
static void BackView() {
rotateView(Quaternion.Euler(0, 0, 0));
}
// Few extra comparable capabilities
}
I got here from Blender, the place there are shortcuts opening a context menu on the cursor place like this one, opened after urgent U
:
What I need to do is displaying a context menu after urgent P
which might show a listing of applied MenuObjects
.
Is one thing like this doable in Unity?
[ad_2]