Ejemplo n.º 1
0
 public static void GetAtlasAsync(string name, System.Action <UIAtlas> ac)
 {
     if (m_atlas_Cache.ContainsKey(name))
     {
         if (m_atlas_Cache[name] == null)
         {
             Debuger.Log(tag, "GetAtlas", "this should never happen on getatlas");
             UIAtlas ua = ResMgr.GetAtlas(name);
             m_atlas_Cache[name] = ua;
         }
         if (ac != null)
         {
             ac(m_atlas_Cache[name]);
         }
     }
     else
     {
         ResMgr.GetAtlasAsync(name, (ua) => {
             m_atlas_Cache.Add(name, ua);
             if (ac != null)
             {
                 ac(ua);
             }
         });
     }
 }
Ejemplo n.º 2
0
 //如果,如果有如果的话,就添加一个表,分别是iconname和Atlasname映射的工具表,由打图集工具自动生成
 public static UIAtlas GetAtlas(string name)
 {
     if (m_atlas_Cache.ContainsKey(name))
     {
         if (m_atlas_Cache[name] == null)
         {
             Debuger.Log(tag, "GetAtlas", "this should never happen on getatlas");
             UIAtlas ua = ResMgr.GetAtlas(name);
             m_atlas_Cache[name] = ua;
         }
         return(m_atlas_Cache[name]);
     }
     else
     {
         UIAtlas ua = ResMgr.GetAtlas(name);
         m_atlas_Cache.Add(name, ua);
         return(ua);
     }
 }