Assets/Scripts/Player/Movement/SensorOnOff.cs
/// <summary>
/// Sent when another object enters a trigger collider attached to this
/// object (2D physics only).
/// </summary>
/// <param name="other">The other Collider2D involved in this collision.</param>
Sent when another object enters a trigger collider attached to this
object (2D physics only).
Sent when another object enters a trigger collider attached to this object ( 2D physics only ) .
void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("env"))
        {
            touchCount++;
        }
    }
void OnTriggerEnter2D ( Collider2D other ) { if ( other . CompareTag ( " " ) ) { touchCount ++ ; } }
Sent when another object enters a trigger collider attached to this
object (2D physics only).
Sent when another object enters a trigger collider attached to this object ( 2D physics only ) .
other
Collider2D
The other Collider2D involved in this collision.
The other Collider2D involved in this collision .