41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using ET.EventType;
|
|
using ET;
|
|
using FairyGUI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
public class EnterGameFinish_CreateMainUIEvent : AEvent<EnterGameFinish_CreateMainUI>
|
|
{
|
|
public override async ETTask Run(EnterGameFinish_CreateMainUI args)
|
|
{
|
|
Scene zoneScene = args.zoneScene;
|
|
try
|
|
{
|
|
zoneScene.GetComponent<SessionComponent>().Session.GetComponent<GateSessionDisposeComponent>().Init();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Error(e);
|
|
}
|
|
if (!args.isReConnect)
|
|
{
|
|
zoneScene.GetOrAddComponent<OperaComponent>();
|
|
FUIHelper.Remove(zoneScene, FUIPackage.Login_EnterGame);
|
|
FUI ui = await FUIHelper.Create(zoneScene, FUIPackage.Common_MainUI);
|
|
ui.AddComponent<MainUI>();
|
|
}
|
|
|
|
Game.EventSystem.Publish_Sync(new ET.EventType.InitHeadInfo
|
|
{
|
|
zoneScene=zoneScene
|
|
});
|
|
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
|
|
|
|
}
|