コード例 #1
0
 public void Shoot()
 {
     if (transform.parent.parent.gameObject.tag == "Player")
     {
         if (Time.time > nextShotTime)
         {
             nextShotTime = Time.time + 200f / 1000f;
             CDProjectile newProjectile = Instantiate(projectile, muzzle.position, muzzle.rotation) as CDProjectile;
         }
     }
 }
コード例 #2
0
 public void EnemyShoot()
 {
     if (transform.parent.parent.gameObject.tag == "Enemy")
     {
         if (Time.time > nextShotTime)
         {
             nextShotTime = Time.time + msBetweenShots / 1000f;
             CDProjectile newProjectile = Instantiate(projectile, muzzle.position, muzzle.rotation) as CDProjectile;
         }
     }
 }