登录和输入控件
This commit is contained in:
29
Assets/Scripts/UI/Common/CommonInput.Designer.cs
generated
Normal file
29
Assets/Scripts/UI/Common/CommonInput.Designer.cs
generated
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Common/CommonInput.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Common/CommonInput.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb776407f4f25e64a8e803ba135bddef
|
||||
47
Assets/Scripts/UI/Common/CommonInput.cs
Normal file
47
Assets/Scripts/UI/Common/CommonInput.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Common/CommonInput.cs.meta
Normal file
2
Assets/Scripts/UI/Common/CommonInput.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7adc7972d1d401489dc796fb27d1eaa
|
||||
Reference in New Issue
Block a user