Example #1
0
    public IEnumerator DownloadAssetBundles()
    {
        Screen.sleepTimeout = -1;
        Int32 curItem = 0;
        Int32 numItem = AssetManager.DictAssetBundleRefs.Count;

        foreach (KeyValuePair <String, AssetManager.AssetBundleRef> entry in AssetManager.DictAssetBundleRefs)
        {
            AssetManager.AssetBundleRef abRef = entry.Value;
            if (abRef.assetBundle != (UnityEngine.Object)null)
            {
                break;
            }
            yield return(base.StartCoroutine(this.DownloadAssetBundle(abRef, curItem, numItem)));

            curItem++;
        }
        this._SetStatusText("Load Completed");
        ExpansionVerifier.printLog("BundleScene : Load Completed");
        Screen.sleepTimeout = -2;
        this._OnDownloadFinished();
        yield return(null);

        yield break;
    }
Example #2
0
 public static void Initialize()
 {
     ExpansionVerifier.printLog("AssetManagerForObb : createfromfile fullPath = " + AssetManagerForObb.fullPath);
     AssetManagerForObb.obbAssetBundle = AssetBundle.CreateFromFile(AssetManagerForObb.fullPath);
     ExpansionVerifier.printLog("AssetManagerForObb : loadAnimationFolderMapping");
     AssetManagerForObb._LoadAnimationFolderMapping();
     ExpansionVerifier.printLog("AssetManagerForObb : isuseobb=true");
     AssetManagerForObb.IsUseOBB = true;
 }
Example #3
0
 private void LateUpdate()
 {
     if (this._skipMenuScene && !this._isChangingScene)
     {
         this._isChangingScene = true;
         TimerUI.SetEnable(false);
         ExpansionVerifier.printLog("GUIManager : goto Title");
         SceneDirector.Replace("Title", SceneTransition.FadeOutToBlack_FadeIn, true);
         SceneDirector.ToggleFadeAll(false);
     }
 }
Example #4
0
 private void Awake()
 {
     global::Debug.Log("50 GUIManager.Awake");
     ExpansionVerifier.printLog("GUIManager : awake");
     this._skipMenuScene   = false;
     this._isChangingScene = false;
     FF9StateSystem.Settings.ReadSystemData(delegate
     {
         this._skipMenuScene = true;
     });
     ExpansionVerifier.printLog("GUIManager : _skipMenuScene = " + this._skipMenuScene);
 }
Example #5
0
    public IEnumerator DownloadAssetBundle(AssetManager.AssetBundleRef abRef, Int32 curItem, Int32 numItem)
    {
        while (!Caching.ready)
        {
            yield return(null);
        }
        this._AddLogOutput("Downloading : " + abRef.url);
        String fullUrl = String.Concat(new String[]
        {
            this._baseUrl,
            AssetManagerUtil.GetPlatformPrefix(Application.platform),
            AssetManagerUtil.GetCompressionPrefix(this._isCompressedBundles),
            abRef.url,
            AssetManagerUtil.GetBundleExtension()
        });

        this._AddLogOutput("    At : " + fullUrl);
        ExpansionVerifier.printLog("BundleScene : Downloading " + abRef.url + " AT " + fullUrl);
        if (!this._isCompressedBundles && fullUrl.IndexOf("http://") == -1)
        {
            this._AddLogOutput("Loading Uncompressed Bundle.");
            AssetBundle ab = AssetBundle.CreateFromFile(fullUrl);
            abRef.assetBundle = ab;
            yield break;
        }
        using (WWW www = WWW.LoadFromCacheOrDownload(fullUrl, BundleScene.BundleVersionInt))
        {
            this._AddLogOutput("Loading Compressed Bundle.");
            while (!www.isDone)
            {
                this._SetStatusText(String.Concat(new Object[]
                {
                    "Loading Progress : [",
                    Mathf.FloorToInt(www.progress * 100f),
                    "%] ",
                    curItem,
                    "/",
                    numItem,
                    " | Will auto change scene when finished."
                }));
                yield return(new WaitForSeconds(0.01f));
            }
            if (www.error != null)
            {
                this._AddLogOutput("Error : " + www.error);
                ExpansionVerifier.printLog("BundleScene : www.error = " + www.error);
                throw new Exception("WWW download:" + www.error);
            }
            abRef.assetBundle = www.assetBundle;
        }
        yield break;
    }
