Class CoherenceSyncInstantiator
[DisplayName("DestroyCoherenceSync", "Instances of this prefab will be instantiated normally, but only the CoherenceSync component will be destroyed or disabled.Use it when you want to keep the GameObject to be reused or destroyed manually.")]
public class CoherenceSyncInstantiator : INetworkObjectInstantiator
- Inheritance
-
CoherenceSyncInstantiator
- Implements
Constructors
CoherenceSyncInstantiator()
public CoherenceSyncInstantiator()
Methods
Destroy(ICoherenceSync)
Called when coherence needs to destroy a prefab instance, when the related network entity is destroyed.
public void Destroy(ICoherenceSync obj)
Parameters
obj
ICoherenceSync
Instantiate(CoherenceBridge, ICoherenceSync, Vector3, Quaternion)
Called when coherence needs to instantiate a CoherenceSync prefab, to link it to a new network entity.
public ICoherenceSync Instantiate(CoherenceBridge bridge, ICoherenceSync prefab, Vector3 position, Quaternion rotation)
Parameters
bridge
CoherenceBridgeprefab
ICoherenceSyncposition
Vector3rotation
Quaternion
Returns
OnApplicationQuit()
Called when the application exits.
public void OnApplicationQuit()
OnUniqueObjectReplaced(ICoherenceSync)
Called when a unique object instance was replaced.
public void OnUniqueObjectReplaced(ICoherenceSync instance)
Parameters
instance
ICoherenceSync
WarmUpInstantiator(CoherenceBridge, CoherenceSyncConfig, INetworkObjectProvider)
Called from the Start method of a given CoherenceBridge instance. The related Provider is also given to be able to load the Object if you wish to do so. Consider deactivating the prefab before instantiating it if you wish to initiate an Object Pool.
public void WarmUpInstantiator(CoherenceBridge bridge, CoherenceSyncConfig config, INetworkObjectProvider assetLoader)
Parameters
bridge
CoherenceBridgeconfig
CoherenceSyncConfigassetLoader
INetworkObjectProvider