TransformSync Class |
Namespace: ImmerseSDK.Multiplayer
[UnityEngine.DisallowMultipleComponent] [UnityEngine.RequireComponent(typeof(UnityEngine.Rigidbody))] public class TransformSync : IndexedMonoBehaviourWithState, IUpgradableComponent, ISupportDelayedStartup
The TransformSync type exposes the following members.
Name | Description | |
---|---|---|
TransformSync | Initializes a new instance of the TransformSync class |
Name | Description | |
---|---|---|
CreatedByInstantiateService |
True if this transform sync was created using a network message instead of being present in the scene
| |
DefaultIsKinematic |
Gets/Sets the defualt kinematic value. This is read form the Rigidbody in Awake, but can be overwritten later
| |
HasReceivedUpdateMessage |
Returns true if the object's state has changed since instantiation
| |
InitialLocalPosition |
The default position for this transform
| |
IsCurrentlyUpdating |
True if this transform is currently being synchronised (sending/receiving state)
| |
IsInitialised |
Returns True when this instance has been initialised
| |
IsSnapped |
True if this transform is currently snapped
| |
LinkedEngagableObject |
This should point to the EngagableObject that is using this TransformSync.
Sometimes this component can be on the same object, and other times it can be nested further down the hierarchy.
| |
OnSnap |
An event that is triggered when this TransformSync is snapped or unsnapped from a SnapTarget
| |
Owner |
The current owner of this transform
| |
Rigidbody |
The attached RigidBody of this transform
| |
Snapping |
Snapping properties for the TransformSync
| |
UpdateInterval |
The interval in which messages are sent
| |
UpdateSmoothing |
The smoothing value for local interpolation of Transform/Rigidbody values
| |
UpdateState |
Current update state of this transform
| |
UseCombinedColliders |
Combine all the enabled child colliders onto this rigidbody to prevent physics issues
|
Name | Description | |
---|---|---|
Awake |
Unity component method
| |
CanUnsnap |
Returns true if this object can take authority (set its state to NotSnappedState), otherwise false
| |
ChangeUpdateState |
Changes the update state
| |
CheckRequirement |
Compare state to the expected value
(Overrides IndexedMonoBehaviourWithStateCheckRequirement(InteractionRequirementComparisonType, Int32).) | |
CollectCombineAndEnableTopMostColliders | ||
EnableCombineColliders |
Enables the combined colliders for this rigidbody
| |
EnableTopMostCombineColliders |
Enable/Disable TopMost Combined Colliders
| |
FixedUpdate |
Unity component method
| |
GetColliderBoundsInWorldSpace |
Calculated bounds of the object (colliders are temporarily enabled otherwise it doesn't work)
| |
GetTopMostComponent |
Gets the topmost TransformSync in this objects's hierarchy
| |
HasCollisions |
True if there currently are collisions with other pickups/colliders not belonging to this hierarchy
| |
InitializeSyncData |
Initialises the SyncData for this TransformSync. SyncData is based on the _syncType setting.
| |
IsTopMostCollidersEnabled |
Returns true if the top-most transform has colliders enabled
| |
OnAfterReceivePersistedStateMessage |
Override this method if your class needs to execute code after receiving the persisted state for this TransformSync
| |
OnCollisionEnter |
Unity component method
| |
OnCollisionExit |
Unity component method
| |
OnDisable |
Unity component method
| |
OnEnable |
Unity component method
| |
OnLinkedCollisionEnter |
Called by linked collisions
| |
OnLinkedCollisionExit |
Called by linked collisions
| |
RegisterNewSnapTarget |
Registers a new snap target in our list of targets
| |
ReInitialise |
ReInitialise TransformSync with current properties
| |
ReInitialise(SyncProperties, Boolean, Single, SnappingRotationAxis) |
ReInitialise TransformSync with specified properties
| |
ReleaseCombinedCollider |
Disables one combined collider
| |
ReleaseCombinedColliders |
Disables the combined colliders for this rigidbody
| |
ResetKinematic |
Reset kinematic state back to it's default
| |
ResetTransformSync |
Deletes the persisted state associated with this TransformSync
| |
SetOwner |
Sets the owner of this TransformSync. Triggers the OnAuthorityChanged event
| |
SetPersistedState |
Manually update the persisted state for this object (which includes state, position and orientation depending on what values are synchronised).
| |
SetRelativePosition |
Set the position of the object relative ot it's starting values
| |
SetState |
Sets the state of this TransformSync. Note that this is not persisted unless you called SetPersistedState after.
(Overrides IndexedMonoBehaviourWithStateSetState(Byte, Boolean).) | |
SetStateNonPersisted |
Sets the state of this TransformSync and ensures it's not persisted.
| |
SetToComplete |
Complete synchronization (update) state. If the current user is also the owner, this transform will set it's persisted state as well.
| |
SnapTo(Byte, Boolean) |
Snap to snap target index. Actual position/rotation updates will happen when message is received
| |
SnapTo(SnapTarget, Boolean) |
Snap to SnapTarget. Actual position/rotation updates will happen when message is received
| |
SnapToOrigin |
Snap to origin if it is a valid target. Actual position/rotation updates will happen when message is received
| |
SnapToUnassigned |
Set state to Unassigned, which means not snapped but also not sending
| |
Start |
Unity component method
| |
TakeAuthority |
Takes authority for the local user
| |
Unsnap |
Unsnaps the object
|
Name | Description | |
---|---|---|
OnAuthorityChanged |
Fired when the owner of this transform has changed
| |
OnUpdateStateChanged |
Fired when this transform changes synchronization state
|
Name | Description | |
---|---|---|
_onSnap | ||
_snapping |
Snapping properties for the TransformSync
| |
_syncProperties |
Set which values should be synchronized (Always send the minimum amount possible),
defaults to the properties required for a Rigidbody, which is the most common use-case.
| |
_syncType | Obsolete.
Set which values should be synchronized (Always send the minimum amount possible)
| |
NotSnappedState |
State value that indicates that the transform is not snapped
| |
OriginState |
State value that indicates that the transform is snapped to the origin
| |
UnassignedState |
State value that indicates that the transform is not assigned (similar to not snapped and should be treated as the same)
| |
UpdateComparisonTolerance |
Name | Description | |
---|---|---|
GetCopyOf |
Copies all properties of a component from source to target. Uses reflection to set properties.
(Defined by ComponentExtensions.) | |
GetSnapTarget |
Gets the current snap target using the TransformSync's state
(Defined by TransformSyncExtensions.) | |
IsLocalAuthority |
Checks if the current user is the owner of the TransformSync
(Defined by TransformSyncExtensions.) | |
IsSnapped |
Checks if the TransformSync is in a snapped state or not
(Defined by TransformSyncExtensions.) | |
WaitForT |
Waits for a singleton on a coroutine
(Defined by SingletonManager.) |