8 protected ref map<int, ref set<SCR_EditableEntityComponent>> m_SavedSelections =
new map<int, ref set<SCR_EditableEntityComponent>>();
14 void SaveSelection(
int index)
16 set<SCR_EditableEntityComponent> selection =
new set<SCR_EditableEntityComponent>();
18 m_SavedSelections.Set(
index, selection);
24 void LoadSelection(
int index)
26 set<SCR_EditableEntityComponent> selection =
new set<SCR_EditableEntityComponent>();
27 if (GetSelection(
index, selection))
36 void TeleportSelection(
int index)
42 set<SCR_EditableEntityComponent> selection =
new set<SCR_EditableEntityComponent>();
43 if (GetSelection(
index, selection))
46 if (teleportComponent)
51 teleportComponent.TeleportCamera(
position);
57 protected bool GetSelection(
int index, out notnull set<SCR_EditableEntityComponent> outSelection)
59 if (!m_SavedSelections.Find(
index, outSelection))
62 for (
int i = outSelection.Count() - 1; i >= 0; i--)
65 outSelection.Remove(i);
67 return !outSelection.IsEmpty();
77 override void EOnEditorActivate()
79 if (!GetCore())
return;
80 GetCore().Event_OnParentEntityChanged.Insert(OnParentEntityChanged);
82 override void EOnEditorDeactivate()
84 if (!GetCore())
return;
85 GetCore().Event_OnParentEntityChanged.Remove(OnParentEntityChanged);