protected override async ETTask Run(EventType.SceneChangeStart args)
        {
            Scene currentScene = args.ZoneScene.CurrentScene();

            // 加载场景资源
            await ResourcesComponent.Instance.LoadBundleAsync($"{currentScene.Name}.unity3d");

            // 切换到map场景

            SceneChangeComponent sceneChangeComponent = null;

            try
            {
                sceneChangeComponent = Game.Scene.AddComponent <SceneChangeComponent>();
                {
                    await sceneChangeComponent.ChangeSceneAsync(currentScene.Name);
                }
            }
            finally
            {
                sceneChangeComponent?.Dispose();
            }


            currentScene.AddComponent <OperaComponent>();
        }
        protected override async ETTask Run(EventType.SceneChangeStart args)
        {
            await ETTask.CompletedTask;

            Scene zoneScene = args.ZoneScene;

            // 加载场景资源
            await ResourcesComponent.Instance.LoadBundleAsync("map.unity3d");

            // 切换到map场景

            SceneChangeComponent sceneChangeComponent = null;

            try
            {
                sceneChangeComponent = Game.Scene.AddComponent <SceneChangeComponent>();
                {
                    await sceneChangeComponent.ChangeSceneAsync("Map");
                }
            }
            finally
            {
                sceneChangeComponent?.Dispose();
            }


            args.ZoneScene.AddComponent <OperaComponent>();
        }
Exemple #3
0
        protected override async ETTask Run(EventType.EnterMapFinish args)
        {
            // 加载场景资源
            await ResourcesComponent.Instance.LoadBundleAsync("map.unity3d");

            // 切换到map场景

            SceneChangeComponent sceneChangeComponent = null;

            try
            {
                sceneChangeComponent = Game.Scene.AddComponent <SceneChangeComponent>();
                {
                    await sceneChangeComponent.ChangeSceneAsync("Map");
                }
            }
            finally
            {
                sceneChangeComponent?.Dispose();
            }


            args.ZoneScene.AddComponent <OperaComponent>();
            await UIHelper.Remove(args.ZoneScene, UIType.UILobby);
        }