Skip to content

API Reference

Namespace:

using PixitGames.SpaceStationSurvival;

This page highlights the main integration surface. Inspect the XML summaries and supplied builders for complete setup examples.

Construction

GridPlacementController

Central input-independent placement service.

Key responsibilities:

  • catalog selection;
  • preview creation and updates;
  • story and rotation state;
  • placement validation;
  • placement/removal;
  • clearing runtime construction.

Use Configure(StationRoomGrid, ConstructionCatalog, Transform) for procedural scenes. UI and input adapters should call its public methods rather than duplicating validation.

ConstructionPieceDefinition

Scriptable definition for one build command.

Important properties include Id, DisplayName, Icon, Category, Kind, Prefab, BoundaryKind, BlocksCell, FootprintSize, AllowRotation, RequiresEnclosedRoom, PositionOffset, and RotationOffset.

GetRotatedFootprint(int quarterTurns) returns normalized X/Z dimensions.

ConstructionCatalog

Ordered collection used by menus, hotkeys, save resolution, and custom build systems.

ConstructionPieceDefinition piece = catalog.Get(index);
ConstructionPieceDefinition savedPiece = catalog.FindById(stableId);

RuntimePlacementInput

Optional legacy mouse/keyboard adapter. Use SetInteractionEnabled and SetDemolishMode, or replace it with another input layer.

Grid and rooms

StationRoomGrid

Owns cell, room, boundary, wall-attachment, and occupancy lookup.

Common methods:

RoomModule room = grid.GetRoomAt(coordinate);
bool floorExists = grid.HasCell(coordinate);
bool edgeExists = grid.HasBoundary(coordinate, direction);
Vector3Int cell = grid.WorldToGrid(worldPosition);
Vector3 center = grid.GridToLocalCenter(cell);
Vector3 grounded = grid.ProjectToFloor(worldPosition);
grid.RebuildDetectedRooms();

TryGetRandomPoint supplies in-room wandering destinations. TryFindWorkerPath creates wall-aware floor-cell waypoints.

Subscribe to RoomsRebuilt when a system needs refreshed generated-room references.

RoomModule

Room aggregate for semantic content, classification, local atmosphere, resource rates, operational state, and placeable registration.

Important read-only data:

  • identity, type, and level;
  • oxygen, pressure, and temperature;
  • power figures and HasPower;
  • OperationalState;
  • Placeables and TagScores.

Use RegisterPlaceable, UnregisterPlaceable, or StationPlaceable.AssignToRoom when integrating a custom placement system.

Events include room type, oxygen, pressure, power, and operational-state changes.

RoomTypeDefinition

Data asset containing stable ID, display name, classification priority, required tag scores, optional tags, and room-level rules.

RoomTagDefinition

Reference-based semantic tag. Tags are assets rather than a closed enum, so projects can add concepts without modifying runtime code.

StationObjectDefinition

Semantic and simulation data contributed by a placeable: room tags, production, consumption, storage, crew capacity, comfort, research, medical, durability, and related values.

Resources and atmosphere

StationResourceGrid

Aggregates station-wide power and headline oxygen rates. Use SetGridEnabled, RegisterCrew, UnregisterCrew, and RebuildTotals for integrations.

Read PowerProduction, PowerConsumption, PowerBalance, OxygenProduction, OxygenConsumption, OxygenBalance, and HasPower.

StationAtmosphereNetwork

Registers AtmosphereVent components and equalizes connected room oxygen and pressure on simulation ticks.

AtmosphereVent

Powered wall attachment with SetEnabled and TryGetRooms. CanTransfer reports current functional availability.

StationDevice

Composable device availability and operational-state component. Device requirements such as WorkerRequirement determine functional availability independently from room identity.

Crew

StationWorkerManager

Spawns workers from qualifying Crew Quarters and exposes assignment operations.

bool assigned = manager.TryAssignFirstAvailableWorker(room);
int assignedCount = manager.GetAssignedWorkerCount(room);
bool canAssign = manager.CanAssignWorker(room);
manager.ClearWorkers();

Workers exposes the current read-only list.

StationWorker

Lightweight worker lifecycle: idle, wandering, moving to work, working, moving to sleep, and sleeping.

Use AssignWork, ClearWorkAssignment, GoToSleep, and WakeUp for custom job systems. Home, work, current slot, state, and vitals are exposed as read-only properties.

CrewVitals

Tracks health, personal oxygen, needs, fatigue, and current room. Use AssignToRoom, ConfigureOxygenRates, and ChangeFatigue for custom simulation integration.

StationInteractionSlot

Reservable model-independent interaction pose. TryReserve, Enter, and Release coordinate workers safely.

WorkerRequirement

Device requirement that counts assigned and active workers. Production becomes functional only when IsSatisfied is true.

Camera and save

ConstructionCameraController

Input-independent RTS camera with Pan, Rotate, Zoom, SetFocus, and FrameStation.

ConstructionSaveSystem

Versioned construction slots.

saveSystem.Save(slot);
saveSystem.Load(slot);
saveSystem.Delete(slot);
bool exists = saveSystem.HasSave(slot);
string summary = saveSystem.GetSlotSummary(slot);

Listen to StatusChanged and SlotsChanged to drive a custom interface.

Simulation registration

StationSimulation dispatches ticks to registered ISimulationTickable objects. Package components self-register where appropriate. Custom tick participants can use Register and Unregister while following normal Unity enable/disable lifecycle rules.