41 lines
1.0 KiB
C#
41 lines
1.0 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)
|
|||
|
{
|
|||
|
var scene = args.zoneScene;
|
|||
|
try
|
|||
|
{
|
|||
|
SessionComponent.Instance.Session.GetComponent<GateSessionDisposeComponent>().Init();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
Log.Error(e);
|
|||
|
}
|
|||
|
if (!args.isReConnect)
|
|||
|
{
|
|||
|
scene.GetOrAddComponent<OperaComponent>();
|
|||
|
FUIHelper.Remove(scene, FUIPackage.Login_EnterGame);
|
|||
|
var ui = await FUIHelper.Create(scene, FUIPackage.Common_MainUI);
|
|||
|
ui.AddComponent<MainUI>();
|
|||
|
}
|
|||
|
|
|||
|
Game.EventSystem.Publish_Sync(new ET.EventType.InitHeadInfo
|
|||
|
{
|
|||
|
|
|||
|
});
|
|||
|
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|