Photon Fusion 1.1.2

Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Properties | List of all members
NetworkRigidbody2D Class Reference

Replicates a Unity Rigidbody state from the NetworkObject.StateAuthority to all other peers. Add this component to a GameObject with a Rigidbody component. A NetworkObject is required on this GameObject or a parent of this GameObject. More...

Inherits NetworkRigidbodyBase.

Public Member Functions

override void Spawned ()
 Implements NetworkBehaviour.Spawned. If overriding this method in an inheritor, the base method should be called. More...
 
Vector2 ReadRigidbodyPosition ()
 Reads from the field reserved to store the rigidbody position on this object's networked data using the default Runner position read accuracy. More...
 
Vector2 ReadRigidbodyPosition (int *ptr)
 Reads from the field reserved to store the rigidbody position on the networked data pointed by ptr using the default Runner position read accuracy. More...
 
float ReadRigidbodyRotation ()
 Reads from the field reserved to store the rigidbody rotation on this object's networked data using the default Runner rotation read accuracy. More...
 
float ReadRigidbodyRotation (int *ptr)
 Reads from the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the default Runner rotation read accuracy. More...
 
Vector2 ReadVelocity ()
 Reads from the field reserved to store the rigidbody velocity on this object's networked data using the default Runner position read accuracy. More...
 
Vector2 ReadVelocity (int *ptr)
 Reads from the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the default Runner position read accuracy. More...
 
float ReadAngularVelocity ()
 Reads from the field reserved to store the rigidbody angular velocity on this object's networked data using the default Runner position read accuracy. More...
 
float ReadAngularVelocity (int *ptr)
 Reads from the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the default Runner position read accuracy. More...
 
float ReadGravityScale ()
 Reads from the field reserved to store the rigidbody gravity scale on this object's networked data using the default Runner position read accuracy. More...
 
float ReadGravityScale (int *ptr)
 Reads from the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the default Runner position read accuracy. More...
 
void ReadNetworkRigidbodyFlags (out NetworkRigidbodyFlags nrbFlags, out RigidbodyConstraints2D rbConstraints)
 Reads from a field reserved to store the rigidbody flags and constraints on this object's networked data. More...
 
void WriteRigidbodyPosition (Vector2 rbPos)
 Writes to the field reserved to store the rigidbody position on this object's networked data using the default Runner position write accuracy. More...
 
void WriteRigidbodyPosition (Vector2 rbPos, int *ptr)
 Writes to the field reserved to store the rigidbody position on the networked data pointed by ptr using the default Runner position write accuracy. More...
 
void WriteRigidbodyRotation (float rbRot)
 Writes to the field reserved to store the rigidbody rotation on this object's networked data using the default Runner rotation write accuracy. More...
 
void WriteRigidbodyRotation (float rbRot, int *ptr)
 Writes to the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the default Runner rotation write accuracy. More...
 
void WriteVelocity (Vector2 velocity)
 Writes to the field reserved to store the rigidbody velocity on this object's networked data using the default Runner position write accuracy. More...
 
void WriteVelocity (Vector2 velocity, int *ptr)
 Writes to the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the default Runner position write accuracy. More...
 
void WriteAngularVelocity (float angularVel)
 Writes to the field reserved to store the rigidbody angular velocity on this object's networked data using the default Runner position write accuracy. More...
 
void WriteAngularVelocity (float angularVel, int *ptr)
 Writes to the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the default Runner position write accuracy. More...
 
void WriteGravityScale (float gravityScale)
 Writes to the field reserved to store the rigidbody gravity scale on this object's networked data using the default Runner position write accuracy. More...
 
void WriteGravityScale (float gravityScale, int *ptr)
 Writes to the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the default Runner position write accuracy. More...
 
void WriteNetworkRigidbodyFlags (NetworkRigidbodyFlags nrbFlags, RigidbodyConstraints2D rbConstraints)
 Writes to a field reserved to store the rigidbody flags and constraints on this object's networked data. More...
 
- Public Member Functions inherited from NetworkRigidbodyBase
override void RemotePrefabCreated ()
 Implements IRemotePrefabCreated. If overriding this method in an inheritor, the base method should be called. More...
 
override void CopyBackingFieldsToState (bool firstTime)
 Implements NetworkBehaviour.CopyBackingFieldsToState. If overriding this method in an inheritor, the base method should be called. More...
 
override void BeforeAllTicks (bool resimulation, int tickCount)
 Implements IBeforeAllTicks. If overriding this method in an inheritor, the base method should be called. To extend the functionality of copying data from the networked buffer to the engine, override and extend NetworkPositionRotation.CopyFromBufferToEngine instead. More...
 
override void AfterAllTicks (bool resimulation, int tickCount)
 Implements IAfterAllTicks. If overriding this method in an inheritor, the base method should be called. To extend the functionality of copying data from the engine to the networked buffer, override and extend NetworkPositionRotation.CopyFromEngineToBuffer instead. More...
 
override void BeforeCopyPreviousState ()
 Implements IBeforeCopyPreviousState. If overriding this method in an inheritor, the base method should be called. More...
 
override bool IsInterpolationDataPredicted ()
 If the behaviour data should be interpolated between latest predicted states or between snapshots.
 
float ReadDrag ()
 Reads from the field reserved to store the rigidbody drag on this object's networked data using the default Runner position read accuracy. More...
 
float ReadDrag (int *ptr)
 Reads from the field reserved to store the rigidbody drag on the networked data pointed by ptr using the default Runner position read accuracy. More...
 
float ReadAngularDrag ()
 Reads from the field reserved to store the rigidbody angular drag on this object's networked data using the default Runner position read accuracy. More...
 
float ReadAngularDrag (int *ptr)
 Reads from the field reserved to store the rigidbody angular drag on the networked data pointed by ptr using the default Runner position read accuracy. More...
 
float ReadMass ()
 Reads from the field reserved to store the rigidbody mass on this object's networked data using the default Runner position read accuracy. More...
 
float ReadMass (int *ptr)
 Reads from the field reserved to store the rigidbody mass on the networked data pointed by ptr using the default Runner position read accuracy. More...
 
