Ejemplo n.º 1
0
 //handle bundle selection change
 //add option of comic inside bandle into the comic dropdown
 public void bundleChange()
 {
     comicDropdown.options.Clear();
     if (ComicManager.streamContent(bundleDropdown.captionText.text))
     {
         activeComics = ComicManager.getComics(ComicManager.readStreamBundles(Path.Combine(Application.streamingAssetsPath, bundleDropdown.captionText.text)));
     }
     else
     {
         activeComics = ComicManager.getComics(ComicManager.readStreamBundles(Path.Combine(Application.persistentDataPath, bundleDropdown.captionText.text)));
     }
     addDropdownOptions(comicDropdown, activeComics);
     comicDropdown.value            = 0;
     comicDropdown.captionText.text = comicDropdown.options[0].text;
 }
Ejemplo n.º 2
0
        //create comic data by loading comic folder inside a asset bundle
        public Comic(string bundleName, string comicPath)
        {
            this.name   = Path.GetFileName(comicPath);
            this.source = bundleName.ToString();
            AssetBundle comicBundle = ComicManager.readStreamBundles(ComicManager.bundlePath(bundleName));

            foreach (string asetname in comicBundle.GetAllAssetNames())
            {
                if (asetname.Contains(comicPath))
                {
                    this.pages.Add(comicBundle.LoadAsset <Sprite>(asetname));
                    this.pagename.Add(Path.GetFileNameWithoutExtension(asetname));
                }
            }
            comicBundle.Unload(false);
        }