82 lines
2.0 KiB
C#
82 lines
2.0 KiB
C#
|
|
|||
|
using Cal.DataTable;
|
|||
|
using ET.EventType;
|
|||
|
using ET;
|
|||
|
using FairyGUI;
|
|||
|
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
public class MainStoryAIUIAwakeSyatem : AwakeSystem<MainStoryAIUI>
|
|||
|
{
|
|||
|
public override void Awake(MainStoryAIUI self)
|
|||
|
{
|
|||
|
self.Awake();
|
|||
|
}
|
|||
|
}
|
|||
|
public class MainStoryAIUIDestroySyatem : DestroySystem<MainStoryAIUI>
|
|||
|
{
|
|||
|
public override void Destroy(MainStoryAIUI self)
|
|||
|
{
|
|||
|
self.Destroy();
|
|||
|
}
|
|||
|
}
|
|||
|
public class MainStoryAIUI : Entity
|
|||
|
{
|
|||
|
public FUI_MainStoryAIUI ui;
|
|||
|
|
|||
|
public void Awake()
|
|||
|
{
|
|||
|
AwakeAsync().Coroutine();
|
|||
|
}
|
|||
|
private async ETVoid AwakeAsync()
|
|||
|
{
|
|||
|
ui = GetParent<FUI_MainStoryAIUI>();
|
|||
|
Register();
|
|||
|
Load();
|
|||
|
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
|
|||
|
private void Register()
|
|||
|
{
|
|||
|
ui.m_btnStart.self.onClick.Set(async() =>
|
|||
|
{
|
|||
|
if(!int.TryParse( ui.m_iptLevel.text,out var index))
|
|||
|
{
|
|||
|
TipHelper.OpenUI("填写错误");
|
|||
|
return;
|
|||
|
}
|
|||
|
var ret = await SessionComponent.Instance.Call<M2C_StartMainStoryAI>(new C2M_StartMainStoryAI { Index = index });
|
|||
|
if (!ret.Message.IsNullOrEmpty())
|
|||
|
{
|
|||
|
TipHelper.OpenUI(ret.Message);
|
|||
|
return;
|
|||
|
}
|
|||
|
});
|
|||
|
ui.m_btnEnd.self.onClick.Set(async() =>
|
|||
|
{
|
|||
|
var ret = await SessionComponent.Instance.Call<M2C_EndMainStoryAI>(new C2M_EndMainStoryAI());
|
|||
|
if (!ret.Message.IsNullOrEmpty())
|
|||
|
{
|
|||
|
TipHelper.OpenUI(ret.Message);
|
|||
|
return;
|
|||
|
}
|
|||
|
});
|
|||
|
}
|
|||
|
private void Load()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public void Destroy()
|
|||
|
{
|
|||
|
}
|
|||
|
}
|
|||
|
}
|