public void Fire(float fireStrategyOverflowDt) { if (gameObject.activeSelf && FireTimer.Activated) { var bullets = PoolManager.Instance.BulletPool.GetMany <OthelloBullet>(Level, FirePosition, Level); float offsetX = -(BulletSpread * (Level - 1) * 0.5f); for (int i = 0; i < bullets.Length; i++) { OthelloBullet bullet = bullets[i]; bullet.OthelloDamage = Damage; bullet.PositionX += offsetX; bullet.RunFrame(fireStrategyOverflowDt, fireStrategyOverflowDt); if (!SpaceUtil.PointIsInBounds(bullet.transform.position)) { bullet.RunTask(GameTaskFunc.DeactivateSelf(bullet)); } offsetX += BulletSpread; } FireTimer.TouchTimer(); } }
public void CreateRaindrop(Vector3 position, int damage) { if (SpaceUtil.PointIsInBounds(position)) { var raindrop = (RaindropBullet)MonsoonPool.Get(); raindrop.transform.position = position; raindrop.RaindropDamage = damage; raindrop.OnSpawn(); raindrop.PlayFireSound(); } }