예제 #1
0
        private IEnumerator preload(string filename, PreloadCallback call)
        {
            string uri = @"file:///" + path + "/" + filename;
            WWW    www = new WWW(uri);

            while (!www.isDone)
            {
                call(false);
                yield return(new WaitForEndOfFrame());
            }
            ab = www.assetBundle;
            call(true);
        }
예제 #2
0
        private void Preload(ZipArchive archive)
        {
            if (IsPreLoaded)
            {
                return;
            }

            LoadMeta(archive);

            // First load the font, then we can render the splash screen!
            LoadFont(archive);

            IsPreLoaded = true;

            PreloadCallback?.Invoke(FontBitmap, BitmapFontCharacters.ToCharArray().ToList());
        }
예제 #3
0
        private void Preload(ZipArchive archive)
        {
            if (IsPreLoaded)
            {
                return;
            }

            LoadMeta(archive);

            // First load the font, then we can render the splash screen!
            LoadFont(archive);

            IsPreLoaded = true;

            PreloadCallback?.Invoke(Font);
        }
예제 #4
0
        private void LoadBitmapFont(ZipArchiveEntry entry)
        {
            var match = IsFontTextureResource.Match(entry.FullName);

            var fontBitmap = LoadBitmap(entry, match);

            LoadTexture(entry, match);

            FontBitmap = fontBitmap;

            if (!DidPreload)
            {
                DidPreload = true;

                PreloadCallback?.Invoke(FontBitmap, BitmapFontCharacters.ToCharArray().ToList());
            }

            //Log.Info($"Font pixelformat: {fontBitmap.PixelFormat} | RawFormat: {fontBitmap.RawFormat}");
            //Font = new BitmapFont(Graphics, fontBitmap, 16, BitmapFontCharacters.ToCharArray().ToList());
        }
예제 #5
0
 public void Preload(string filename, PreloadCallback call)
 {
     StartCoroutine(preload(filename, call));
 }