A class in Root.Township, the global namespace.
Debug component on a player character: holding the Debug1 action on both hands raises global gravity until it is reversed, then it drops back.
Constructors
| Member | What it is |
|---|
GravityChanger() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private float defaultGravity | Gravity Y at start. |
private float gravityChange | Gravity change per frame. |
private Coroutine gravityUpCoroutine | Running raise coroutine. |
private PlayerCharacter playerCharacter | Backing field for PlayerCharacter. |
Properties
Methods
4 private and internal methods
| Member | What it is |
|---|
private IEnumerator BringGravityDown() (iterator) | Coroutine that lowers Physics.gravity back to the default. |
private IEnumerator BringGravityUp() (iterator) | Coroutine that raises gravity each frame while both Debug1 actions are held, with haptics, then calls BringGravityDown. |
private void ChangeGravity(PlayerInput controller) | Restarts BringGravityUp when Debug1 starts on either hand. |
private void Start() | Saves the default gravity and hooks Debug1 on both controllers. |