public void SelectionUpdated() { guideSnapEnabled = (selection.GetSelection().Count > 0) ? true : false; alignEnabled = (selection.GetSelection().Count > 1) ? true : false; distroEnabled = (selection.GetSelection().Count > 2) ? true : false; spaceEnabled = (selection.GetSelection().Count > 1) ? true : false; if (R2DE_EditorWindow.Instance != null) { utils.RepaintEditorWindow(); } }
public void HandleInteraction() { if (!state.gridEnabled || !state.snapToGrid || gridData == null) { return; } EventType eventType = Event.current.type; if (Event.current.button != 0) { eventType = EventType.Ignore; } switch (eventType) { case EventType.MouseUp: List <Transform> selectedObjs = selection.GetSelection(); if (selectedObjs.Count == 1) { Transform transform = selectedObjs[0]; if (IsInGridBounds(transform.position)) { transform.position = SnapToGrid(transform.position); } } break; default: break; } }
public bool IsMeasureObjEnabled() { return(selection.GetSelection().Count == 2); }