Samples Overview

The Runtime Spawner package ships with several sample scenes and scripts that demonstrate how to use the system in different contexts - from single-player setups to networked multiplayer via Photon Fusion or Photon PUN 2+.

These samples are designed to be self-contained learning modules, showing real-world use cases for the spawner, region logic, and encounter systems.


Base Sample: Runtime Spawner Sample

Path: Assets/Samples/Runtime Spawner/<version>/Runtime Spawner Sample/

Purpose: Core single-player demonstration of all major Runtime Spawner systems and workflows.

Includes:

  • Example code and prefab setup

  • Example Spawn Profiles and GameData assets

  • A suite of scenes showing common use cases

Scenes Included

Scene
Description

1. Global Spawner

Demonstrates the simplest global-level spawner setup.

2. Local Area Spawner (Biome)

Shows regional control, density, and tile-level variation.

3. Wave Spawner

Demonstrates timed and event-driven wave spawning logic.

4. Combined Example

Mixes global, regional, and wave spawning in one scene.

5. API Example – Manual Start

Shows how to control spawners fully through script.

6. Directed Ambient Spawner

Example of environment or ambient population systems.

7. Special Encounters

Demonstrates the Special Encounter Manager and rule-driven spawning.

8. Spawn Hints

Demonstrates the Spawn Hints system (authored anchor-based spawning).

All base scenes use local pooling and deterministic seeding for reproducible runs.


Fusion Networking Sample

Path: Assets/Samples/Runtime Spawner/<version>/Runtime Spawner Fusion Sample/

Scene: FusionSample.unity

Purpose: Demonstrates full integration between the Runtime Spawner and Photon Fusion 2.x. Shows how to spawn and replicate networked objects using the Fusion factory and pool provider.

Includes:

  • FusionBootstrap script (sets up the NetworkRunner)

  • FusionFactoryAsset and FusionPoolObjectProvider

  • Networked player prefab

  • “Fusion Integration Setup Guide” documentation inside the folder

Use this to: Test multiplayer spawning where the host runs the spawner, and all clients receive synchronized results.

Prerequisites:

  • Photon Fusion 2.x installed

  • Fusion CodeGen run for all network assemblies


PUN 2+ Networking Sample

Path: Assets/Samples/Runtime Spawner/<version>/Runtime Spawner PUN Sample/

Scene: PUNSample.unity

Purpose: Demonstrates Runtime Spawner integration with Photon PUN 2 or PUN 2+. Uses the PUNFactoryAsset and PUNPoolPrefabProvider for pooling and prefab registration.

Includes:

  • PunBootstrap (connects to Photon Cloud, manages room flow)

  • Player prefab with PhotonView

  • Optional Cinemachine setup for player camera

  • PUNPrefabKey component example

Use this to: See how Runtime Spawner runs exclusively on the Master Client and automatically reassigns when master changes.

Prerequisites:

  • Photon PUN 2 or PUN 2+ installed

  • Base Runtime Spawner Sample imported


Sample Folder Layout

All samples follow a common structure:

Code/        – Example scripts (controllers, AI, networking)
Content/     – Materials, prototype textures, shared assets
GameData/    – SpawnEntry profiles and configuration assets
Prefabs/     – Player, AI, and environment prefabs
Scenes/      – Scene files demonstrating specific systems

  1. Start with the Base Sample

    • Learn how the Runtime Spawner works in isolation.

    • Test Global, Local, Wave, and Special Encounter logic.

  2. Explore Spawn Hints and NavMesh Placement

    • Understand authored hint anchors and placement policies.

  3. Move to Networking Samples

    • Choose Fusion or PUN depending on your multiplayer stack.

    • Study how the factory and pool providers integrate with networked prefabs.


Next Steps

Last updated