Skip to main content

PositionSwapper

A class in Root.Township, the global namespace.

Debug component: pressing a key moves a target object to the next of several anchor objects in turn.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private int iIndex of the next position.
private KeyCode keyKey that moves the target.
private GameObject[] positionsAnchors to cycle through.
private GameObject targetObject that gets moved.

Methods​

1 private and internal method
MemberWhat it is
private void Update()On the key press, parents target to the next position and zeroes its local position and rotation.