Click or drag to resize

TransformSync Class

Needed to synchronise position and rotation of this object with remote users
Inheritance Hierarchy
SystemObject
  UnityEngine.Object
    UnityEngine.Component
      UnityEngine.Behaviour
        UnityEngine.MonoBehaviour
          ImmerseSDKLoggingBehaviour
            ImmerseSDK.IndexingIndexedMonoBehaviour
              ImmerseSDK.IndexingIndexedMonoBehaviourWithState
                ImmerseSDK.MultiplayerTransformSync

Namespace:  ImmerseSDK.Multiplayer
Assembly:  ImmerseSDK.App (in ImmerseSDK.App.dll) Version: 3.9.0.0 (3.9.0.0)
Syntax

The TransformSync type exposes the following members.

Constructors
  NameDescription
Public methodTransformSync
Initializes a new instance of the TransformSync class
Top
Properties
  NameDescription
Public propertyCreatedByInstantiateService
True if this transform sync was created using a network message instead of being present in the scene
Public propertyDefaultIsKinematic
Gets/Sets the defualt kinematic value. This is read form the Rigidbody in Awake, but can be overwritten later
Public propertyHasReceivedUpdateMessage
Returns true if the object's state has changed since instantiation
Public propertyInitialLocalPosition
The default position for this transform
Public propertyIsCurrentlyUpdating
True if this transform is currently being synchronised (sending/receiving state)
Public propertyIsInitialised
Returns True when this instance has been initialised
Public propertyIsSnapped
True if this transform is currently snapped
Public propertyLinkedEngagableObject
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.
Public propertyOnSnap
An event that is triggered when this TransformSync is snapped or unsnapped from a SnapTarget
Public propertyOwner
The current owner of this transform
Public propertyRigidbody
The attached RigidBody of this transform
Public propertySnapping
Snapping properties for the TransformSync
Public propertyUpdateInterval
The interval in which messages are sent
Public propertyUpdateSmoothing
The smoothing value for local interpolation of Transform/Rigidbody values
Public propertyUpdateState
Current update state of this transform
Public propertyUseCombinedColliders
Combine all the enabled child colliders onto this rigidbody to prevent physics issues
Top
Methods
  NameDescription
Protected methodAwake
Unity component method
Public methodCanUnsnap
Returns true if this object can take authority (set its state to NotSnappedState), otherwise false
Protected methodChangeUpdateState
Changes the update state
Public methodCheckRequirement
Compare state to the expected value
(Overrides IndexedMonoBehaviourWithStateCheckRequirement(InteractionRequirementComparisonType, Int32).)
Public methodCollectCombineAndEnableTopMostColliders
Protected methodEnableCombineColliders
Enables the combined colliders for this rigidbody
Public methodEnableTopMostCombineColliders
Enable/Disable TopMost Combined Colliders
Protected methodFixedUpdate
Unity component method
Public methodGetColliderBoundsInWorldSpace
Calculated bounds of the object (colliders are temporarily enabled otherwise it doesn't work)
Protected methodGetTopMostComponent
Gets the topmost TransformSync in this objects's hierarchy
Public methodHasCollisions
True if there currently are collisions with other pickups/colliders not belonging to this hierarchy
Protected methodInitializeSyncData
Initialises the SyncData for this TransformSync. SyncData is based on the _syncType setting.
Public methodIsTopMostCollidersEnabled
Returns true if the top-most transform has colliders enabled
Protected methodOnAfterReceivePersistedStateMessage
Override this method if your class needs to execute code after receiving the persisted state for this TransformSync
Protected methodOnCollisionEnter
Unity component method
Protected methodOnCollisionExit
Unity component method
Protected methodOnDisable
Unity component method
Protected methodOnEnable
Unity component method
Public methodOnLinkedCollisionEnter
Called by linked collisions
Public methodOnLinkedCollisionExit
Called by linked collisions
Public methodRegisterNewSnapTarget
Registers a new snap target in our list of targets
Public methodReInitialise
ReInitialise TransformSync with current properties
Public methodReInitialise(SyncProperties, Boolean, Single, SnappingRotationAxis)
ReInitialise TransformSync with specified properties
Protected methodReleaseCombinedCollider
Disables one combined collider
Protected methodReleaseCombinedColliders
Disables the combined colliders for this rigidbody
Public methodResetKinematic
Reset kinematic state back to it's default
Public methodResetTransformSync
Deletes the persisted state associated with this TransformSync
Protected methodSetOwner
Sets the owner of this TransformSync. Triggers the OnAuthorityChanged event
Public methodSetPersistedState
Manually update the persisted state for this object (which includes state, position and orientation depending on what values are synchronised).
Public methodSetRelativePosition
Set the position of the object relative ot it's starting values
Protected methodSetState
Sets the state of this TransformSync. Note that this is not persisted unless you called SetPersistedState after.
(Overrides IndexedMonoBehaviourWithStateSetState(Byte, Boolean).)
Protected methodSetStateNonPersisted
Sets the state of this TransformSync and ensures it's not persisted.
Public methodSetToComplete
Complete synchronization (update) state. If the current user is also the owner, this transform will set it's persisted state as well.
Public methodSnapTo(Byte, Boolean)
Snap to snap target index. Actual position/rotation updates will happen when message is received
Public methodSnapTo(SnapTarget, Boolean)
Snap to SnapTarget. Actual position/rotation updates will happen when message is received
Public methodSnapToOrigin
Snap to origin if it is a valid target. Actual position/rotation updates will happen when message is received
Public methodSnapToUnassigned
Set state to Unassigned, which means not snapped but also not sending
Protected methodStart
Unity component method
Public methodTakeAuthority
Takes authority for the local user
Public methodUnsnap
Unsnaps the object
Top
Events
  NameDescription
Public eventOnAuthorityChanged
Fired when the owner of this transform has changed
Public eventOnUpdateStateChanged
Fired when this transform changes synchronization state
Top
Fields
  NameDescription
Private field_onSnap
Private field_snapping
Snapping properties for the TransformSync
Private field_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.
Private field_syncType Obsolete.
Set which values should be synchronized (Always send the minimum amount possible)
Public fieldStatic memberNotSnappedState
State value that indicates that the transform is not snapped
Public fieldStatic memberOriginState
State value that indicates that the transform is snapped to the origin
Public fieldStatic memberUnassignedState
State value that indicates that the transform is not assigned (similar to not snapped and should be treated as the same)
Public fieldStatic memberUpdateComparisonTolerance
Top
Extension Methods
  NameDescription
Public Extension MethodGetCopyOf
Copies all properties of a component from source to target. Uses reflection to set properties.
(Defined by ComponentExtensions.)
Public Extension MethodGetSnapTarget
Gets the current snap target using the TransformSync's state
(Defined by TransformSyncExtensions.)
Public Extension MethodIsLocalAuthority
Checks if the current user is the owner of the TransformSync
(Defined by TransformSyncExtensions.)
Public Extension MethodIsSnapped
Checks if the TransformSync is in a snapped state or not
(Defined by TransformSyncExtensions.)
Public Extension MethodWaitForT
Waits for a singleton on a coroutine
(Defined by SingletonManager.)
Top
See Also