Exemple #1
0
    void Update()
    {
        if (Input.GetButton("Fire1") && Time.time > nextFire)
        {
            nextFire = Time.time + fireRate;
            GameObject boltObject = Instantiate(shot, shotSpawn.position, shotSpawn.rotation);
            Bolt       bolt       = boltObject.GetComponent <Bolt>();
            bolt.SetOnChargeUpAction(IncreaseCharge);

            GetComponent <AudioSource>().Play();
        }
    }