예제 #1
0
    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);
    }
예제 #2
0
    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();
        }
    }
예제 #3
0
 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;
         }
     }
 }