/* * @Author: 白哉 * @Description: * @Date: 2025年08月07日 星期四 15:08:51 * @Modify: */ using System; using System.Collections.Generic; using UnityEngine; namespace Logic.PrefabPool { public enum PrefabType { Fog, Treasure, Hurt, Fire, Die, Flag, Heal, Skill, Damage, Max, } public class PrefabConfig: ScriptableObject { public List PrefabList = new List(); private Dictionary _prefabDict = new Dictionary(); public void RefreshPrefabDict() { if (_prefabDict.Count == PrefabList.Count) return; _prefabDict.Clear(); foreach (var item in PrefabList) _prefabDict[item.Type] = item; } public PrefabItem GetPrefab(PrefabType type) { RefreshPrefabDict(); return _prefabDict.GetValueOrDefault(type); } } [Serializable] public class PrefabItem { public PrefabType Type; public GameObject Prefab; } }