Skip to main content

DebugClimbable

A class in Root.Township, the global namespace.

Test Climbable that tints its material by grip pressure and, when it breaks, shrinks and can't be gripped for a few seconds.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private Color aColour at no pressure.
private Color bColour at full pressure.
private float breakDurationSeconds it stays broken.
private bool isInstancedMeant to track whether the material was copied; never set to true.
private Renderer rendererRenderer that gets tinted.

Methods​

MemberWhat it is
override bool ApplyPressure(Vector3 pressure)Applies pressure as normal, tints from a to b by pressure ratio, and starts the break routine when the grip fails.
2 private and internal methods
MemberWhat it is
private IEnumerator HandleBreak() (iterator)Shrinks the object to a tenth and blocks gripping for breakDuration, then restores it.
private void OnDestroy()Frees the instanced material if isInstanced is set (it never is).