using System; using System.Collections.Generic; using UnityEngine; public class IndicatorInfo : MonoBehaviourSingletonTemplate { [RuntimeInitializeOnLoadMethod] static void OnRuntimeMethodLoad() { var go = new GameObject("IndicatorInfo").AddComponent(); DontDestroyOnLoad(go.gameObject); } Dictionary dic_indicator = new Dictionary(); public void Make_Indicator(string indicatorName, Action action) { if (dic_indicator.ContainsKey(indicatorName)) action(dic_indicator[indicatorName]); else AddrResourceMgr.Ins.LoadObject($"Assets/Res_Addr/Obj/{indicatorName}.prefab", handle => { var go = DSUtil.Get_Clone(handle.Result); go.transform.parent = transform; AddrResourceMgr.Ins.Set_AddressableReleaseSelf(go); action(go); dic_indicator.Add(indicatorName, go); }); } }