Пример #1
0
        async void RunTests()
        {
            await ResourceSystem.Init();

            ResourceSystem.ResMode            = ResourceSystem.Mode.AssetBundle;
            AssetSystem.Instance.disposeDelay = 2f;
            ResLog.Log("=== ResourceSystem Initialized ===");

            foreach (Type type in testerTypes)
            {
                ResLog.LogFormat("=== Run {0} ===", type.Name);
                var go     = new GameObject();
                var tester = (Tester)go.AddComponent(type);
                try
                {
                    await tester.Test();
                }
                catch (Exception e)
                {
                    ResLog.LogException(e);
                }
                Destroy(go);
                await Awaiters.NextFrame;
                ResLog.Log("=== Done ===");
            }
        }
Пример #2
0
        void DisposePass(bool disposeAll = false)
        {
            int i = 0;

            for (int disposedCount = 0;
                 i < waitToDispose.Count && (disposeAll || disposedCount < disposePerFrame);
                 ++i)
            {
                var h = waitToDispose[i];
                if (h.WaitForDispose)
                {
                    try
                    {
                        h.Dispose();
                        assets.Remove(h.Path);
                        ResLog.Log("(AssetManager) dispose " + h.Path);
                    }
                    catch (Exception e)
                    {
                        ResLog.LogException(e);
                    }
                    ++disposedCount;
                }
            }
            waitToDispose.RemoveRange(0, i);
        }
Пример #3
0
        async void AsyncLoad()
        {
            loading = true;
            try
            {
                await SceneLoader.AsyncLoad(
                    dropdown.captionText.text,
                    v => progress.text = string.Format("Loading {0:P2}", v));

                current.text = SceneResource.Current.Path;
            }
            catch (Exception e)
            {
                ResLog.LogException(e);
            }
            loading = false;
        }