A class in Root.Township, Alta.Logic.
Server: outputs this object's position (world or local) through a position event once on spawn, and again whenever it moves if set to. Saves its two settings.
Constructors
| Member | What it is |
|---|
PositionProvider() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private Transform cachedTransform | This object's transform, cached on spawn. |
private bool isLocalPosition | Send the local position instead of the world position. |
private bool isMoving | Keep sending the position as the object moves. |
private PositionHandler positionSet | Event the position is sent through. |
private IUnityUpdateMethod updatePosition | Handle for the per-frame UpdatePosition call. |
Properties
1 private and internal property
| Member | What it is |
|---|
private int IBuildRendererBakeable.SortingOrder { get; } | Bake order; always 0. |
Methods
| Member | What it is |
|---|
override void InitializeAsServer(SpawnData spawnData) | Server: caches the transform and runs Setup. |
void Setup(bool isLocalPosition, bool isMoving) | One overload sends the position now and starts watching for movement if isMoving; the other just sets isLocalPosition and isMoving. |
5 private and internal methods
| Member | What it is |
|---|
private void IBuildRendererBakeable.Bake(bool isSaving) | Empty build bake hook. |
private void IBuildRendererBakeable.Clean() | Empty build bake hook. |
private void OnDestroy() | Stops the per-frame position check. |
private void Setup() | One overload sends the position now and starts watching for movement if isMoving; the other just sets isLocalPosition and isMoving. |
private void UpdatePosition() | Each frame, sends the position again if the transform changed. |