Пример #1
0
        public System.Func <IEnumerator> GetBundleCacher(IEnumerable <string> bundleNames)
        {
            IList <System.Func <IEnumerator> > actions = new List <System.Func <IEnumerator> >();

            foreach (string bundle in bundleNames.Where(n => n != ""))
            {
                System.Func <IEnumerator> action = () => DownloadAndCache(bundle, ab => {}, 0);
                actions.Add(action);
            }
            return(EnumerableAction.Serialize(actions));
        }
Пример #2
0
        IEnumerator Load()
        {
            _progress = 0f;

            System.Func <IEnumerator> resourceCacher = GameApplication.Instance.AssetManager.GetResourceCacher(resourceLists.SelectMany(r => r.strings));
            System.Func <IEnumerator> bundleCacher   = GameApplication.Instance.AssetManager.GetBundleCacher(bundleLists.SelectMany(r => r.strings));

            _progress = 1f;

            return(EnumerableAction.Concat(bundleCacher, resourceCacher)());
        }
Пример #3
0
        IEnumerator Terminate()
        {
            float startTime  = Time.realtimeSinceStartup;
            int   startFrame = Time.frameCount;

            IEnumerable <ISceneExit> exits = GetComponentsInChildren(typeof(ISceneExit)).Cast <ISceneExit>()
                                             .Concat(_pendingExits);

            CoreLogger.LogDebug(LoggerModules.SceneManager, string.Format("scene {0} Starting Terminate with {1} exits", SceneName, exits.Count()));

            UnSubscribeFromBackButtonEvent();

            yield return(GameApplication.Instance.CoroutineFactory.StartCoroutine(EnumerableAction.Parallelize(exits.Select(e => e.ExitSequence))));

            _readyToUnload = true;
            _inExit        = false;
            _pendingExits.Clear();

            CoreLogger.LogDebug(LoggerModules.SceneManager, string.Format("Terminate Done in {0} seconds, {1} frames", Time.realtimeSinceStartup - startTime, Time.frameCount - startFrame));
        }
Пример #4
0
            public LoadFromBundleTask(AssetManager assetManager, string path)
            {
                var action = EnumerableAction.Create(() => LoadAsset(assetManager, path), () => _result, int.MaxValue, "");

                Init(assetManager, action);
            }