synchronization
Swift declaration@MainActor @preconcurrency var synchronization: SynchronizationComponent? { get set }The entity’s synchronization component.
protocol · iOS 13.0+ · SDK 27.1
@MainActor @preconcurrency protocol HasSynchronization : EntityAn interface that enables an entity to be synchronized between processes and networked applications. All entities automatically adopt this protocol because the ``Entity`` base class does. This adoption gives all entities a ``SynchronizationComponent`` instance, and a collection of methods for manipulating the component, that you use to manage ownership of the entity.
@MainActor @preconcurrency var synchronization: SynchronizationComponent? { get set }The entity’s synchronization component.
@MainActor @preconcurrency var synchronization: SynchronizationComponent? { get set }The entity’s synchronization component.
@MainActor @preconcurrency func requestOwnership(timeout: TimeInterval = 15, _ callback: @escaping (SynchronizationComponent.OwnershipTransferCompletionResult) -> Void)Requests ownership of the entity. Requesting ownership isn’t guaranteed to succeed. - Parameters: - timeout: A time in seconds to wait before giving up. - callback: A closure that the method calls when the request completes or times out.
@MainActor @preconcurrency func withUnsynchronized(_ changes: () -> Void)Calls the given closure in a way such that component changes that the closure makes don’t trigger synchronization. Use this method to make local changes that don’t affect remote peers, like aligning a billboard component to face the local camera. Using this method doesn’t permanently prevent changes from being synchronized. If you modify the same components immediately before the call to ``HasSynchronization/withUnsynchronized(_:)``, or anytime afterward, the changes are synchronized. If the local peer doesn’t own the associated entity, changes that the remote owner makes continue to synchronize, overwriting local, unsynchronized changes. - Parameters: - changes: A closure that the method calls while suppressing synchronization triggers.
@MainActor @preconcurrency var isOwner: Bool { get }A Boolean that indicates whether the calling process owns the entity. The calling process owns the entity if the value is `true`.
No declarations were skipped in this snapshot.