OptionalpropertySet: StoragePropertySetOptionalclaimOwnership: booleanOptionalpersistence: Persistence | "Ephemeral" | "Owner" | "Session" | "Persist"OptionalnetworkIdOptions: NetworkIdOptionsGeneralDataStore created for this SyncEntity and used to store its state. Will be null if the SyncEntity's setup hasn't finished.
If true, this SyncEntity has been marked as destroyed and should not be interacted with.
If true, the SyncEntity's setup has finished and it can be fully used.
The NetworkedScriptComponent this SyncEntity is attached to.
Provides direct access to the NetworkMessageWrapper used by SyncEntity events.
Unique NetworkId string used to identify this SyncEntity.
Provides information about the instantiated Prefab, if this SyncEntity was instantiated. Otherwise, is null.
Event triggered when the SyncEntity is destroyed (both locally or remotely).
Event triggered whenever this SyncEntity receives a network event, including ones sent by the local user.
Event triggered when the SyncEntity is destroyed locally (by the local user).
Event triggered when the SyncEntity's owner changes.
Event triggered when the SyncEntity is destroyed remotely (by another user).
Event triggered whenever this SyncEntity receives a network event, but only from remote users.
Event triggered with the SyncEntity's setup is finished.
It's recommended to use SyncEntity.notifyOnReady() instead, since it will call back immediately if setup has already finished.
UserInfo of the SyncEntity's owner, if one exists. Otherwise null.
Returns the persistence setting for the SyncEntity.
The StoragePropertySet used by this SyncEntity. Each StorageProperty in the set will automatically be kept updated.
Provides direct access to helpful callbacks related to the SyncEntity's currentStore.
Adds a StorageProperty to the SyncEntity's StoragePropertySet.
StorageProperty to add
The StorageProperty passed in
Returns true if the local connection is allowed to modify the SyncEntity's data store.
This means that setup has finished, and either the SyncEntity is unowned or the local user is the owner.
Whether the local connection can modify the store
StaticcreateCreates a new standalone SyncEntity that is not tied to a ScriptComponent.
The network ID
OptionalpropertySet: StoragePropertySetOptional set of StorageProperties the SyncEntity will be initialized with
OptionalclaimOwnership: booleanWhether to claim ownership
Optionalpersistence: Persistence | "Ephemeral" | "Owner" | "Session" | "Persist"The persistence setting
The new SyncEntity
Destroys the SyncEntity. If attached to a ScriptComponent, the SceneObject will also be destroyed.
Returns true if the local connection owns the SyncEntity's data store.
This means that setup has finished, and the local user owns the store.
Whether the local connection owns the store
StaticfindReturns a SyncEntity with matching network id, or null if none exists.
The network ID
SyncEntity with matching network ID, or null
Creates and returns an EntityEventWrapper, which is a helper for dealing with network events.
Name of the network event to wrap
New EntityEventWrapper wrapping the event
Returns the connectionId string of the SyncEntity's current owner, or null if none exists.
The connectionId or null
Returns the connectionId string of the SyncEntity's current owner, or null if none exists.
The connectionId or null
Returns the userId string of the SyncEntity's current owner, or null if none exists.
The userId or null
Returns the MultiplayerSession used by the SessionController, if a session exists. Otherwise, returns null.
The MultiplayerSession or null
Returns the global SessionController.
StaticgetReturns a SyncEntity stored on the component if one exists, otherwise null.
Component to check
SyncEntity found on component, or null
StaticgetReturns the first SyncEntity found on a component attached to sceneObject, or null if none is found.
SceneObject to check
SyncEntity found on sceneObject, or null
Returns true if setup is finished, and any user owns the SyncEntity's data store.
Whether the store is owned
Calls the onReady callback as soon as the SyncEntity's setup is completed.
If setup is already completed, the callback will be executed immediately.
Called as soon as the SyncEntity setup has completed
Put in an ownership request of this SyncEntity for the local user.
If the local user already owns the SyncEntity, onSuccess will be called immediately.
OptionalonSuccess: (store: GeneralDataStore) => voidCalled as soon as ownership was successfully gained
OptionalonError: (error: string) => voidCalled if an error occurs
Send a network event to all copies of this SyncEntity.
Name identifying the event
OptionaleventData: unknownOptional object of any data type that can be included with the event
OptionalonlySendRemote: booleanIf true, this event won't be received by the local SyncEntity that sent it
Put in an ownership request of this SyncEntity for the local user.
The request will be stored if not immediately possible, and try to be honored whenever it becomes possible.
If the local user already owns the SyncEntity, onSuccess will be called immediately.
OptionalonSuccess: (store: GeneralDataStore) => voidCalled as soon as ownership was successfully gained
OptionalonError: (error: string) => voidCalled if an error occurs
Try to revoke ownership if the local user owns this SyncEntity, otherwise onSuccess is called immediately.
OptionalonSuccess: (store: GeneralDataStore) => voidCalled if the ownership was revoked successfully
OptionalonError: (error: string) => voidCalled if an error occurs
Class acting as a bridge between a ScriptComponent and RealtimeStore.