コード例 #1
0
    private void ShootTargetEnemy()
    {
        var projectile       = PoolManager.GetFromPool(currentTowerStats.poolableProjectile);
        var bulletController = projectile.GetComponent <BulletController>();

        if (bulletController == null)
        {
            Debug.LogWarning("Projectile must contain bullet controller");
        }
        else
        {
            bulletController.damage = currentTowerStats.GetCurrentDamage();
            bulletController.FireAt(targetEnemy, projectileStartPosition);
            shootingTimer = currentTowerStats.GetFireSpeed();
        }
    }