Nebula
Core

NetworkPrefabs

Prefab id table shared by every process.

generated from the sources
public static class NetworkPrefabs

Prefab id table shared by every process. Ids are the index in NebulaConfig.NetworkPrefabs. Ids from BuiltInBase up are reserved for prefabs Nebula itself provides (such as the entity behind Nebula.World.ChunkState): every process builds them the same way, so a game never lists them and they never shift when the game's list changes.

Fields

BuiltInBase

public const ushort BuiltInBase = 0xFF00;

First id reserved for Nebula's built-in prefabs. A game's list is never this long.

ChunkStatePrefabId

public const ushort ChunkStatePrefabId = BuiltInBase;

The built-in prefab of Nebula.World.ChunkStateEntity.

Properties

Count

public static int Count { get; }

Methods

IsBuiltIn

public static bool IsBuiltIn(ushort prefabId);

Whether prefabId is one of Nebula's built-in prefabs rather than an entry of the game's list.

Register

public static void Register(IList<GameObject> prefabs);

Get

public static GameObject Get(ushort prefabId);

The prefab registered under prefabId, a built-in one included; null when there is none.

TryGetId

public static bool TryGetId(GameObject prefab, out ushort id);

IdOf

public static ushort IdOf(GameObject prefab);

Instantiate

public static NetworkIdentity Instantiate(ushort prefabId, Vector3 position, Quaternion rotation, Transform parent);

Instantiate a network prefab and bind its behaviours. Spawn hooks run when the caller spawns it.

On this page