Exemplo n.º 1
0
 public void LoadScene(string asbName, string sceneName, bool sync, bool add, Action <float> callback = null, LuaFunction luaFunc = null)
 {
     ResManager.Instance.LoadScene(asbName, sceneName, sync, add, (float progress) =>
     {
         if (progress.Equals(0))
         {
             //开始载入场景时,计数+1
             mCount.AddObj(curGroup, asbName, mCount.GetObj(asbName, sceneName) + 1);
         }
         if (progress.Equals(-1f))
         {
             LogFile.Warn("加载场景失败, sceneName :{0} , asbName :{1}", sceneName, asbName);
         }
         if (null != callback)
         {
             callback(progress);
         }
     }, luaFunc);
 }
Exemplo n.º 2
0
        private void _addAsb2Group(string asbName, string groupName, string[] obj)
        {
            int count = mGroupsCounter.GetObj(groupName, asbName);

            mGroupsCounter.AddObj(groupName, asbName, count + 1);
            Dictionary <string, HashSet <string> > groupDict;

            if (!mGroupObjs.TryGetValue(groupName, out groupDict))
            {
                groupDict = new Dictionary <string, HashSet <string> >();
            }
            HashSet <string> asbSet;

            if (!groupDict.TryGetValue(asbName, out asbSet))
            {
                asbSet = new HashSet <string>();
            }
            //并集
            asbSet.UnionWith(obj);
            groupDict[asbName]    = asbSet;
            mGroupObjs[groupName] = groupDict;
        }
Exemplo n.º 3
0
 public T Get(string asbName, string assetName)
 {
     assetName = FixResName(assetName);
     return(mDict.GetObj(asbName, assetName));
 }