35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
public class Global
|
|
{
|
|
public static List<Enemy> Enemies = new List<Enemy>();
|
|
|
|
public static Dictionary<int, Enemy> LockedEnemies = new Dictionary<int, Enemy>();
|
|
//public static Dictionary<string, List<Transform>> ShotBulletQueues = new Dictionary<string, List<Transform>>();
|
|
//public static Dictionary<string, List<Transform>> ShotMuzzleQueues = new Dictionary<string, List<Transform>>();
|
|
//public static Dictionary<string, List<Transform>> ShotImpactQueues = new Dictionary<string, List<Transform>>();
|
|
|
|
|
|
|
|
public static void DespawnEnemy(Enemy enemy)
|
|
{
|
|
if (Enemies.Contains(enemy))
|
|
{
|
|
Enemies.Remove(enemy);
|
|
Enemies.RemoveAll(e => e == null);
|
|
if (!enemy.IsDestroyed())
|
|
{
|
|
Object.Destroy(enemy.gameObject);
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// Debug.LogError("Enemy not found in the list.");
|
|
//}
|
|
}
|
|
|
|
} |