Grid Navigation
The selector moves on integer grid coordinates(X, Y, Z):
The selector position is displayed in the HUD as
[X, Y, Z].
Selection Modes
No Selection
The selector shows the current grid position. No faces are highlighted.Side Selected
One face of the selector is highlighted. This means a specific block side is selected for element placement.- Achieved by left-clicking on a block face
- The raycast detects which face was clicked
- Only sides belonging to the current section can be selected
Block Selected (Grabbed)
All six faces are highlighted. The block at this position is “grabbed” and can be moved.- Achieved by pressing Space on an existing block
- Press Space again to ungrab
- Moving the selector with WASD/EQ moves the grabbed block
Visual Feedback
The selector uses material properties to show selection state:- Each face has a
_Selectedshader property (0 or 1) - Selected faces render with a distinct color
- The visual updates every frame in
UpdateSelectionColors()
Block Movement
When a block is grabbed:- The selector and block move together
- The editor checks if the destination is empty
- If occupied, the movement is blocked
- On successful move, the block is translated in the block network
- All attached balls and enemies are repositioned
- Illumination is recomputed
Slot Position
The selector’s position is aBlockSlot — a struct containing integer (X, Y, Z) coordinates. The position is converted to world space using BlockSlot.Position for rendering.
Persistence
The selector position is saved between sessions:- Stored in
EditorPersistentState.BlockSelectorPosition - Restored when the editor loads
- Default position:
(0, 0, 0)