CodeGenerator: Compile-Time Method and Property Wrapping via Attributes
The attribute in s&box lets you create custom attributes that wrap methods and properties at compile time. This is the mechanism behind properties and — you can…
Code Upgrader Diagnostics: SBOX001-SBOX007 and SB3000 Roslyn Analyzer Warnings
Code Upgrader Diagnostics: s&box Roslyn Analyzer Warnings s&box ships a Roslyn analyzer () that warns about deprecated patterns and auto-fixes them. These appea…
GameObject.Clone: Two-Pass Cloning, CloneConfig, NotCloned Flag, and Reference Rewiring
GameObject.Clone: Spawning Prefabs and Cloning GameObjects with CloneConfig is the primary way to instantiate prefabs and duplicate GameObjects in s&box. It per…
s&box JSONObject Save Data Helper for Components
This s&box-focused sample shows how to programmatically construct and deconstruct JSON for component save data. It is useful for player saves, world unlock stat…
Binary Serialization: BlobData for Large GameResource Data Storage
When JSON files grow too large in s&box, you can store data as a binary blob using the class. This works with GameResource assets and provides custom serializat…
Application Context Flags: IsDedicatedServer, IsHeadless, IsEditor, IsVR — Runtime Context in s&box
Application Context Flags: IsDedicatedServer, IsHeadless, IsEditor, IsVR is a static class in s&box that exposes runtime context flags. These are set at startup…
Prefabs: Reusable GameObjects with Runtime Spawning via Clone
A prefab is a GameObject that can be used in multiple places — across scenes or instantiated at runtime. Assets Prefabs are saved as PrefabFile assets. To creat…
s&box ICookieSource: Cookie persistence interface
ICookieSource API Reference ICookieSource is an interface for components that want to save their properties as cookies (persistent user preferences stored in Ga…
Prefab Templates: Adding Custom Prefabs to the s&box Create Menu
s&box Prefab Templates let you add custom prefabs to the GameObject Create menu in the scene editor. Setup Enable "Show In Menu" on a Prefab File in the inspect…
DynamiteEntity Explosive Entity Pattern
DynamiteEntity - Simple Explosive Entity A simple explosive entity that can be triggered via damage or player input. Demonstrates , , and prefab cloning pattern…
s&box ISceneEvent: Scene-Wide and Per-Object Event Broadcasting
s&box ISceneEvent<T>: Scene-Wide and Per-Object Event Broadcasting is the base interface for all scene event systems. It provides static methods for broadcastin…
LinkedGameObjectBuilder for Finding Connected Objects
LinkedGameObjectBuilder Utility class for building a set of connected GameObjects by traversing physics joints, constraints, and manual links. Class Definition …
Randomized Clothing for NPC Citizens using Dresser.Randomize() on Prefabs
Overview This demonstrates how to create NPC citizen prefabs with randomized clothing using the built-in component. Each time the prefab spawns or is enabled, i…
ActionGraph - Visual Scripting System
ActionGraph - Visual Scripting System Create game logic using node-based visual scripting without writing code. Overview ActionGraph lets you: Build gameplay lo…
s&box ResourceLibrary: Loading and Accessing Game Resources
s&box ResourceLibrary: Loading and Accessing Game Resources (and ) provides access to all loaded resources. Loading Resources ```csharp // Synchronous get (retu…
s&box Game Static Class: Core Game State and Operations
s&box Game Static Class: Core Game State and Operations The static class provides global access to core game state, utilities, and operations. Scene Management …
GameObjectSystem — scene-wide systems with stage-ordered execution and static access
GameObjectSystem — Scene-Wide Systems is a base class for scene-level systems that need to run at specific points in the frame — before or after physics, render…
NetworkHelper — quick multiplayer setup with auto-server and player spawning
NetworkHelper — Quick Multiplayer Setup is a built-in s&box component that handles the boilerplate of starting a server and spawning players. It's the fastest w…
ActionGraph — visual scripting with action nodes, delegates, and C# integration
ActionGraph — Visual Scripting ActionGraph is s&box's visual scripting system. Nodes represent actions or expressions, and links carry values or signals between…
CameraNoiseSystem example: Camera effects
CameraNoiseSystem Example: Camera Effects CameraNoiseSystem is a GameObjectSystem that applies temporary camera effects (shake, noise, etc.) by implementing ICa…