登录和输入控件

This commit is contained in:
2025-08-20 23:57:22 +08:00
parent 818bf63d8d
commit 2f8251fe63
28 changed files with 346 additions and 70 deletions

View File

@@ -0,0 +1,29 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class CommonInput
{
public const string URL = "ui://6hgkvlau9zboma";
public Controller FocusState;
public GTextInput Input;
public GImage bottomBack;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
FocusState = GetController("FocusState");
Input = (GTextInput)GetChild("Input");
bottomBack = (GImage)GetChild("bottomBack");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: fb776407f4f25e64a8e803ba135bddef

View File

@@ -0,0 +1,47 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class CommonInput : GComponent
{
public EventListener onChanged => Input.onChanged;
public override string text
{
get => Input.text;
set => Input.text = value;
}
public string title
{
get => text;
set => text = value;
}
public string promptText
{
get => Input.promptText;
set => Input.promptText = value;
}
private void OnInited()
{
onFocusIn.Add(OnInputFocusIn);
onFocusOut.Add(OnInputFocusOut);
}
private void OnInputFocusIn()
{
FocusState.selectedIndex = 1;
}
private void OnInputFocusOut()
{
FocusState.selectedIndex = 0;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c7adc7972d1d401489dc796fb27d1eaa