Skip to main content

PrefabNameMap

A class in Root.Township, Alta.Networking.

Global settings asset that maps prefab hashes to their asset paths. Get it with PrefabNameMap.Instance.

Constructors​

MemberWhat it is
PrefabNameMap()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

4 private and internal fields
MemberWhat it is
private uint[] hashesPrefab hashes, matched by index with paths.
private Dictionary<uint, string> mapBacking field for Map.
private string[] pathsPrefab asset paths, matched by index with hashes.
private bool setupEditor button that refreshes the map for a build.

Properties​

MemberWhat it is
Dictionary<uint, string> Map { get; }Prefab hash to asset path, built when the asset loads.

Methods​

2 private and internal methods
MemberWhat it is
private void UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()Builds Map from the hashes and paths arrays.
private void UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize()Does nothing.