Installing Samples

This sample contains shared assets, prefabs, and configuration data used by the networked examples. The Fusion and PUN samples depend on this content to run correctly.


1. How to Install Samples

  1. Open Window → Package Manager.

  2. Select Runtime Spawner from your list of packages.

  3. Switch to the Samples tab.

  4. Click Import beside the samples you want.

Once imported, Unity creates:

Assets/Samples/Runtime Spawner/<version>/

Each sample installs to its own subfolder.


2. Available Samples

Runtime Spawner Sample (Base)

Folder: Runtime Spawner Sample/ Size: ~20 MB

Purpose: Core single-player example demonstrating the basic Runtime Spawner workflow.

Includes:

  • Several demo scenes showcasing the various use cases (global, local, wave etc)

  • Player and AI prefabs

  • Example spawn entries and profiles

  • Diagnostics HUD and helper UI

  • Example character controller and AI logic

Use this sample to:

  • Learn how the spawner initializes, populates, and despawns entities.

  • Test NavMesh placement, spawn hints, and region population locally.

  • Use it as the foundation for your own experiments or integrations.


Runtime Spawner Fusion Sample

Folder: Runtime Spawner Fusion Sample/ Size: ~210 KB

Purpose: Shows how to integrate the Runtime Spawner with Photon Fusion 2.x networking.

Prerequisites:

  • Photon Fusion 2.0 (installed via the Fusion SDK or Asset Store)

  • Runtime Spawner 1.5.0+

  • Fusion CodeGen enabled and run at least once

Includes:

  • FusionBootstrap setup script (creates a NetworkRunner)

  • FusionFactoryAsset and FusionPoolObjectProvider

  • Example networked player prefab

  • Minimal demo UI for starting as host/client

Use this sample to:

  • Understand how to bridge Fusion’s networking with the Runtime Spawner.

  • See how the host controls spawning while clients receive replicated objects.

  • Study pooling and lifecycle management through Fusion’s IPoolAdapter bridge.


Runtime Spawner PUN 2+ Sample

Folder: Runtime Spawner PUN Sample/ Size: ~220 KB

Purpose: Demonstrates integration with Photon PUN 2 or PUN 2+ networking.

Prerequisites:

  • Photon PUN 2 or PUN 2+ (imported from the Asset Store)

  • Runtime Spawner 1.5.0+

  • Megacrush Object Pool (installed automatically with Runtime Spawner)

Includes:

  • PunBootstrap component (connects to Photon Cloud, joins/creates room)

  • PUNFactoryAsset and PUNPoolPrefabProvider

  • Example networked player prefab with PhotonView

  • PUNPrefabKey helper component for prefab registration

Use this sample to:

  • Observe how spawning runs only on the Master Client while others replicate.

  • Learn prefab registration via the provider and use of pooling for performance.

  • Extend or replace PunBootstrap for your own PUN game flow.


3. Folder Structure

All samples share a consistent folder layout:

Code/        – Example scripts (controllers, AI, networking)
Content/     – Materials and prototype textures
GameData/    – Example SpawnEntry profiles
Prefabs/     – Player, AI, and environment prefabs
Scenes/      – Sample scenes for each mode

You can copy or adapt these assets directly in your own project.


4. TextMesh Pro Essentials

When first opening a sample scene, Unity may prompt you to import TextMesh Pro Essentials. This is required for the demo UI to function. Click Import TMP Essentials when prompted.


5. Getting Started

  1. Import the Runtime Spawner Sample (base).

  2. Then optionally import Fusion or PUN samples, depending on your project.

  3. Open a demo scene (for example, RuntimeSpawner_Fusion_Demo.unity).

  4. Press Play to watch the spawner initialize and populate.

  5. (Networking samples) Run a second instance to join as a client and observe replication.


Next Steps

Last updated