|
Runtime Spawner 1.5.1
Generic Runtime spawn and instance pooling system for spawning random AI agents around a map. Works with ANY AI system easily.
|
Immutable data package describing a single spawn operation. More...
Public Member Functions | |
| SpawnRequest (SpawnEntry entry, SpawnContext context, GameObject prefab, Vector3 position, Quaternion rotation, Transform parent=null, bool serverAuthoritative=true, bool predicted=false, object owner=null, IReadOnlyDictionary< string, object > metadata=null) | |
| Constructs a new SpawnRequest. | |
Public Attributes | |
| readonly SpawnEntry | Entry |
The spawn entry that defined this request (usually from a SpawnProfile or pool). | |
| readonly SpawnContext | Context |
| Contextual information describing where and why this spawn was requested (e.g., mission, biome, runtime layer). | |
| readonly GameObject | Prefab |
| The prefab to instantiate. This is already resolved by the spawner or executor before being passed to the factory. | |
| readonly Vector3 | Position |
| The world-space position at which to spawn the instance. | |
| readonly Quaternion | Rotation |
| The world-space rotation to apply to the instance. | |
| readonly Transform | Parent |
| Optional transform to parent the spawned instance under. | |
| readonly bool | ServerAuthoritative |
| Indicates that the authoritative simulation (e.g., server or host) should own this spawn. Used primarily by network adapters. | |
| readonly bool | Predicted |
| Whether this spawn was predicted client-side before authoritative confirmation. Adapters that support rollback/prediction can use this to adjust behavior. | |
| readonly object | Owner |
Optional owner reference (such as a PlayerRef or NetworkIdentity) to assign authority over the spawned instance. | |
| readonly IReadOnlyDictionary< string, object > | Metadata |
| Optional arbitrary metadata for factories or post-spawn systems to consume. For example, tags, custom spawn parameters, or serialized state. | |
Immutable data package describing a single spawn operation.
A SpawnRequest is created by the RuntimeSpawner when it is ready to spawn a resolved prefab. The request is passed to an IObjectFactory, which performs the actual instantiation, pooling lookup, or networked spawn, depending on the adapter in use.
The struct contains both contextual information (Entry and Context) and runtime-specific parameters such as position, rotation, and optional ownership or metadata.
Because this type is a readonly struct, it is always passed by value and cannot be modified after construction.
| MegaCrush.Spawner.SpawnRequest.SpawnRequest | ( | SpawnEntry | entry, |
| SpawnContext | context, | ||
| GameObject | prefab, | ||
| Vector3 | position, | ||
| Quaternion | rotation, | ||
| Transform | parent = null, | ||
| bool | serverAuthoritative = true, | ||
| bool | predicted = false, | ||
| object | owner = null, | ||
| IReadOnlyDictionary< string, object > | metadata = null ) |
Constructs a new SpawnRequest.
| entry | The originating SpawnEntry definition. |
| context | The contextual information for this spawn operation. |
| prefab | The prefab to instantiate (already resolved by the executor). |
| position | World-space position for the instance. |
| rotation | World-space rotation for the instance. |
| parent | Optional parent transform for the spawned object. |
| serverAuthoritative | If true, the authoritative simulation (e.g., host/server) should perform the spawn. |
| predicted | If true, indicates this spawn was predicted client-side and may later be reconciled. |
| owner | Optional owner reference for authority or bookkeeping (adapter-specific). |
| metadata | Optional key/value metadata payload for additional parameters. |
| readonly SpawnContext MegaCrush.Spawner.SpawnRequest.Context |
Contextual information describing where and why this spawn was requested (e.g., mission, biome, runtime layer).
| readonly SpawnEntry MegaCrush.Spawner.SpawnRequest.Entry |
The spawn entry that defined this request (usually from a SpawnProfile or pool).
| readonly IReadOnlyDictionary<string, object> MegaCrush.Spawner.SpawnRequest.Metadata |
Optional arbitrary metadata for factories or post-spawn systems to consume. For example, tags, custom spawn parameters, or serialized state.
| readonly object MegaCrush.Spawner.SpawnRequest.Owner |
Optional owner reference (such as a PlayerRef or NetworkIdentity) to assign authority over the spawned instance.
| readonly Transform MegaCrush.Spawner.SpawnRequest.Parent |
Optional transform to parent the spawned instance under.
| readonly Vector3 MegaCrush.Spawner.SpawnRequest.Position |
The world-space position at which to spawn the instance.
| readonly bool MegaCrush.Spawner.SpawnRequest.Predicted |
Whether this spawn was predicted client-side before authoritative confirmation. Adapters that support rollback/prediction can use this to adjust behavior.
| readonly GameObject MegaCrush.Spawner.SpawnRequest.Prefab |
The prefab to instantiate. This is already resolved by the spawner or executor before being passed to the factory.
| readonly Quaternion MegaCrush.Spawner.SpawnRequest.Rotation |
The world-space rotation to apply to the instance.
| readonly bool MegaCrush.Spawner.SpawnRequest.ServerAuthoritative |
Indicates that the authoritative simulation (e.g., server or host) should own this spawn. Used primarily by network adapters.