Table of Contents

Class CoherenceSyncConfigRegistry

Namespace
Coherence.Toolkit
Assembly
Coherence.Toolkit.dll

Holds references to CoherenceSyncConfigs. Network entities known to coherence are registered as part of it.

public sealed class CoherenceSyncConfigRegistry : PreloadedSingleton<CoherenceSyncConfigRegistry>
Inheritance
CoherenceSyncConfigRegistry
Inherited Members

Remarks

While on the Editor, registered entries are loaded and serialized on memory but not serialized to disk. This means CoherenceSyncConfigRegistry assets should not show changes on disk when it comes to the network entities being tracked.

When building, an internal implementation of UnityEditor.Build.IPreprocessBuildWithReport serializes the changes to disk.

Once the build is completed, an internal implementation of UnityEditor.Build.IPostprocessBuildWithReport clears the changes previously made to the file.

This post-processing might update the file's modification date.

Constructors

CoherenceSyncConfigRegistry()

public CoherenceSyncConfigRegistry()

Properties

Count

The number of CoherenceSyncConfigs registered.

public int Count { get; }

Property Value

int

Methods

GetAt(int)

Gets the CoherenceSyncConfig registered at the specified index.

public CoherenceSyncConfig GetAt(int index)

Parameters

index int

The zero-based index of the element to get.

Returns

CoherenceSyncConfig

Exceptions

ArgumentOutOfRangeException

index is less than 0

-or-

index is equal or greater than Count

GetEnumerator()

public List<CoherenceSyncConfig>.Enumerator GetEnumerator()

Returns

List<CoherenceSyncConfig>.Enumerator

Returns an enumerator that iterates through the collection of registered CoherenceSyncConfigs.

OnEnable()

This method can destroy the object, e.g, when creating a duplicate of the asset.

protected override void OnEnable()

TryGetFromAssetId(string, out CoherenceSyncConfig)

Gets the CoherenceSyncConfig associated with the specified identifier.

public bool TryGetFromAssetId(string assetId, out CoherenceSyncConfig config)

Parameters

assetId string

The ID of the CoherenceSyncConfig to retrieve.

config CoherenceSyncConfig

When this method returns, contains the CoherenceSyncConfig identified with the specified assetId, if registered; otherwise, the default value for CoherenceSyncConfig. This parameter is passed uninitialized.

Returns

bool

true if assetId is registered in the CoherenceSyncConfigRegistry.