public void InstantiatePrefab(Vector3 throw_point) { SpawnPool level_pool = PoolManager.Pools[CurrentLevel.GetCurrentLevelPoolName()]; Transform unit_entity = level_pool.Spawn(projectile, transform.position, transform.rotation); if (!random) { CannonBall cannon_ball = unit_entity.GetComponent <CannonBall>(); cannon_ball.coordinate = throw_point; cannon_ball.movement_speed = movement_speed; cannon_ball.catapult_position = transform.position; cannon_ball.SetProjectile(area_of_effect, base_damage, damage_distance_factor); } else { MortarShell mortar_shell = unit_entity.GetComponent <MortarShell>(); mortar_shell.coordinate_on_platform = throw_point; mortar_shell.movement_speed = movement_speed; mortar_shell.platform = platform; mortar_shell.SetProjectile(area_of_effect, base_damage, damage_distance_factor); } }