private void Update() { Transform __playerRoot = playerController.meshRoot; Ray __ray = new Ray(__playerRoot.position, -__playerRoot.up); if (Physics.Raycast(__ray, out RaycastHit __hitInfo)) { _gravityDirection = -__hitInfo.normal * 30; CGDebug.DrawRay(__hitInfo.point, -_gravityDirection); } else { _gravityDirection = playerController.configs.gravity; } playerController._gravity = _gravityDirection; }
private void Debug() { CGDebug.DrawRay(meshRoot.position, _gravity).Color(Color.green); //CGDebug.DrawRay() }