1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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();
    }
}