// updating // // before the start: // protected override void Awake() { base.Awake(); if (!leftInstance) { // have just the right hand set the following static variables since they need be set only once // targetBodyCollider = Player.instance.GetComponentInChildren <CapsuleCollider>(); skiingSettings = targetBodyCollider.GetComponent <SkiingSettings>(); frictionNonskiing = targetBodyCollider.material; } }
public static bool skiing = false; // tracking: whether the player is currently skiing // methods // // method: update the player body collider's friction based on whether it is skiing // public static void updateBodyFriction() => MoonMotionBody.capsuleCollider.material = skiing ? SkiingSettings.skiingFrictionToUse() : SkiingSettings.frictionNonskiing;