Table of Contents

TryConvertToCoherenceSyncPrefab

Methods
public static bool TryConvertToCoherenceSyncPrefab(GameObject gameObject, string prefabPath, out GameObject prefab, InteractionMode interactionMode = 1)

Adds a CoherenceSync component and converts a GameObject into a Prefab. Prefabs using CoherenceSync are ready to be networked by coherence.

Parameters
Type Name Description
GameObject gameObject

GameObject to convert into a Prefab.

string prefabPath

Path where the Prefab Asset will be written on disk.

GameObject prefab

Reference to the Prefab Asset.

InteractionMode interactionMode

Indicates whether the user should be prompted for confirmation or performed automatically.

Returns
Type Description
bool

true if the Prefab Asset gets created; false otherwise.