Skip to main content

PositionSerializer<T>

A class in Root.Township, the global namespace.

A PositionSerializer that can reparent a target of type T itself, through callbacks it was built with. NetworkRigidbody uses it to parent a body to the platform it rides on.

Constructors​

MemberWhat it is
PositionSerializer(NetworkEntity entity, Func<T, bool> isParentNull, Action<T> makeParentNull)Creates a PositionSerializer from entity, isParentNull and makeParentNull.

Fields​

2 private and internal fields
MemberWhat it is
private Func<T, bool> isParentNullCallback that tells whether the target currently has no parent.
private Action<T> makeParentNullCallback that unparents the target.

Methods​

MemberWhat it is
void FixParent(T target, Transform targetTransform)Parents the target's transform to the current movement context, or clears its parent through makeParentNull when the context is gone.

Used in​

Members of other types that take, return or hold a PositionSerializer&lt;T>: