public override void ShootBullet() { if (hasTarget && Time.time > lastAttackTime + fireRate) { for (int i = 0; i < 3; i++) { GameObject bullet1 = ObjectPoolingManager.instance.GetQueue(ObjectPoolingManager.instance.tBullet2Queue); GameObject bullet2 = ObjectPoolingManager.instance.GetQueue(ObjectPoolingManager.instance.tBullet2Queue); if (bullet1 != null) { bullet1.transform.position = FirePosition.position; bullet2.transform.position = firePosition2.position; Tbullet2 _bullet1 = bullet1.GetComponent <Tbullet2>(); _bullet1.damage = damage; _bullet1.SetRemoveTime(1); _bullet1.SetVelocityStart(TitleSetting.bulletSpeed * 0.6f, transform.forward + transform.right * (i - 1), 0.05f); Tbullet2 _bullet2 = bullet2.GetComponent <Tbullet2>(); _bullet2.damage = damage; _bullet2.SetRemoveTime(1); _bullet2.SetVelocityStart(TitleSetting.bulletSpeed * 0.6f, transform.forward + transform.right * (i - 1), 0.05f); } } lastAttackTime = Time.time; } }
public override void ShootBullet() { enemyAnimator.SetBool("Shoot Attack", true); for (int i = 0; i < 10; i++) { GameObject bullet = ObjectPoolingManager.instance.GetQueue(ObjectPoolingManager.instance.tBullet2Queue); if (bullet != null) { bullet.transform.position = FirePosition.position; Tbullet2 _bullet = bullet.GetComponent <Tbullet2>(); _bullet.damage = damage; _bullet.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); _bullet.SetRemoveTime(8); _bullet.SetVelocityStart(TitleSetting.bulletSpeed, Quaternion.Euler(0, 36f * i, 0) * transform.forward, 0.3f); } } }