NetworkRigidbodyFlags ReadNetworkRigidbodyFlags ()
 Reads from the field reserved to store the rigidbody flags on this object's networked data. More...
 
void WriteDrag (float drag)
 Writes the field reserved to store the rigidbody drag on this object's networked data using the default Runner position write accuracy. More...
 
void WriteDrag (float drag, int *ptr)
 Writes to the field reserved to store the rigidbody drag on the networked data pointed by ptr using the default Runner position write accuracy. More...
 
void WriteAngularDrag (float angDrag)
 Writes the field reserved to store the rigidbody angular drag on this object's networked data using the default Runner position write accuracy. More...
 
void WriteAngularDrag (float angDrag, int *ptr)
 Writes to the field reserved to store the rigidbody angular drag on the networked data pointed by ptr using the default Runner position write accuracy. More...
 
void WriteMass (float mass)
 Writes the field reserved to store the rigidbody mass on this object's networked data using the default Runner position write accuracy. More...
 
void WriteMass (float mass, int *ptr)
 Writes to the field reserved to store the rigidbody mass on the networked data pointed by ptr using the default Runner position write accuracy. More...
 
void WriteNetworkRigidbodyFlags (NetworkRigidbodyFlags flags)
 Writes to the field reserved to store the rigidbody flags on this object's networked data. More...
 
- Public Member Functions inherited from NetworkTransform
override void Spawned ()
 Overrides NetworkBehaviour.Spawned. If overriding this method in an inheritor, the base method should be called. More...
 
override void BeforeUpdate ()
 Overrides NetworkPositionRotation.BeforeUpdate. If overriding this method in an inheritor, the base method should be called. More...
 
override void Render ()
 Overrides SimulationBehaviour.Render, computing the interpolated position and rotation values according to the NetworkBehaviour.InterpolationDataSource, updating the prediction error correction and calling ApplyInterpolatedTransform to apply the results to the InterpolationTarget. More...
 
void AfterTick ()
 Implements IAfterTick. If overriding this method in an inheritor, the base method should be called. More...
 
void TeleportToPosition (Vector3 position, Vector3? interpolationVel=null, bool interpolateBackwards=true)
 Teleports the object to the provided position while making the networked state aware that the object was teleported and the view interpolation needs special handling. The position is immediately set to the transform's position field and additional data is stored in order to interpolate the view object between the ticks. While interpolating the visual representation of the networked object TO a tick where a teleport happened, the object's latest state (tick when the teleport is performed) will not be used, as doing so would cause the interpolation target to visually interpolate along the teleported distance. Instead, the view will be interpolated between the FROM state (tick before the teleport) and an artificial position computed based on this FROM state and an interpolation velocity (see interpolationVel ), in order to emulate how the object would behave if the teleport had not been performed. More...
 
void TeleportToRotation (Quaternion rotation, Vector3? interpolationAngularVel=null, bool interpolateBackwards=true)
 Teleports the object to the provided rotation while making the networked state aware that the object was teleported and the view interpolation needs special handling. The rotation is immediately set to the transform's rotation field and additional data is stored in order to interpolate the view object between the ticks. While interpolating the visual representation of the networked object TO a tick where a teleport happened, the object's latest state (tick when the teleport is performed) will not be used, as doing so would cause the interpolation target to visually interpolate along the teleported rotation. Instead, the view will be interpolated between the FROM state (tick before the teleport) and an artificial rotation computed based on this FROM state and an interpolation angular velocity (see interpolationAngularVel ), in order to emulate how the object would behave if the teleport had not been performed. More...
 
void TeleportToPositionRotation (Vector3 position, Quaternion rotation, Vector3? interpolationVel=null, Vector3? interpolationAngularVel=null, bool interpolateBackwards=true)
 Teleports the object to the provided position and rotation while making the networked state aware that the object was teleported and the view interpolation needs special handling. The rotation is immediately set to the transform's rotation field and additional data is stored in order to interpolate the view object between the ticks. See TeleportToPosition and TeleportToRotation for more details about why and how the special interpolation handling is performed. More...
 
virtual void PredictedSpawnSpawned ()
 Implements IPredictedSpawnBehaviour.PredictedSpawnSpawned. If overriding this method in an inheritor, the base method should be called. More...
 
virtual void PredictedSpawnUpdate ()
 Implements IPredictedSpawnBehaviour.PredictedSpawnUpdate and, by default, calls PredictedSpawnCacheTransformState. Behaviours that change the Transform state of this predict-spawned object should either be ordered before NetworkTransform or call PredictedSpawnCacheTransformState after doing so. If overriding this method in an inheritor, the base method should be called. More...
 
virtual void PredictedSpawnRender ()
 Implements IPredictedSpawnBehaviour.PredictedSpawnSpawned. If overriding this method in an inheritor, the base method should be called. More...
 
virtual void PredictedSpawnFailed ()
 Implements IPredictedSpawnBehaviour.PredictedSpawnFailed and does nothing by default. More...
 
virtual void PredictedSpawnSuccess ()
 Implements IPredictedSpawnBehaviour.PredictedSpawnSuccess and does nothing by default. More...
 
void PredictedSpawnCacheTransformState ()
 If this object is a predicted spawn, caches the current transform state for interpolated rendering and prediction error correction. More...
 
Vector3 ReadTeleportInterpolationVelocity ()
 Reads from this object's networked data field holding the interpolation velocity (used on position teleports) using the default Runner position read accuracy. See TeleportToPosition for more information on how this value is used. More...
 
Vector3 ReadTeleportInterpolationVelocity (int *ptr)
 Reads from a field holding the interpolation velocity (used on position teleports) from the networked data pointed by ptr using the default Runner position read accuracy. See TeleportToPosition for more information on how this value is used. More...
 
Vector3 ReadTeleportInterpolationAngularVelocity ()
 Reads from this object's networked data field holding the interpolation angular velocity (used on position teleports) using the default Runner position read accuracy. See TeleportToRotation for more information on how this value is used. More...
 
Vector3 ReadTeleportInterpolationAngularVelocity (int *ptr)
 Reads from a field holding the interpolation angular velocity (used on position teleports) from the networked data pointed by ptr using the default Runner position read accuracy. See TeleportToRotation for more information on how this value is used. More...
 
