Scenes, Prefabs, and Assets
This guide explains how Sendama content is authored and assembled.
The Three Main Content Layers
Most Sendama games are built from three layers:
- scenes that define the playable level or screen
- prefabs that define reusable object templates
- assets such as textures, tile maps, scripts, and events
If you keep those responsibilities separate, projects stay much easier to grow.
Scenes
A scene describes:
- its name
- its width and height
- the environment tile map
- the optional environment collision map
- the hierarchy of objects created when the scene loads
The scene root is editable in the hierarchy and inspector.
Typical scene-level fields are:
NameWidthHeightEnvironment Tile MapEnvironment Collision Map
Use the tile map for visible background art and the collision map for environment blocking data.
Hierarchy And Nesting
Scene objects can now be nested.
Use nesting when you want:
- logical grouping
- relative transforms
- reusable parent objects with attached parts
- cleaner hierarchy organization
Common examples:
- a
Playerwith a childWeapon - an
EnemySpawnerparent with child marker objects - a
HUDroot with grouped UI children
In the editor:
- drag one object onto another to parent it
- drag it onto the scene row to make it a root object again
- drag it onto empty space in the hierarchy to unparent it back to the root
As a rule of thumb, keep scene roots meaningful. Do not leave every object at the top level if it clearly belongs under another object.
Game Objects And UI Elements
The editor currently supports creating:
GameObjectUIElementvariants such asLabelandText
For game objects, the most common editable areas are:
- transform
- renderer
- attached components
For UI elements, the common editable areas are:
- position
- size
- text content
Prefabs
A prefab is a reusable object definition stored as a .prefab.php file under Assets/Prefabs.
Use prefabs when:
- you want to spawn multiple copies of the same object
- you want scene data and runtime spawning to share one source of truth
- you want to pool objects such as bullets, enemies, or pickups
You can create prefabs in several ways:
Assets -> Shift+A -> Prefabsendama generate:prefab <name>- export an existing scene object with
Hierarchy -> Shift+E
Prefab editing happens immediately. It does not wait for Ctrl+S.
Texture And Tile Map Assets
Two of the most important asset types are:
.texturefor sprite art.tmapfor tile map layouts
Use the Sprite tab to edit them.
Typical pattern:
- create a texture
- draw the sprite in the
Spritetab - assign it to an object's renderer
- set the renderer crop rectangle with
OffsetandSize
Renderer and scene paths are typically written as asset-relative paths such as:
Textures/playerTextures/player.textureMaps/levelMaps/level.tmap
Script And Event Assets
Scripts and events are PHP classes that live under the project asset tree.
Use generated scripts for:
- gameplay behaviors
- input handling
- timers
- pooling logic
- collision reactions
Use generated events when you want project-specific event types or event-driven systems.
The editor can generate these files, but the actual PHP logic is still written in code.
Asset Renames And Deletes
Be careful with file operations.
Renaming behavior:
- happens immediately
- preserves file extensions
- can update in-memory scene references
- still needs
Ctrl+Sif you want the updated scene references persisted
Deletion behavior:
- happens immediately after confirmation
- does not automatically repair broken references elsewhere
Suggested Content Workflow
For a new gameplay feature, this sequence works well:
- Create or update a texture.
- Create or update a prefab for the reusable object.
- Attach scripts and set serialized values in the prefab.
- Place the prefab or related objects in a scene.
- Parent objects in the hierarchy where the relationship matters.
- Save the scene.
- Run the game and iterate.
Continue with Scripting and Gameplay for the code side of that workflow.