MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnContextMenu

Method OnContextMenu

Source/Editor/SceneGraph/Actors/SceneNode.cs:72–89  ·  view source on GitHub ↗

(ContextMenu contextMenu, EditorWindow window)

Source from the content-addressed store, hash-verified

70
71 /// <inheritdoc />
72 public override void OnContextMenu(ContextMenu contextMenu, EditorWindow window)
73 {
74 contextMenu.AddSeparator();
75 var path = Scene.Path;
76 if (!string.IsNullOrEmpty(path) && File.Exists(path))
77 {
78 var b = contextMenu.AddButton("Show in content window", OnSelect);
79 b.Icon = Editor.Instance.Icons.Search12;
80 b.TooltipText = "Finds and selects the scene asset int Content window.";
81 }
82 contextMenu.AddButton("Save scene", OnSave).LinkTooltip("Saves this scene.").Enabled = IsEdited && !Editor.IsPlayMode;
83 contextMenu.AddButton("Unload scene", OnUnload).LinkTooltip("Unloads this scene.").Enabled = Editor.Instance.StateMachine.CurrentState.CanChangeScene;
84 if (Level.ScenesCount > 1)
85 contextMenu.AddButton("Unload all but this scene", OnUnloadAllButSelectedScene).LinkTooltip("Unloads all of the active scenes except for the selected scene.").Enabled = Editor.Instance.StateMachine.CurrentState.CanChangeScene;
86
87 contextMenu.MaximumItemsInViewCount += 3;
88 base.OnContextMenu(contextMenu, window);
89 }
90
91 private void OnSelect()
92 {

Callers

nothing calls this directly

Calls 4

AddSeparatorMethod · 0.45
ExistsMethod · 0.45
AddButtonMethod · 0.45
LinkTooltipMethod · 0.45

Tested by

no test coverage detected