Example #1
0
        public void Explode(GameObject projectile, GameObject explosion, Vector3 position, Quaternion rotation)
        {
            SpawnPool level_pool = PoolManager.Pools[CurrentLevel.GetCurrentLevelPoolName()];

            Despawner.Despawn(level_pool, projectile);
            level_pool.Spawn(explosion, position, rotation);
            DealDamage(projectile.transform, area_of_effect);
        }
Example #2
0
        public void InstantiatePrefab(GameObject unit)
        {
            SpawnPool level_pool  = PoolManager.Pools[CurrentLevel.GetCurrentLevelPoolName()];
            Transform unit_entity = level_pool.Spawn(projectile, transform.position, transform.rotation);

            Frostbolt frostbolt = unit_entity.GetComponent <Frostbolt>();

            frostbolt.target         = unit;
            frostbolt.movement_speed = movement_speed;
            frostbolt.SetProjectile(area_of_effect, base_damage, damage_distance_factor);
        }
Example #3
0
        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);
            }
        }