A class in Root.Township, the global namespace.
Group of rigidbodies on a player character that can be set kinematic, moved or given a velocity together. When the player teleports, it sets their velocity to the teleport offset.
Constructors
| Member | What it is |
|---|
RigidbodyGroup() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private bool isKinematic | Last kinematic value set. |
private Vector3 localPosition | Last local position set. |
private PlayerCharacter player | Backing field for Player. |
private Vector3 velocity | Last velocity set. |
private float velocityMultiplier | Serialized multiplier; not used in this code. |
Properties
| Member | What it is |
|---|
bool IsKinematic { set; } | Sets every rigidbody kinematic or not. |
Vector3 LocalPosition { set; } | Sets every rigidbody's local position. |
Vector3 Velocity { set; } | Sets every rigidbody's velocity. |
1 private and internal property
| Member | What it is |
|---|
private PlayerCharacter Player { get; } | Player character on this object, fetched on first use. |
Methods
3 private and internal methods
| Member | What it is |
|---|
private void OnDisable() | Stops listening for player teleports. |
private void OnEnable() | Listens for the player's locomotion position changes. |
private void PlayerAboutToTeleport(PlayerController player, Vector3 oldPosition, Vector3 newPosition, LocomotionFunction function) | Sets every rigidbody's velocity to the teleport offset. |