Table of Contents

Class TeleporterCache

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

ScriptableObject cache for storing all known teleporter destinations. Pre-baked by scanning world scenes for TeleporterDestination components, keyed by stable DestinationID. Must be rebuilt before WorldSceneDetailsCache to ensure teleporter connections are validated.

[CreateAssetMenu(fileName = "TeleporterCache", menuName = "FishMMO/Teleporter Cache")]
public class TeleporterCache : ScriptableObject
Inheritance
Object
ScriptableObject
TeleporterCache
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Fields

CACHE_FILE_NAME

File name of the cache asset.

public const string CACHE_FILE_NAME = "TeleporterCache.asset"

Field Value

string

CACHE_FULL_PATH

Full path to the cache asset file.

public const string CACHE_FULL_PATH = "Assets/Prefabs/Shared/TeleporterCache.asset"

Field Value

string

CACHE_PATH

Path to the folder where the cache asset is stored.

public const string CACHE_PATH = "Assets/Prefabs/Shared/"

Field Value

string

Destinations

Dictionary of all known teleporter destinations, keyed by DestinationID.

public TeleporterCacheDictionary Destinations

Field Value

TeleporterCacheDictionary

Teleporters

Dictionary of all known scene teleporters, keyed by composite "SceneName/TeleporterName".

public SceneTeleporterCacheDictionary Teleporters

Field Value

SceneTeleporterCacheDictionary

Methods

GetOrCreateCache()

Loads the TeleporterCache asset from disk, creating it if it does not exist.

public static TeleporterCache GetOrCreateCache()

Returns

TeleporterCache

The loaded or newly created TeleporterCache asset.

Rebuild()

Rebuilds the teleporter cache by scanning all world scenes for TeleporterDestination components. Returns true if the rebuild completes successfully; false if errors are encountered.

public bool Rebuild()

Returns

bool

True if the rebuild completed successfully; otherwise, false.

RegisterDestination(TeleporterDestination, string)

Registers a TeleporterDestination in the cache. Creates the cache asset if it does not exist. Updates the entry if the DestinationID already exists.

public static void RegisterDestination(TeleporterDestination destination, string sceneName)

Parameters

destination TeleporterDestination

The TeleporterDestination to register.

sceneName string

The name of the scene containing the destination.

UnregisterDestination(string)

Removes a TeleporterDestination from the cache by its DestinationID.

public static void UnregisterDestination(string destinationID)

Parameters

destinationID string

The DestinationID to remove.