Files
Fishing2/Assets/Scripts/UI/Login/LoginPanel.cs

32 lines
863 B
C#

// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
using FairyGUI;
using UnityEngine;
using NBC;
using NBC.Entitas;
using NBF.Fishing2;
using UIPanel = NBC.UIPanel;
namespace NBF
{
public partial class LoginPanel : UIPanel
{
protected override void OnInit()
{
this.AutoAddClick(OnClick);
}
private void OnClick(GComponent btn)
{
if (btn == BtnLogin)
{
var unitGameObject = new GameObject("Unit");
var unit = Entity.Create<Unit>(App.Main, true, true);
var unitUnity = unit.AddComponent<UnitUnityComponent>();
unitUnity.SetGameObject(unitGameObject);
// App.Main.add
// LoginHelper.Login(InputAccount.text).Coroutine();
}
}
}
}