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