Example #6
0
 private void StartGame()
 {
     ExpansionVerifier.printLog("ExpantionVerifier : StartGame()");
     AssetManagerForObb.Initialize();
     ExpansionVerifier.printLog("ExpantionVerifier : Expansion verification done. Move to Bundle scene");
     if (this.isShowInfoUI)
     {
         global::Debug.Log("isShowInfoUI == true. Go to Bundle scene");
         Application.LoadLevel("Bundle");
     }
     else
     {
         global::Debug.Log("isShowInfoUI == false. Go to SplashScreen scene");
         Application.LoadLevel("SplashScreen");
     }
     ExpansionVerifier.printLog("ExpantionVerifier : Expansion verification done.");
 }
Example #7
0
 private void Awake()
 {
     UnityEngine.Debug.Log("40 BundleScene.Awake");
     GameInitializer.Initial();
     this._logOutput           = new StringBuilder();
     this._scrollPosition      = new Vector2(0f, 0f);
     this._baseUrl             = "http://10.1.0.144:8080/";
     this._isDownloading       = false;
     this._isCompressedBundles = true;
     this._SetStatusText("Ready...");
     this._AddLogOutput("---------- LOG ----------");
     this._skipBundleScene = false;
     if (Application.platform == RuntimePlatform.Android && (AssetManagerForObb.IsUseOBB || FF9StateSystem.AndroidAmazonPlatform))
     {
         this._skipBundleScene = true;
     }
     this._skipBundleScene = true;
     ExpansionVerifier.printLog("BundleScene : awake _skipBundleScene = " + this._skipBundleScene);
 }
Example #8
0
    private static void _LoadAnimationFolderMapping()
    {
        AssetManagerForObb._animationInFolder = new Dictionary <String, List <String> >();
        TextAsset textAsset = AssetManager.Load <TextAsset>("EmbeddedAsset/Manifest/Animations/AnimationFolderMapping.txt", false);

        if (textAsset == (UnityEngine.Object)null)
        {
            global::Debug.LogWarning("Cannot load resource [AnimationFolderMapping]");
            ExpansionVerifier.printLog("AssetManagerForObb : Cannot load resource [AnimationFolderMapping]");
            return;
        }
        String[] array = textAsset.text.Split(new Char[]
        {
            '\n'
        });
        String[] array2 = array;
        for (Int32 i = 0; i < (Int32)array2.Length; i++)
        {
            String   text   = array2[i];
            String[] array3 = text.Split(new Char[]
            {
                ':'
            });
            String   text2  = array3[0];
            String[] array4 = array3[1].Split(new Char[]
            {
                ','
            });
            List <String> list   = new List <String>();
            String[]      array5 = array4;
            for (Int32 j = 0; j < (Int32)array5.Length; j++)
            {
                String str   = array5[j];
                String text3 = text2 + "/" + str;
                text3 = text3.Trim();
                list.Add(text3);
            }
            AssetManagerForObb._animationInFolder.Add(text2, list);
        }
    }
Example #9
0
 private void _UsingUncompressedAssetBundlesFromLocal()
 {
     this._AddLogOutput("Downloading from Local Uncompressed StreamingAssets.");
     ExpansionVerifier.printLog("BundleScene : Downloading from Local Uncompressed StreamingAssets.");
     AssetManager.UseBundles = true;
     if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
     {
         this._baseUrl = AssetManagerUtil.GetStreamingAssetsPath() + "/";
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         this._baseUrl = AssetManagerUtil.GetStreamingAssetsPath() + "/";
     }
     else if (Application.platform == RuntimePlatform.Android)
     {
         this._baseUrl = AssetManagerUtil.GetStreamingAssetsPath() + "/";
     }
     this._isDownloading       = true;
     this._isCompressedBundles = false;
     ExpansionVerifier.printLog("BundleScene : _baseUrl = " + this._baseUrl);
     base.StartCoroutine(this.DownloadAssetBundles());
 }
Example #10
0
 private void _OnDownloadFinished()
 {
     ExpansionVerifier.printLog("BundleScene : change scene to MainMenu");
     SceneDirector.ReplaceNow("MainMenu");
 }