Table of Contents

CoherenceSync

class in Coherence.Toolkit
inherits from CoherenceBehaviour

Represents an entity on the network.

Remarks

Add this component to a UnityEngine.GameObject and start networking by adding Bindings.

Check the documentation for tutorials, guides, and more information.

Fields
OnAuthTransferComplete

Called when the authority transfer or abandonment of this entity is completed.

OnAuthorityRequestRejected

Called when authority transfer was requested and rejected.

OnConnectedEntityChanged

Called when the parent of this entity changed.

OnInputAuthority

Called when the entity gains input authority.

OnInputRemote

Called when the entity loses input authority.

OnInputSimulatorConnected

Called when a simulator is connected and ready to handle input state.

OnRigidbody2DPositionUpdate

Called when the Rigidbody2D position is updated.

OnRigidbody2DRotationUpdate

Called when the Rigidbody2D rotation is updated.

OnRigidbody3DPositionUpdate

Called when the Rigidbody position is updated.

OnRigidbody3DRotationUpdate

Called when the Rigidbody rotation is updated.

OnStateAuthority

Called when the entity gains state authority.

OnStateRemote

Called when the entity loses state authority.

RigidbodyUpdateMode

Determines how the properties of an attached rigidbody are updated.

approveAuthorityTransferRequests

Fallback value used when simulationType is set to Request and OnAuthorityRequested is unsubscribed to.

authorityTransferType

How this entity should respond to requests for authority (via RequestAuthority(AuthorityType)) by other clients.

floatingOriginMode

Determines how the floating origin behaves when the entity is not parented.

floatingOriginParentedMode

Determines how the floating origin behaves when the entity is parented.

lifetimeType

What should happen to this entity after the client with authority over it disconnects or abandons it.

orphanedBehavior

How this entity should behave if it is abandoned by its client.

simulationType

How and where this entity is simulated.

uniquenessType

Determines if it should be enforced that only a single instance with the same unique can exist at the same time on the network.

usingReflection

Whether this entity should rely on reflection mode or baked mode.

Properties
Bindings

List of variables and methods that are synchronized over the network.

CoherenceBridge

The CoherenceBridge that this entity is connecting through.

CoherenceSyncConfig

The config that's linked to this entity.

CoherenceTag

The tag used to filter by via CoherenceTagQuery.

ConnectedEntity

The closest parent entity (with CoherenceSync) above this entity in the transform hierarchy.

Please note that this is not always the direct parent of this entity's transform, e.g. when using CoherenceNode.

EntityState

Holds information for the state of the entity.

HasInput

true if the entity has a CoherenceInput component.

HasInputAuthority

true if your client has input authority over the entity.

HasNodePathChanged

true when path changes.

HasParentWithCoherenceSync

true when this entity is connected or parented to another entity.

HasStateAuthority

true if your client has state authority over the entity.

Input

Input component on this entity, if any.

InterpolationLocationConfig

Determines the loop in which the interpolation will be performed.

IsOrphaned

true when no client has authority over the entity.

IsPersistent

true if the lifetime is Persistent.

IsSynchronizedWithNetwork

true if the network acknowledges this entity (it's synchronized).

IsUnique

true when uniquenessType is NoDuplicates.

ManualUniqueId

The unique identifier of this entity.

OnFloatingOriginShifted

Called when the floating origin has changed position.

ReplacementStrategy

How uniqueness is resolved when multiple instances of the entity exists.

UnsyncedEntityPriority

When resolving uniqueness, whether the asset ID or the uniqueness ID should be taken into account.

UsesLODsAtRuntime

true if the entity use LODs at runtime.

Methods
AbandonAuthority

Transfers ownership of the game object to the replication server, making it an orphan.

Adopt

Requests authority over an orphaned entity.

GetBakedValueBinding

Returns the binding with matching type and name or null if no match exist. If no name is supplied, the first binding with matching type is returned. If multiple matches exist, the first binding in the Bindings list is returned.

RegisterUniqueId

Registers a unique identifier to be later applied by CoherenceSync.

RequestAuthority

Try to get authority over this entity.

ResetInterpolation

Clear all state of the interpolation used on the synced variables and properties of this entity.

SendCommand

Send a command to another client to call a method in a specific component, if you have more than one component method bound in the same hierarchy.

SendCommandToChildren

Send a command to another client to call a method to every component in the hierarchy that has methodName bound.

TransferAuthority

Give away authority over this entity to another client.

TryGetBinding

Get the first binding on the component of a specific type.

Events
BridgeResolve

Used to resolve which CoherenceBridge should be associated with this entity.

ConnectedEntityChangeOverride

Used to override the default parenting behaviour.

DidSendConnectedEntity

Called after the entity has changed its parent and sent this update to other clients.

OnAuthorityRequested

Raised when other client requests an authority over this entity and the authorityTransferType is set to Request.