Translate JavaScript to C#

Hi if someone could help me translate this code into C# that would be appreciated I have already tried the m2h translator , thanks in advance

 private var shooting = false;
 var shotSpacer = 0.1; //time between shots in burst
 var burstSpacer = 0; //how long after a firing burst you must wait to fire another
 var burstShots = 3; //number of shots in a burst
 private var remainingShots : int;
 var projectile : Rigidbody; //your bullet object
 var speed = 5;
 
 function Update () {
     if(Input.GetButtonDown("Fire1") && !shooting){
         BurstFire ();
     }
 }
 function BurstFire () {
     shooting = true;
     remainingShots = burstShots;
     InvokeRepeating("Fire", 0, shotSpacer);
     yield WaitForSeconds(burstSpacer);
     shooting = false;
 }
 
 function Fire () {
     if(remainingShots > 0){
         clone = Instantiate(projectile, transform.position, transform.rotation);
         clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));
         remainingShots --;
     }else{
         CancelInvoke();
     }
 }
     
{     }

Here is the converted code. You did not provide a name for the class so I used FireWeapon as a class name. Change it to what you like.

using UnityEngine;
using System;
using System.Collections;


public class FireWeapon:MonoBehaviour
{
    bool shooting = false;
    public float shotSpacer = 0.1f; //time between shots in burst
    public int burstSpacer = 0; //how long after a firing burst you must wait to fire another
    public int burstShots = 3; //number of shots in a burst
    int remainingShots;
    public Rigidbody projectile; //your bullet object
    public int speed = 5;
    
    public void Update()
    {
        if(Input.GetButtonDown("Fire1") && !shooting)
        {
            StartCoroutine(BurstFire ());
        }
    }
    
    public IEnumerator BurstFire()
    {
        shooting = true;
        remainingShots = burstShots;
        InvokeRepeating("Fire", 0.0f, shotSpacer);
        yield return new WaitForSeconds((float)burstSpacer);
        shooting = false;
    }
    
    public void Fire()
    {
        if(remainingShots > 0)
        {
            Rigidbody clone = (Rigidbody)Instantiate(projectile, transform.position, transform.rotation);
            clone.velocity = transform.TransformDirection( new Vector3 (0.0f, 0.0f, (float)speed));
            remainingShots --;
        }
        else
        {
            CancelInvoke();
        }
    }
}