(ContextMenu contextMenu, EditorWindow window)
| 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 | { |
nothing calls this directly
no test coverage detected