public static GameObject GetResInDic(string path) { if (LoadResDic == null || LoadResDic.Count == 0) { return(null); } GameObject obj = null; if (LoadResDic.TryGetValue(path, out obj)) { return(obj); } return(null); }
public static void DestroyLoad(string path) { if (LoadResDic == null || LoadResDic.Count == 0) { return; } GameObject obj = null; if (LoadResDic.TryGetValue(path, out obj) && obj != null) { GameObject.DestroyImmediate(obj); LoadResDic.Remove(path); //System.GC.Collect(); } }
public static void DestroyLoad(GameObject obj) { if (LoadResDic == null || LoadResDic.Count == 0) { return; } if (obj == null) { return; } foreach (string key in LoadResDic.Keys) { GameObject objLoad; if (LoadResDic.TryGetValue(key, out objLoad) && objLoad == obj) { GameObject.DestroyImmediate(obj); LoadResDic.Remove(key); break; } } }