Esempio n. 1
0
        public NameCrcData(string urlOrNcKey, LocalCacheEntry.CacheType cacheType = LocalCacheEntry.CacheType.Raw)
        {
            Init();

            string name, crc;

            name = crc = string.Empty;
            if (IsUrlOrNcKey(urlOrNcKey, ref name, ref crc))
            {
                // url
                if (string.IsNullOrEmpty(name))
                {
                    _nameCrc = new NameCrc();
                    _nameCrc.SetData(urlOrNcKey, true);
                }
                else // ncKey
                {
                    _nameCrc = new NameCrc(name, crc);
                }
            }
            else
            {
                Debug.LogError("urlOrNcKey is not url or namecrcKey");
            }
            _cacheType = cacheType;
        }
Esempio n. 2
0
        public NameCrcData(string name, byte[] data)
        {
            Init();
            _request.SetData(data);

            _cacheType = LocalCacheEntry.CacheType.Raw;
            var crc = Crc32.CountCrc(data);

            _nameCrc = new NameCrc(name, crc.ToString());
        }
Esempio n. 3
0
        public static bool IsUrlOrNcKey(string str, ref string name, ref string crc)
        {
            string __name, __crc;

            //__name = __crc = string.Empty;
            if (HttpService.IsUrl(str))
            {
                return(true);
            }
            else if (NameCrc.GetNameAndCrcFromKey(str, out __name, out __crc, false))
            {
                if (name != null)
                {
                    name = __name;
                }
                if (crc != null)
                {
                    crc = __crc;
                }
                return(true);
            }
            return(false);
        }
Esempio n. 4
0
 public NameCrcData(string name, string crc, LocalCacheEntry.CacheType cacheType = LocalCacheEntry.CacheType.Raw)
 {
     Init();
     _nameCrc   = new NameCrc(name, crc);
     _cacheType = cacheType;
 }
Esempio n. 5
0
        //Texture2D _dataTexture2D;
        //AssetBundle _dataAB;

        public NameCrcData()
        {
            Init();
            _cacheType = LocalCacheEntry.CacheType.Raw;
            _nameCrc   = new NameCrc();
        }