| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using BansheeEngine;
- namespace BansheeEditor
- {
- /// <summary>
- /// Editor window that displays the scene hierarchy tree view, displaying all scene objects in the current scene.
- /// </summary>
- public class HierarchyWindow : EditorWindow
- {
- private GUISceneTreeView treeView;
- /// <summary>
- /// Opens the hierarchy window.
- /// </summary>
- [MenuItem("Windows/Hierarchy", ButtonModifier.CtrlAlt, ButtonCode.H, 6000)]
- private static void OpenHierarchyWindow()
- {
- OpenWindow<HierarchyWindow>();
- }
- /// <inheritdoc/>
- protected override LocString GetDisplayName()
- {
- return new LocEdString("Hierarchy");
- }
- /// <summary>
- /// Cuts the currently selected scene object.
- /// </summary>
- public void CutSelection()
- {
- treeView.CutSelection();
- }
- /// <summary>
- /// Copies the currently selected scene object.
- /// </summary>
- public void CopySelection()
- {
- treeView.CopySelection();
- }
- /// <summary>
- /// Pastes the scene object(s) that were previously cut or copied.
- /// </summary>
- public void PasteToSelection()
- {
- treeView.PasteToSelection();
- }
- /// <summary>
- /// Deletes currently selected scene objects.
- /// </summary>
- public void DeleteSelection()
- {
- treeView.DeleteSelection();
- }
- /// <summary>
- /// Duplicates currently selected scene objects.
- /// </summary>
- public void DuplicateSelection()
- {
- treeView.DuplicateSelection();
- }
- private void OnInitialize()
- {
- GUIScrollArea scrollArea = new GUIScrollArea();
- GUI.AddElement(scrollArea);
- treeView = new GUISceneTreeView();
- scrollArea.Layout.AddElement(treeView);
- }
- private void OnEditorUpdate()
- {
- treeView.Update();
- }
- }
- }
|