コード例 #1
0
ファイル: Enermy.cs プロジェクト: 1520386112/TANK
 private void Fire()
 {
     if (projectileMG.AbleToShoot())
     {
         lastFireTime = Time.time;
     }
     lastFireTime = Time.time;
     realTimeBeforeNextFireTime = Random.Range(minTimeBeforeNextFireTime, maxTimeBeforeNextFireTime);
 }
コード例 #2
0
 private void Fire()
 {
     if (Input.GetButton("Fire1") && timeToFire < Time.time)
     {
         if (projectileMG.AbleToShoot())
         {
             AudioManager.instance.Play("Shoot");
         }
         projectileMG.Shoot();
         timeToFire = Time.time + 1 / fireRate;
     }
 }
コード例 #3
0
 private void Fire()
 {
     if (Input.GetButton(fireAxitName))
     {
         if (Time.time - lastFireTime >= 1.0f / fireRate)
         {
             if (projectileMG.AbleToShoot())
             {
                 lastFireTime = Time.time;
             }
         }
     }
 }