Esempio n. 1
0
        public IEnumerator LoadResGroup(string groupName)
        {
            //SimulationMode doesn't need to load again, because all data is loaded on init
            if (ResMgr.SimulationMode)
            {
                yield break;
            }

            if (mResGroups.Exists(_ => string.Equals(_.GroupName, groupName)))
            {
                yield break;
            }

            ResDataGroup group = new ResDataGroup(groupName);

            mResGroups.Add(group);
            yield return(group.Load());
        }
Esempio n. 2
0
        public bool ReleaseResGroup(string groupName)
        {
            //SimulationMode can't unload, because all data is in one group
            if (ResMgr.SimulationMode)
            {
                return(false);
            }

            ResDataGroup group = mResGroups.Find(_ => string.Equals(_.GroupName, groupName));

            if (group == null)
            {
                return(false);
            }

            group.Release();
            mResGroups.Remove(group);
            return(true);
        }