Example #1
0
 void Reload()
 {
     if ((R_gage.GetComponent <Image>().fillAmount += ReloadTime * Time.deltaTime) > 0.99f)
     {
         IsReload           = false;
         CurrentBulletCount = MaxOfBullet;
         R_gage.GetComponent <Image>().fillAmount = 0;
         B_gage.GetComponent <Image>().fillAmount = 1;
     }
     if (!Adsrc.GetComponent <AudioSource>().isPlaying)
     {
         Adsrc.clip = ReloadClip_2;
         Adsrc.Play();
     }
 }
Example #2
0
    void Shooting()
    {
        if (--CurrentBulletCount >= 0)
        {
            GameObject tBullet = Instantiate(bullet_Prefab) as GameObject;
            playerHead.GetComponent <ParticleSystem>().Play();
            Adsrc.clip = ShootingClip;
            Adsrc.Play();
            B_gage.GetComponent <Image>().fillAmount          -= 1f / MaxOfBullet;
            Gun_ShootingLight.GetComponent <Light>().intensity = ShootingLightIntensity;

            tvRecoil = V_recoil;
            thRecoil = Random.Range(-H_recoil, H_recoil);

            ShootingLight_frame = ShootingLightTime;
        }
        else
        {
            Adsrc.clip = NoBulletClip;
            Adsrc.Play();
        }
    }