Skip to main content

NetworkedIKBone

A class in Root.Township, the global namespace.

Syncs one transform's local rotation from the server to clients, who blend toward it in fixed update.

Constructors​

MemberWhat it is
NetworkedIKBone()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

MemberWhat it is
static AccumulativeAverageCount prepareForWriteTimerShared timing stats for PrepareForWrite.
static AccumulativeAverageCount serializeTimerShared timing stats for Serialize.
8 private and internal fields
MemberWhat it is
private float angleThresholdDegrees the bone must turn before it is sent again.
private Transform cachedTransformTransform being rotated.
private float fixedUpdateLerpTimeBlend factor per fixed update.
private bool isInitializedSet by Initialize; blending waits for it.
private Quaternion latestRotationLast blended rotation.
private Quaternion rotationLast sent or received rotation.
private float snapDistanceUnused in this build.
private const int UnchangedResendConstant 30; unused in this build.

Properties​

MemberWhat it is
float LastSyncTime { get; private set; }Time of the last sync, or 0 if none yet.
3 private and internal properties
MemberWhat it is
private int Alta.Networking.INetworkSerialized.MaximumBits { get; }33 bits.
private AccumulativeAverageCount Alta.Networking.INetworkSerialized.PrepareForWriteTimer { get; }Returns the shared prepareForWriteTimer.
private AccumulativeAverageCount Alta.Networking.INetworkSerialized.SerializeTimer { get; }Returns the shared serializeTimer.

Methods​

MemberWhat it is
override void Initialize()Marks the component initialized.
bool PrepareForWrite(bool isWriteFull)True if the rotation has moved more than angleThreshold since it was last sent.
void Serialize(Stream stream, bool isWriteFull)Writes or reads a flag and the compressed rotation.
2 private and internal methods
MemberWhat it is
private void FixedUpdate()Client: blends toward the received rotation.
private void HandleRemote()Blends the transform toward the received rotation once one has arrived.