Example #1
0
 private void OnTriggerStay(Collider other)
 {
     if (other.tag == "Ice" || other.tag == "IceWall")
     {
         GroundDetected?.Invoke();
     }
 }
Example #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Ice" || other.tag == "IceWall")
     {
         Debug.Log("ground entered");
         GroundDetected?.Invoke();
     }
 }
Example #3
0
 private void DetectGround()
 {
     if (Physics.Raycast(transform.position, Vector3.down, _detectLength, _groundLayer))
     {
         if (_isGrounded == false)
         {
             //Debug.Log("Ground Detected");
             GroundDetected?.Invoke();
             _isGrounded = true;
         }
     }
     else if (_isGrounded == true)
     {
         //Debug.Log("GroundVanished");
         GroundVanished?.Invoke();
         _isGrounded = false;
     }
 }
Example #4
0
 private void OnTriggerEnter(Collider other)
 {
     GroundDetected?.Invoke();
 }