# Technical Details

### Technical Details

Runtime Spawner 2.0 is built as a **modular, package-based system** using Unity’s Package Manager (UPM).

***

### Unity Version

Runtime Spawner 2.0 is built and tested with:

* **Unity 2022.3 LTS and newer**

It may work on earlier versions, but compatibility is not guaranteed - particularly for:

* AI Navigation (Nav Mesh)
* Editor tooling and UI

If you are targeting an older Unity version, please contact support.

***

### Package Structure

Runtime Spawner 2.0 is no longer a single package.

It is split into multiple **independent UPM packages**, allowing you to include only what your project needs.

#### Core Packages

* `com.megacrush.runtimespawner.core`\
  Core spawning systems and execution pipeline
* `com.megacrush.runtimespawner.shared`\
  Shared utilities and editor tooling

***

#### Addon Packages

* `com.megacrush.spawner.global`
* `com.megacrush.spawner.localarea`
* `com.megacrush.spawner.waves`
* `com.megacrush.spawner.spawnpoints`
* `com.megacrush.spawner.specialencounters`

Each addon provides a specific spawning behavior and depends on the Core package.

***

#### Networking Packages

* `com.megacrush.runtimespawner.networking` (shared abstractions)
* `com.megacrush.spawner.networking.pun`
* `com.megacrush.spawner.networking.fusion`

Addon-specific networking bridges are also provided (e.g. Waves, Local Area).

***

#### Object Pooling

Runtime Spawner uses a separate package for pooling:

* `com.megacrush.objectpool`

This is used by default factories and can be replaced if needed.

***

### Dependencies

#### Core Runtime

The Core package has **no required external dependencies** beyond Unity itself.

***

#### Sample Content

Sample scenes may depend on Unity packages such as:

* AI Navigation
* TextMeshPro

These are installed automatically when importing samples.

If you remove the samples, these dependencies can also be removed.

***

#### Networking (Optional)

Networking support requires installing the corresponding third-party SDK:

* Photon PUN 2+
* Photon Fusion 2.x

These are **not included** with Runtime Spawner and must be installed separately.

***

### Scripting Defines

Runtime Spawner uses compile-time defines to enable integrations:

* `PUN_2_OR_NEWER` → enables PUN integration
* `FUSION_WEAVER` → enables Fusion integration

These are typically set automatically when the corresponding packages are installed.

***

### Profiling

To enable profiling markers:

* Add the following scripting define:

```
ENABLE_PROFILER
```

Location:

* **Edit → Project Settings → Player → Scripting Define Symbols**

This enables additional runtime profiling hooks for debugging and performance analysis.

***

### Extensibility

Runtime Spawner is designed to be extended:

* Custom object factories (replace pooling or networking)
* Custom addons (define new spawning behavior)
* Custom prefab sources
* Alternative navigation or placement systems

The system does not require Nav Mesh specifically and can be adapted to other solutions.

***

### Notes

* Core functionality does not depend on networking or addons
* Addons can be used independently or combined
* Networking is fully optional and layered on top of Core


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://megacrush.gitbook.io/megacrush-unity-assets/runtime-spawner/runtime-spawner-user-manual/technical-details.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
