コード例 #1
0
 private void OnTriggerStay(Collider other)
 {
     if (other.tag == "Ice" || other.tag == "IceWall")
     {
         GroundDetected?.Invoke();
     }
 }
コード例 #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Ice" || other.tag == "IceWall")
     {
         Debug.Log("ground entered");
         GroundDetected?.Invoke();
     }
 }
コード例 #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;
     }
 }
コード例 #4
0
 private void OnTriggerEnter(Collider other)
 {
     GroundDetected?.Invoke();
 }