Ejemplo n.º 1
0
        public void UnloadAnime(AnimeConfig config)
        {
            for (int i = 0; i < config.Frames.Length; i++)
            {
                if (!ResourceManager.Instance.allNpkData.ContainsKey(config.Frames[i].Image))
                {
                    return;
                }
                var npk    = ResourceManager.Instance.allNpkData[config.Frames[i].Image];
                var sprite = config.Frames[i].ImageIdx;

                if (!resCache.ContainsKey(npk.filePath))
                {
                    resCache.Add(npk.filePath, new ResUsage());
                }
                var usage = resCache[npk.filePath];
                if (usage.cache)
                {
                    npk.album.UnloadImage();
                    //usage.stayInMem -= stayInMem ? 1 : 0;
                    usage.nowCount--;
                    usage.cache = false;
                }
            }
        }
Ejemplo n.º 2
0
        public void LoadAnime(AnimeConfig config)
        {
            for (int i = 0; i < config.Frames.Length; i++)
            {
                if (!ResourceManager.Instance.allNpkData.ContainsKey(config.Frames[i].Image))
                {
                    return;
                }
                var npk    = ResourceManager.Instance.allNpkData[config.Frames[i].Image];
                var sprite = config.Frames[i].ImageIdx;

                if (!resCache.ContainsKey(npk.filePath))
                {
                    resCache.Add(npk.filePath, new ResUsage());
                }
                var usage = resCache[npk.filePath];
                if (!usage.cache && check_memory())
                {
                    npk.album.LoadImage(npk.filePath);

                    //usage.stayInMem += stayInMem ? 1 : 0;
                    usage.nowCount++;
                    usage.allCount++;
                    usage.cache    = true;
                    usage.lastTime = Time.time;
                }
            }
        }
Ejemplo n.º 3
0
 public void Show(AnimeConfig data, int index = 0)
 {
     load_image(data);
     animeTime  = 0;
     animeIndex = index;
     isshow     = true;
     newFrame   = true;
 }
Ejemplo n.º 4
0
 private void load_image(AnimeConfig cfg)
 {
     Data = cfg;
     ResourceManager.Instance.LoadAnime(cfg);
 }