4 [
Attribute(
desc:
"Enable to enter the layer, disable to leave the layer")]
5 protected bool m_bToEnter;
7 [
Attribute(
desc:
"When enable, it will not move just one layer up, but all the way to root. And the same when moving down.")]
8 protected bool m_bToExtreme;
11 protected bool m_bIsHidden;
15 return layersManager.GetCurrentLayer()
16 && (!m_bToExtreme || layersManager.GetCurrentLayer().GetParentEntity());
19 override bool CanBeShown(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
25 if (!layersManager || !layersManager.IsEditingLayersEnabled())
28 if (m_bToEnter && !hoveredEntity)
32 return hoveredEntity.CanEnterLayer(layersManager);
34 return !hoveredEntity && CanExit(layersManager);
36 override bool CanBePerformed(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
39 if (!layersManager || !layersManager.IsEditingLayersEnabled())
42 if (m_bToEnter && !hoveredEntity)
46 return hoveredEntity.CanEnterLayer(layersManager);
48 return CanExit(layersManager);
50 override void Perform(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags,
int param = -1)
60 layersManager.SetCurrentLayer(hoveredEntity.GetParentEntity());
63 layersManager.ToggleCurrentLayer(hoveredEntity);
69 layersManager.SetCurrentLayer(
null);
72 layersManager.SetCurrentLayerToParent();
75 override bool IsServer()