Files
UltimateFishing2020/Assets/Scripts/Assembly-CSharp/CrouchDetection.cs
2026-03-04 10:03:45 +08:00

26 lines
526 B
C#

using UnityEngine;
public class CrouchDetection : MonoBehaviour
{
public RealWaterCollider Collider;
[Tooltip("The crouch key you are using.")]
public string CrouchKeyIdentifier = "c";
private void Update()
{
if (Input.GetKey(CrouchKeyIdentifier))
{
Collider.SetCrouching(val: true);
Collider.SetCheckCollisions(val: false);
Collider.Reset();
}
if (Input.GetKeyUp(CrouchKeyIdentifier))
{
Collider.SetCrouching(val: false);
Collider.SetCheckCollisions(val: true);
Collider.Reset();
}
}
}