34 lines
869 B
C#
34 lines
869 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using BITKit;
|
||
|
using BITKit.UX;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UIElements;
|
||
|
|
||
|
namespace BITKit.UX
|
||
|
{
|
||
|
[CustomType(typeof(IUXInputBox))]
|
||
|
public class UXInputBox : MonoBehaviourSingleton<IUXInputBox>,IUXInputBox
|
||
|
{
|
||
|
[SerializeField] private UIDocument document;
|
||
|
|
||
|
[UXBindPath("return-button")]
|
||
|
private Button _returnButton;
|
||
|
|
||
|
[UXBindPath("input-container")]
|
||
|
private VisualElement _inputContainer;
|
||
|
|
||
|
public void Show(object container)
|
||
|
{
|
||
|
_inputContainer.Clear();
|
||
|
if(container is not VisualElement data) return;
|
||
|
_inputContainer.Add(data);
|
||
|
}
|
||
|
public void Close()
|
||
|
{
|
||
|
_inputContainer.Clear();
|
||
|
document.rootVisualElement.Clear();
|
||
|
}
|
||
|
}
|
||
|
}
|