int ReadTeleportPositionTick ()
 Reads from this object's field holding the tick number where TeleportToPosition was last called. More...
 
int ReadTeleportRotationTick ()
 Reads from this object's field holding the tick number where TeleportToRotation was last called. More...
 
bool ReadTeleportPositionInterpolateBackwards ()
 Reads from this object's field holding information about the last TeleportToPosition call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
bool ReadTeleportRotationInterpolateBackwards ()
 Reads from this object's field holding information about the last TeleportToRotation call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
int ReadPositionRotationChangedTick ()
 Reads from this object's field holding the tick number when the written position and/or rotation values changed. More...
 
void WriteTeleportInterpolationVelocity (Vector3 velocity)
 Writes to this object's networked data field holding the interpolation velocity (used on position teleports) using the default Runner position write accuracy. See TeleportToPosition for more information on how this value is used. More...
 
void WriteTeleportInterpolationVelocity (Vector3 velocity, int *ptr)
 Writes to a field holding the interpolation velocity (used on position teleports) on the networked data pointed by ptr using the default Runner position write accuracy. See TeleportToPosition for more information on how this value is used. More...
 
void WriteTeleportInterpolationAngularVelocity (Vector3 angularVel)
 Writes to this object's networked data field holding the interpolation angular velocity (used on position teleports) using the default Runner position write accuracy. See TeleportToRotation for more information on how this value is used. More...
 
void WriteTeleportInterpolationAngularVelocity (Vector3 angularVel, int *ptr)
 Writes to a field holding the interpolation angular velocity (used on position teleports) on the networked data pointed by ptr using the default Runner position write accuracy. See TeleportToRotation for more information on how this value is used. More...
 
void WriteTeleportPositionTick (int tick)
 Writes this object's field holding the tick number where TeleportToPosition was last called. More...
 
void WriteTeleportRotationTick (int tick)
 Writes this object's field holding the tick number where TeleportToRotation was last called. More...
 
void WriteTeleportPositionInterpolateBackwards (bool backwards)
 Writes to this object's field holding information about the last TeleportToPosition call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
void WriteTeleportRotationInterpolateBackwards (bool backwards)
 Writes to this object's field holding information about the last TeleportToRotation call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
void WritePositionRotationChanged (bool posChanged, bool rotChanged)
 Writes to this object's field holding information about whether the position and/or rotation values changed when written to the buffer. More...
 
void WritePositionRotationChangedTick (int tick)
 Writes to this object's field holding the tick number when the written position and/or rotation values changed. More...
 
- Public Member Functions inherited from NetworkPositionRotation
void AfterHostMigration ()
 Invoked after the Host Migration happens in order to setup non-networked data on NetworkBehaviors
 
Vector3 ReadPosition ()
 Reads from the position field on this object's networked data with the default Runner position read accuracy. More...
 
Vector3 ReadPosition (int *ptr)
 Reads from a position field on the networked data pointed by ptr with the default Runner position read accuracy. More...
 
Quaternion ReadRotation ()
 Reads from the rotation field on this object's networked data with the default Runner position read accuracy. More...
 
Quaternion ReadRotation (int *ptr)
 Reads from a rotation field on the networked data pointed by ptr with the default Runner position read accuracy. More...
 
void WritePosition (Vector3 position)
 Writes to a position field on this object's networked data with the default Runner position write accuracy. More...
 
void WritePosition (Vector3 position, int *ptr)
 Writes to a position field on the networked data pointed by ptr with the default Runner position write accuracy. More...
 
void WriteRotation (Quaternion rotation)
 Writes to a rotation field on this object's networked data with the default Runner position write accuracy. More...
 
void WriteRotation (Quaternion rotation, int *ptr)
 Writes to a rotation field on the networked data pointed by ptr with the default Runner position write accuracy. More...
 
- Public Member Functions inherited from NetworkBehaviour
delegate int[] InterestGroupsCallback (Type type, NetworkBehaviour behaviour)
 
int GetLocalAuthorityMask ()
 Gets a bitmask of AuthorityMasks flags, representing the current local authority over this NetworkObject. More...
 
void CopyStateFrom (NetworkBehaviour source)
 Copies entire state of passed in source NetworkBehaviour More...
 
override void FixedUpdateNetwork ()
 Fusion FixedUpdate timing callback. More...
 
virtual void CopyStateToBackingFields ()
 
virtual void Despawned (NetworkRunner runner, bool hasState)
 Called before the network object is despawned More...
 
bool GetInterpolationData (out InterpolationData data, bool? predicted=null)
 Get 'To' and 'From' states, and the Alpha (t) values needed for lerping. More...
 
bool GetInterpolationData (out InterpolationData data, out bool predicted)
 Get 'To' and 'From' states, and the Alpha (t) values needed for interpolation. More...
 
void OnChangeClearAll ()
 Clear all dynamic OnChange callbacks from this behaviour More...
 
bool OnChangeRemove (NetworkBehaviourCallbackReference reference)
 Removes a specific OnChange callback from this behaviour More...
 
NetworkBehaviourCallbackReference OnChangeAdd< T > (int wordOffset, int wordCount, ChangedDelegate< T > callback, OnChangedTargets targets=OnChangedTargets.All)
 Adds a OnChange callback to this behaviour which is bound to a specific word offset and word count More...
 
NetworkBehaviourCallbackReference OnChangeAdd< T > (string propertyName, ChangedDelegate< T > callback, OnChangedTargets targetses=OnChangedTargets.All)
 Adds a OnChange callback to this behaviour which is bound to a specific weaved property More...
 
T? GetInput< T > ()
 
bool GetInput< T > (out T input)
 Returns true if it a valid INetworkInput can be found for the current simulation tick (Typically this is used in FixedUpdateNetwork). More...
 
RawInterpolator GetInterpolator (string propertyName)
 Get a raw interpolator for a networked property. The returned RawInterpolator provides a way to calculate the "between-ticks" value of the named [Networked] property. More...
 
