public override async ETTask Run(ET.EventType.AppStart args) { Log.Info($"AppStart..."); AkaBuilder.Create() .UseUI() .UseEventBus() .AddAssemblyPart(typeof(AppStart).Assembly) .Build(); Game.Scene.AddComponent <TimerComponent>(); // 更新资源 并预加载资源 var resources = Game.Scene.AddComponent <ResourcesComponent>(); await resources.Load(); // 添加必要组件 Game.Scene.AddComponent <ConfigComponent>(); Game.Scene.AddComponent <OpcodeTypeComponent>(); Game.Scene.AddComponent <MessageDispatcherComponent>(); Game.Scene.AddComponent <NetOuterComponent>(); // 进入登录界面 Akau.Open(nameof(LoginPage), true); }
public override async ETTask Run(EnterRoomSuccess a) { // 创建一个房间 Room room = Game.Scene.AddComponent <Room, long, long>(a.RoomNum, a.RoomMaster); room.AddComponent <GameController>(); room.AddComponent <LocalPlayerComponent>().LocalPlayerSeatIndex = a.CurrentPlayerSeatIndex; // 进入房间UI Akau.Open(nameof(RoomPage)); }
public override async ETTask Run(RoundEndEvent a) { // var args = new Dialog.Args("游戏", "游戏结束"); // args.OkAction = () => // { // EventBus.Publish(new GameStartEvent { GameOver = true }); // Dialog.Close(); // }; // Dialog.Open(args); Akau.Open(nameof(RoundEndWindow)); await ETTask.CompletedTask; }
public static void Open(bool mask = false) { Akau.Open(nameof(NetworkLoading), false, mask); }
protected override void OnCreate() { this._joinBtn.onClick.AddListener(() => Akau.Open(nameof(JoinOrCreateDialog), args: nameof(JoinPanel))); this._createBtn.onClick.AddListener(() => Akau.Open(nameof(JoinOrCreateDialog), args: nameof(CreatePanel))); }
public override async ETTask Run(LoginSuccess a) { // 登录成功,跳转UI Akau.Open(nameof(LobbyPage), true); await ETTask.CompletedTask; }
public static void Open(Args args) { Akau.Open(nameof(Dialog), args: args); }
public override async ETTask Run(ExitRoom a) { Game.Scene.RemoveComponent <Room>(); Akau.Open(nameof(LobbyPage)); }