using System.Text;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class FuncPresetChangeNameWin : UIBase
|
{
|
[SerializeField] InputField nameText;
|
[SerializeField] Button confirmBtn;
|
|
protected override void InitComponent()
|
{
|
confirmBtn.AddListener(OnConfirm);
|
}
|
|
void OnConfirm()
|
{
|
var len = (byte)Encoding.Default.GetBytes(nameText.text).Length;
|
|
if (len > 12)
|
{
|
return;
|
}
|
var pack = new CB261_tagCSFuncPresetUpdName();
|
pack.FuncPresetType = (byte)(functionOrder/100);
|
pack.PresetID = (byte)(functionOrder % 100);
|
pack.NameLen = len;
|
pack.PresetName = nameText.text;
|
GameNetSystem.Instance.SendInfo(pack);
|
SysNotifyMgr.Instance.ShowTip("FuncPreset3");
|
CloseWindow();
|
}
|
}
|