Interpolator< T > GetInterpolator< T > (string propertyName)
 Get an interpolator for a networked property. The returned Interpolator provides a way to calculate the "between-ticks" value of the named [Networked] property with the specified type T. The value is a linear interpolation between the "from" and the "to" ticks and is available via the Value property on the Interpolator. More...
 
- Public Member Functions inherited from Behaviour
AddBehaviour< T > ()
 Wrapper for Unity's GameObject.AddComponent() More...
 
bool TryGetBehaviour< T > (out T behaviour)
 Wrapper for Unity's GameObject.TryGetComponent() More...
 
GetBehaviour< T > ()
 Wrapper for Unity's GameObject.GetComponentInChildren() More...
 

Static Public Member Functions

static Vector2 ReadRigidbodyPosition (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody position on the networked data pointed by ptr using the defined readAccuracy . More...
 
static float ReadRigidbodyRotation (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the defined readAccuracy . More...
 
static Vector2 ReadVelocity (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the defined readAccuracy . More...
 
static float ReadAngularVelocity (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the defined readAccuracy . More...
 
static float ReadGravityScale (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the defined readAccuracy . More...
 
static void ReadNetworkRigidbodyFlags (int *ptr, out NetworkRigidbodyFlags nrbFlags, out RigidbodyConstraints2D rbConstraints)
 Reads from a field reserved to store the rigidbody flags and constraints on the networked data pointed by ptr . More...
 
static void WriteRigidbodyPosition (Vector2 rbPos, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody position on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteRigidbodyRotation (float rbRot, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteVelocity (Vector2 velocity, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteAngularVelocity (float angularVel, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteGravityScale (float gravityScale, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteNetworkRigidbodyFlags (NetworkRigidbodyFlags nrbFlags, RigidbodyConstraints2D rbConstraints, int *ptr)
 Writes a field reserved to store the rigidbody flags and constraints on the networked data pointed by ptr . More...
 
- Static Public Member Functions inherited from NetworkRigidbodyBase
static float ReadDrag (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody drag on the networked data pointed by ptr using the defined readAccuracy . More...
 
static float ReadAngularDrag (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody angular drag on the networked data pointed by ptr using the defined readAccuracy . More...
 
static float ReadMass (int *ptr, ReadAccuracy readAccuracy)
 Reads from the field reserved to store the rigidbody mass on the networked data pointed by ptr using the defined readAccuracy . More...
 
static NetworkRigidbodyFlags ReadNetworkRigidbodyFlags (int *ptr)
 Reads from the field reserved to store the rigidbody flags on the networked data pointed by ptr . More...
 
static void WriteDrag (float drag, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody drag on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteAngularDrag (float angDrag, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody angular drag on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteMass (float mass, int *ptr, WriteAccuracy writeAccuracy)
 Writes to the field reserved to store the rigidbody mass on the networked data pointed by ptr using the defined writeAccuracy . More...
 
static void WriteNetworkRigidbodyFlags (NetworkRigidbodyFlags flags, int *ptr)
 Reads from the field reserved to store the rigidbody flags on the networked data pointed by ptr . More...
 
- Static Public Member Functions inherited from NetworkTransform
static Vector3 ReadTeleportInterpolationVelocity (int *ptr, ReadAccuracy readAccuracy)
 Reads from a field holding the interpolation velocity (used on position teleports) from the networked data pointed by ptr with the defined readAccuracy . See TeleportToPosition for more information on how this value is used. More...
 
static Vector3 ReadTeleportInterpolationAngularVelocity (int *ptr, ReadAccuracy readAccuracy)
 Reads from a field holding the interpolation angular velocity (used on position teleports) on the networked data pointed by ptr with the defined readAccuracy . See TeleportToRotation for more information on how this value is used. More...
 
static int ReadTeleportPositionTick (int *ptr)
 Reads from the networked data pointer by ptr a field holding the tick number where TeleportToPosition was last called. More...
 
static int ReadTeleportRotationTick (int *ptr)
 Reads from the networked data pointer by ptr a field holding the tick number where TeleportToRotation was last called. More...
 
static bool ReadTeleportPositionInterpolateBackwards (int *ptr)
 Reads from the networked data pointer by ptr a field holding information about the last TeleportToPosition call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
static bool ReadTeleportRotationInterpolateBackwards (int *ptr)
 Reads from the networked data pointer by ptr a field holding information about the last TeleportToRotation call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
static int ReadPositionRotationChangedTick (int *ptr)
 Reads from the networked data pointer by ptr a field holding the tick number when the written position and/or rotation values changed. More...
 
static void WriteTeleportInterpolationVelocity (Vector3 velocity, int *ptr, WriteAccuracy writeAccuracy)
 Writes to a field holding the interpolation velocity (used on position teleports) from the networked data pointed by ptr with the defined writeAccuracy . See TeleportToPosition for more information on how this value is used. More...
 
static void WriteTeleportInterpolationAngularVelocity (Vector3 angularVel, int *ptr, WriteAccuracy writeAccuracy)
 Writes to a field holding the interpolation angular velocity (used on position teleports) from the networked data pointed by ptr with the defined writeAccuracy . See TeleportToRotation for more information on how this value is used. More...
 
static void WriteTeleportPositionTick (int tick, int *ptr)
 Writes to the networked data pointer by ptr a field holding the tick number where TeleportToPosition was last called. More...
 
static void WriteTeleportRotationTick (int tick, int *ptr)
 Writes to the networked data pointer by ptr a field holding the tick number where TeleportToRotation was last called. More...
 
static void WriteTeleportPositionInterpolateBackwards (int *ptr, bool backwards)
 Writes the networked data pointer by ptr , on a field holding information about the last TeleportToPosition call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
static void WriteTeleportRotationInterpolateBackwards (int *ptr, bool backwards)
 Writes to this object's field holding information about the last TeleportToRotation call and if should be interpolated forward (emulated To based on From state + interpolation) or backwards (Emulated From based on To state - interpolation). More...
 
static void WritePositionRotationChanged (int *ptr, bool posChanged, bool rotChanged)
 Writes to the networked data pointer by ptr , on a field holding information about whether the position and/or rotation values changed when written to the buffer. More...
 
static void WritePositionRotationChangedTick (int tick, int *ptr)
 Writes to the networked data pointer by ptr , on a field holding the tick number when the written position and/or rotation values changed. More...
 
- Static Public Member Functions inherited from NetworkPositionRotation
static Vector3 ReadPosition (int *ptr, ReadAccuracy readAccuracy)
 Reads from a position field on the networked data pointed by ptr with the defined readAccuracy . More...
 
static Quaternion ReadRotation (int *ptr, ReadAccuracy readAccuracy)
 Reads from a rotation field on the networked data pointed by ptr with the defined readAccuracy . More...
 
static void WritePosition (Vector3 position, int *ptr, WriteAccuracy writeAccuracy)
 Writes to a position field on the networked data pointed by ptr with the defined writeAccuracy . More...
 
static void WriteRotation (Quaternion rotation, int *ptr, WriteAccuracy writeAccuracy)
 Writes to a rotation field on the networked data pointed by ptr with the defined writeAccuracy . More...
 
- Static Public Member Functions inherited from NetworkBehaviour
static int NetworkSerialize (NetworkRunner runner, NetworkBehaviour obj, byte *data)
 
static int NetworkDeserialize (NetworkRunner runner, byte *data, ref NetworkBehaviour result)
 
static NetworkBehaviourId NetworkWrap (NetworkRunner runner, NetworkBehaviour obj)
 
static NetworkBehaviour NetworkUnwrap (NetworkRunner runner, NetworkBehaviourId wrapper)
 
static ref T MakeRef< T > ()
 
static ref T MakeRef< T > (T defaultValue)
 
static T * MakePtr< T > ()
 
static T * MakePtr< T > (T defaultValue)
 
static NetworkBehaviourUtils.ArrayInitializer< T > MakeInitializer< T > (T[] array)
 This is a special method that is meant to be used only for [Networked] properties inline initialization. More...
 
static NetworkBehaviourUtils.DictionaryInitializer< K, V > MakeInitializer< K, V > (Dictionary< K, V > dictionary)
 This is a special method that is meant to be used only for [Networked] properties inline initialization. More...
 
static implicit operator NetworkBehaviourId (NetworkBehaviour behaviour)
 Converts NetworkBehaviour to NetworkBehaviourId More...
 
- Static Public Member Functions inherited from Behaviour
static void DestroyBehaviour (Behaviour behaviour)
 Wrapper for Unity's GameObject.Destroy() More...
 

Protected Member Functions

sealed override void SetIsKinematic (bool value)
 Sets the Rigidbody UnityEngine.Rigidbody2D.isKinematic field to value . More...
 
sealed override void SetCollisionDetectionMode (CollisionDetectionMode mode)
 Sets the Rigidbody2D.collisionDetectionMode to CollisionDetectionMode2D.Discrete if mode is CollisionDetectionMode.Discrete, and to CollisionDetectionMode2D.Continuous otherwise. More...
 
override void Awake ()
 Implements Unity's Awake event function. If overriding this method in an inheritor, the base method should be called. More...
 
override void CopyFromBufferToEngine ()
 Sets the values retrieved from the networked data to the respective engine (Unity) fields. If overriding this method in an inheritor, the base method should be called.
 
override void CopyFromEngineToBuffer ()
 Sets the values retrieved from the engine (Unity) to the respective networked fields. If overriding this method in an inheritor, the base method should be called.
 
- Protected Member Functions inherited from NetworkRigidbodyBase
int ReadNetworkRigidbodyRawFlags ()
 Reads from the field reserved to store the rigid body flags on this object's networked data and returns the raw word value that might also carry flags specific to 2D or 3D rigid bodies. See also NetworkRigidbody.ReadNetworkRigidbodyFlags or NetworkRigidbody2D.ReadNetworkRigidbodyFlags. More...
 
Vector3 ReadDragsAndMass ()
 Reads the values of a rigidbody drag, angular drag and mass field on this object's networked data using the default Runner position read accuracy. The values are returned as the x, y and z values of a Vector3, respectively. More...
 
Vector3 ReadDragsAndMass (int *ptr)
 Reads the values of a rigidbody drag, angular drag and mass field on the networked data pointed by ptr using the default Runner position read accuracy. The values are returned as the x, y and z values of a Vector3, respectively. More...
 
void WriteNetworkRigidbodyRawFlags (int rawFlags)
 Writes to the field reserved to store the on this object's networked data. See also NetworkRigidbody.ReadNetworkRigidbodyFlags or NetworkRigidbody2D.ReadNetworkRigidbodyFlags. More...
 
void WriteDragsAndMass (Vector3 values)
 Writes the values of a rigidbody drag, angular drag and mass field on this object's networked data using the default Runner position read accuracy. The values must be provided as the x, y and z values of a Vector3, respectively. More...
 
void WriteDragsAndMass (Vector3 values, int *ptr)
 Reads the values of a rigidbody drag, angular drag and mass field on the networked data pointed by ptr using the default Runner position read accuracy. The values must be provided as the x, y and z values of a Vector3, respectively. More...
 
- Protected Member Functions inherited from NetworkTransform
virtual void ApplyInterpolatedTransform (ref InterpolatedTransformParameters param)
 Applies the interpolated position and rotation values and prediction error corrections computed on Render to the InterpolationTarget. More...
 
virtual void GetUninterpolatedWorldPositions (ref InterpolationData data, out Vector3 posFrom, out Vector3 posTo)
 Retrieves the world position values from the From and To states made available in the interpolation data , setting them to posFrom and posTo , respectively. More...
 
virtual void GetUninterpolatedWorldRotations (ref InterpolationData data, out Quaternion rotFrom, out Quaternion rotTo)
 Retrieves the world rotation values from the From and To states made available in the interpolation data , setting them to rotFrom and rotTo , respectively. More...
 
override void CopyFromEngineToBuffer ()
 Sets the values retrieved from the engine (Unity) to the respective networked fields. If overriding this method in an inheritor, the base method should be called.
 
- Protected Member Functions inherited from NetworkPositionRotation
virtual void OnEnable ()
 Implements Unity's OnEnable event function. If overriding this method in an inheritor, the base method should be called. More...
 
virtual Vector3 GetEnginePosition ()
 Gets the position value from the engine. By default, the world position is set to be the output. More...
 
virtual Quaternion GetEngineRotation ()
 Gets the rotation value from the engine. By default, the world rotation is set to be the output. More...
 
virtual void SetEnginePosition (Vector3 pos)
 Sets a position value to the engine. By default, the value is set to the transform's world position field. More...
 
virtual void SetEngineRotation (Quaternion rot)
 Sets a rotation value to the engine. By default, the value is set to the transform's world rotation field. More...
 

Static Protected Attributes

const int WORD_COUNT_NRB_2D = OffsetGravityScl + WordCountGravityScl
 Number of words used by a NetworkRigidbody2D instance on its networked data, including all inherited fields. More...
 
- Static Protected Attributes inherited from NetworkRigidbodyBase
const int WORD_COUNT_NRBB = OFFSET_FLAGS + WORD_COUNT_FLAGS
 Number of words used by a NetworkRigidbodyBase instance on its networked data, including all inherited fields. More...
 
- Static Protected Attributes inherited from NetworkTransform
const int WORD_COUNT_NT = OFFSET_POS_ROT_CHANGED_TICK + WORD_COUNT_POS_ROT_CHANGED_TICK
 Number of words used by a NetworkTransform instance on its networked data, including all inherited fields. More...
 
- Static Protected Attributes inherited from NetworkPositionRotation
const int WORD_COUNT_NPR = OFFSET_ROTATION + WORD_COUNT_ROTATION
 Number of words used by a NetworkPositionRotation instance on its networked data, including all inherited fields. More...
 

Properties

Rigidbody2D Rigidbody [get]
 Cached reference of this object's Rigidbody2D component. More...
 
override Vector3 DefaultTeleportInterpolationVelocity [get]
 Sets the default teleport interpolation velocity to be the rigidbody velocity. For more details on how this field is used, see NetworkTransform.TeleportToPosition. More...
 
override Vector3 DefaultTeleportInterpolationAngularVelocity [get]
 Sets the default teleport interpolation angular velocity to be the rigidbody angular velocity, around the Z axis. For more details on how this field is used, see NetworkTransform.TeleportToRotation. More...
 
override int BaseWordCount [get]
 
- Properties inherited from NetworkRigidbodyBase
override int BaseWordCount [get]
 
- Properties inherited from NetworkTransform
virtual Vector3 DefaultTeleportInterpolationVelocity [get]
 The interpolation velocity used when calling TeleportToPosition and not specifying a value. By default, this value is Vector3.zero. Some behaviours like NetworkRigidbody and NetworkRigidbody2D override this property to provide better default values, like the latest known velocity of the rigid body. More...
 
virtual Vector3 DefaultTeleportInterpolationAngularVelocity [get]
 The interpolation angular velocity used when calling TeleportToRotation and not specifying a value. By default, this value is Vector3.zero. Some behaviours like NetworkRigidbody and NetworkRigidbody2D override this property to provide better default values, like the latest known angular velocity of the rigid body. More...
 
override int BaseWordCount [get]
 
- Properties inherited from NetworkPositionRotation
Transform Transform [get]
 Cached GameObject.transform reference. More...
 
virtual int BaseWordCount [get]
 Number of words used by this class on the networked data buffer, including all inherited fields, to serve for reference to inheritors. More...
 
override int PositionWordOffset [get]
 Implements NetworkAreaOfInterestBehaviour by defining the word offset from the base pointer to the field that carries the position data used for Area of Interest management. More...
 
- Properties inherited from NetworkAreaOfInterestBehaviour
abstract int PositionWordOffset [get]
 The int* offset for the Ptr, for the memory location of the position data. More...
 
- Properties inherited from NetworkBehaviour
InterpolationDataSources InterpolationDataSource [get, set]
 Get/Set the time frame this object is rendered in. More...
 
NetworkBehaviourId Id [get]
 The unique identifier for this network behaviour. More...
 
virtual ? int DynamicWordCount [get]
 Override this value for custom memory allocations. This is for advanced use cases only, and cannot be used if NetworkedAttribute is used in the derived class.
More...
 
virtual bool InvokeOnChangedForInitialNonZeroValues [get]
 Override this property to change whether initial non-zero values assigned to [Networked] properties invoke OnChanged callbacks. For clients the initial value comes from the simulation snapshot, not from what has been set locally in the inspector. More...
 
- Properties inherited from SimulationBehaviour
bool CanReceiveCallback [get]
 
virtual bool? HasInputAuthority [get]
 Returns true if the Simulation.LocalPlayer of the associated NetworkRunner is the designated as Input Authority for this network entity. More...
 
virtual bool? HasStateAuthority [get]
 Returns true if the associated NetworkRunner is the State Authority for this network entity. More...
 
virtual bool? IsProxy [get]
 Returns true if the associated NetworkRunner is neither the Input nor State Authority for this network entity. It is recommended to use !HasStateAuthority or !HasInputAuthority when possible instead, as this check requires evaluating both authorities - and is therefore less performant than the individual checks. More...
 

Additional Inherited Members

- Public Types inherited from NetworkRigidbodyBase
enum class  NetworkRigidbodyFlags : byte
 Networked flags representing a 2D or 3D rigid body state and characteristics. More...
 
- Public Types inherited from NetworkBehaviour
enum class  InterpolationDataSources
 Options for which time frame this object will render in. More...
 
- Public Attributes inherited from NetworkTransform
Spaces InterpolationSpace = Spaces.World
 If the InterpolationTarget should be interpolated in world space or in the local space of a networked parent. Interpolating in local space requires more computations, but gives more accurate visuals if/when a parent rotates. More...
 
Transform InterpolationTarget
 The Transform object used for smooth view interpolation. Should be a non-physics GameObject, typically a child of this GameObject or a separate object without colliders. More...
 
bool InterpolateErrorCorrection = true
 If the computed prediction error should be smoothly corrected on the InterpolationTarget according to the InterpolatedErrorCorrectionSettings. More...
 
InterpolatedErrorCorrectionSettings InterpolatedErrorCorrectionSettings
 A set of parameters to tune the interpolated correction of prediction error to be applied on the InterpolationTarget. More...
 
 bool
 Reads from this object's field holding information about whether the position and/or rotation values changed when written to the buffer. More...
 
- Public Attributes inherited from NetworkBehaviour
int * Ptr
 Pointer to the allocated memory associated with this Object. More...
 
int ObjectIndex
 The index of this NetworkBehaviour, in the NetworkObject.NetworkedBehaviours array. More...
 
bool InvokeRpc
 
int offset
 Gives access to the offset (in 32 bit words) and count (in 32 bit words) of this behaviour backing data More...
 
- Public Attributes inherited from SimulationBehaviour
NetworkRunner Runner
 The NetworkRunner this component is associated with. More...
 
NetworkObject Object
 The NetworkObject this component is associated with. May be null if this GameObject does not have a NetworkObject. More...
 
- Static Public Attributes inherited from NetworkTransform
static bool
 Reads from the networked data pointer by ptr a field holding information about whether the position and/or rotation values changed when written to the buffer. More...
 
- Static Protected Member Functions inherited from NetworkRigidbodyBase
static int ReadNetworkRigidbodyRawFlags (int *ptr)
 Reads from a field reserved to store the rigid body flags on the networked data pointed by ptr and returns the raw word value that might also carry flags specific to 2D or 3D rigid bodies. See also NetworkRigidbody.ReadNetworkRigidbodyFlags or NetworkRigidbody2D.ReadNetworkRigidbodyFlags. More...
 
static Vector3 ReadDragsAndMass (int *ptr, ReadAccuracy readAccuracy)
 Reads the values of a rigidbody drag, angular drag and mass field on the networked data pointed by ptr using the defined readAccuracy . The values are returned as the x, y and z values of a Vector3, respectively. More...
 
static void WriteNetworkRigidbodyRawFlags (int rawFlags, int *ptr)
 Writes to the field reserved to store the on this object's networked data. See also NetworkRigidbody.ReadNetworkRigidbodyFlags or NetworkRigidbody2D.ReadNetworkRigidbodyFlags. More...
 
static void WriteDragsAndMass (Vector3 values, int *ptr, WriteAccuracy writeAccuracy)
 Reads the values of a rigidbody drag, angular drag and mass field on the networked data pointed by ptr using the defined writeAccuracy . The values must be provided as the x, y and z values of a Vector3, respectively. More...
 

Detailed Description

Replicates a Unity Rigidbody state from the NetworkObject.StateAuthority to all other peers. Add this component to a GameObject with a Rigidbody component. A NetworkObject is required on this GameObject or a parent of this GameObject.

Member Function Documentation

◆ Awake()

override void Awake ( )
protectedvirtual

Implements Unity's Awake event function. If overriding this method in an inheritor, the base method should be called.

Reimplemented from NetworkPositionRotation.

◆ ReadAngularVelocity() [1/3]

float ReadAngularVelocity ( )

Reads from the field reserved to store the rigidbody angular velocity on this object's networked data using the default Runner position read accuracy.

◆ ReadAngularVelocity() [2/3]

float ReadAngularVelocity ( int *  ptr)

Reads from the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the default Runner position read accuracy.

◆ ReadAngularVelocity() [3/3]

static float ReadAngularVelocity ( int *  ptr,
ReadAccuracy  readAccuracy 
)
static

Reads from the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the defined readAccuracy .

◆ ReadGravityScale() [1/3]

float ReadGravityScale ( )

Reads from the field reserved to store the rigidbody gravity scale on this object's networked data using the default Runner position read accuracy.

◆ ReadGravityScale() [2/3]

float ReadGravityScale ( int *  ptr)

Reads from the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the default Runner position read accuracy.

◆ ReadGravityScale() [3/3]

static float ReadGravityScale ( int *  ptr,
ReadAccuracy  readAccuracy 
)
static

Reads from the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the defined readAccuracy .

◆ ReadNetworkRigidbodyFlags() [1/2]

static void ReadNetworkRigidbodyFlags ( int *  ptr,
out NetworkRigidbodyFlags  nrbFlags,
out RigidbodyConstraints2D  rbConstraints 
)
static

Reads from a field reserved to store the rigidbody flags and constraints on the networked data pointed by ptr .

◆ ReadNetworkRigidbodyFlags() [2/2]

void ReadNetworkRigidbodyFlags ( out NetworkRigidbodyFlags  nrbFlags,
out RigidbodyConstraints2D  rbConstraints 
)

Reads from a field reserved to store the rigidbody flags and constraints on this object's networked data.

◆ ReadRigidbodyPosition() [1/3]

Vector2 ReadRigidbodyPosition ( )

Reads from the field reserved to store the rigidbody position on this object's networked data using the default Runner position read accuracy.

◆ ReadRigidbodyPosition() [2/3]

Vector2 ReadRigidbodyPosition ( int *  ptr)

Reads from the field reserved to store the rigidbody position on the networked data pointed by ptr using the default Runner position read accuracy.

◆ ReadRigidbodyPosition() [3/3]

static Vector2 ReadRigidbodyPosition ( int *  ptr,
ReadAccuracy  readAccuracy 
)
static

Reads from the field reserved to store the rigidbody position on the networked data pointed by ptr using the defined readAccuracy .

◆ ReadRigidbodyRotation() [1/3]

float ReadRigidbodyRotation ( )

Reads from the field reserved to store the rigidbody rotation on this object's networked data using the default Runner rotation read accuracy.

◆ ReadRigidbodyRotation() [2/3]

float ReadRigidbodyRotation ( int *  ptr)

Reads from the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the default Runner rotation read accuracy.

◆ ReadRigidbodyRotation() [3/3]

static float ReadRigidbodyRotation ( int *  ptr,
ReadAccuracy  readAccuracy 
)
static

Reads from the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the defined readAccuracy .

◆ ReadVelocity() [1/3]

Vector2 ReadVelocity ( )

Reads from the field reserved to store the rigidbody velocity on this object's networked data using the default Runner position read accuracy.

◆ ReadVelocity() [2/3]

Vector2 ReadVelocity ( int *  ptr)

Reads from the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the default Runner position read accuracy.

◆ ReadVelocity() [3/3]

static Vector2 ReadVelocity ( int *  ptr,
ReadAccuracy  readAccuracy 
)
static

Reads from the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the defined readAccuracy .

◆ SetCollisionDetectionMode()

sealed override void SetCollisionDetectionMode ( CollisionDetectionMode  mode)
protectedvirtual

Sets the Rigidbody2D.collisionDetectionMode to CollisionDetectionMode2D.Discrete if mode is CollisionDetectionMode.Discrete, and to CollisionDetectionMode2D.Continuous otherwise.

Implements NetworkRigidbodyBase.

◆ SetIsKinematic()

sealed override void SetIsKinematic ( bool  value)
protectedvirtual

Sets the Rigidbody UnityEngine.Rigidbody2D.isKinematic field to value .

Implements NetworkRigidbodyBase.

◆ Spawned()

override void Spawned ( )
virtual

Implements NetworkBehaviour.Spawned. If overriding this method in an inheritor, the base method should be called.

Reimplemented from NetworkPositionRotation.

◆ WriteAngularVelocity() [1/3]

void WriteAngularVelocity ( float  angularVel)

Writes to the field reserved to store the rigidbody angular velocity on this object's networked data using the default Runner position write accuracy.

◆ WriteAngularVelocity() [2/3]

void WriteAngularVelocity ( float  angularVel,
int *  ptr 
)

Writes to the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the default Runner position write accuracy.

◆ WriteAngularVelocity() [3/3]

static void WriteAngularVelocity ( float  angularVel,
int *  ptr,
WriteAccuracy  writeAccuracy 
)
static

Writes to the field reserved to store the rigidbody angular velocity on the networked data pointed by ptr using the defined writeAccuracy .

◆ WriteGravityScale() [1/3]

void WriteGravityScale ( float  gravityScale)

Writes to the field reserved to store the rigidbody gravity scale on this object's networked data using the default Runner position write accuracy.

◆ WriteGravityScale() [2/3]

void WriteGravityScale ( float  gravityScale,
int *  ptr 
)

Writes to the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the default Runner position write accuracy.

◆ WriteGravityScale() [3/3]

static void WriteGravityScale ( float  gravityScale,
int *  ptr,
WriteAccuracy  writeAccuracy 
)
static

Writes to the field reserved to store the rigidbody gravity scale on the networked data pointed by ptr using the defined writeAccuracy .

◆ WriteNetworkRigidbodyFlags() [1/2]

void WriteNetworkRigidbodyFlags ( NetworkRigidbodyFlags  nrbFlags,
RigidbodyConstraints2D  rbConstraints 
)

Writes to a field reserved to store the rigidbody flags and constraints on this object's networked data.

◆ WriteNetworkRigidbodyFlags() [2/2]

static void WriteNetworkRigidbodyFlags ( NetworkRigidbodyFlags  nrbFlags,
RigidbodyConstraints2D  rbConstraints,
int *  ptr 
)
static

Writes a field reserved to store the rigidbody flags and constraints on the networked data pointed by ptr .

◆ WriteRigidbodyPosition() [1/3]

void WriteRigidbodyPosition ( Vector2  rbPos)

Writes to the field reserved to store the rigidbody position on this object's networked data using the default Runner position write accuracy.

◆ WriteRigidbodyPosition() [2/3]

void WriteRigidbodyPosition ( Vector2  rbPos,
int *  ptr 
)

Writes to the field reserved to store the rigidbody position on the networked data pointed by ptr using the default Runner position write accuracy.

◆ WriteRigidbodyPosition() [3/3]

static void WriteRigidbodyPosition ( Vector2  rbPos,
int *  ptr,
WriteAccuracy  writeAccuracy 
)
static

Writes to the field reserved to store the rigidbody position on the networked data pointed by ptr using the defined writeAccuracy .

◆ WriteRigidbodyRotation() [1/3]

void WriteRigidbodyRotation ( float  rbRot)

Writes to the field reserved to store the rigidbody rotation on this object's networked data using the default Runner rotation write accuracy.

◆ WriteRigidbodyRotation() [2/3]

void WriteRigidbodyRotation ( float  rbRot,
int *  ptr 
)

Writes to the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the default Runner rotation write accuracy.

◆ WriteRigidbodyRotation() [3/3]

static void WriteRigidbodyRotation ( float  rbRot,
int *  ptr,
WriteAccuracy  writeAccuracy 
)
static

Writes to the field reserved to store the rigidbody rotation on the networked data pointed by ptr using the defined writeAccuracy .

◆ WriteVelocity() [1/3]

void WriteVelocity ( Vector2  velocity)

Writes to the field reserved to store the rigidbody velocity on this object's networked data using the default Runner position write accuracy.

◆ WriteVelocity() [2/3]

void WriteVelocity ( Vector2  velocity,
int *  ptr 
)

Writes to the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the default Runner position write accuracy.

◆ WriteVelocity() [3/3]

static void WriteVelocity ( Vector2  velocity,
int *  ptr,
WriteAccuracy  writeAccuracy 
)
static

Writes to the field reserved to store the rigidbody velocity on the networked data pointed by ptr using the defined writeAccuracy .

Member Data Documentation

◆ WORD_COUNT_NRB_2D

const int WORD_COUNT_NRB_2D = OffsetGravityScl + WordCountGravityScl
staticprotected

Number of words used by a NetworkRigidbody2D instance on its networked data, including all inherited fields.

Property Documentation

◆ DefaultTeleportInterpolationAngularVelocity

override Vector3 DefaultTeleportInterpolationAngularVelocity
getprotected

Sets the default teleport interpolation angular velocity to be the rigidbody angular velocity, around the Z axis. For more details on how this field is used, see NetworkTransform.TeleportToRotation.

◆ DefaultTeleportInterpolationVelocity

override Vector3 DefaultTeleportInterpolationVelocity
getprotected

Sets the default teleport interpolation velocity to be the rigidbody velocity. For more details on how this field is used, see NetworkTransform.TeleportToPosition.

◆ Rigidbody

Rigidbody2D Rigidbody
get

Cached reference of this object's Rigidbody2D component.