Interfaces

The INetworkScriptableFactory interface hierarchy extends the IScriptableFactory interfaces with network spawning capabilities. Three levels of interface progressively add: network identity, network spawning, and data-driven variant network spawning.

Architecture

spinner

Interface Tiers

Tier
Interface
Extends
Adds

Identity

IScriptableFactory

GlobalObjectIdHash for Netcode prefab identification

Spawning

IScriptableFactory<TObject> + INetworkScriptableFactory

NetworkSpawn() with ownership and prediction support

Data

IScriptableFactory<TObject, TData> + INetworkScriptableFactory<TObject>

Variant-aware NetworkSpawn() with variant ID

circle-info

Each network interface inherits from both the corresponding IScriptableFactory tier and the network tier above it, forming a diamond inheritance pattern. This ensures a network factory can be used anywhere a regular IScriptableFactory is expected.

Spawn vs NetworkSpawn

Method
Source
Authority
Replication

Spawn()

IScriptableFactory<TObject>

Local only

None — object exists only on the calling machine

NetworkSpawn()

INetworkScriptableFactory<TObject>

Server-authoritative

Netcode replicates to all connected clients

circle-exclamation

Interfaces

Interface
Description

Base network factory contract — adds GlobalObjectIdHash

Adds NetworkSpawn() with ownership and prediction

Adds variant-aware NetworkSpawn() with variant ID

See Also

Last updated