jumping with character controller unity

C#
 public float jumpSpeed = 8.0F; public float gravity = 20.0F; private Vector3 moveDirection = Vector3.zero;  void Update() {     if (controller.isGrounded && Input.GetButton("Jump")) {         moveDirection.y = jumpSpeed;     }     moveDirection.y -= gravity * Time.deltaTime;     controller.Move(moveDirection * Time.deltaTime); }
Source

Also in C#: