This commit is contained in:
CortexCore
2023-10-24 23:38:22 +08:00
parent 2c4710bc5d
commit bd40165ade
152 changed files with 3681 additions and 1531 deletions

View File

@@ -9,7 +9,7 @@ namespace BITKit.UX
[Serializable]
public class UIToolkitPanelMonoProxy : UXPanelImplement
{
[SerializeField] private MonoBehaviour monoBehaviour;
protected override IUXPanel _iuxPanelImplementation => (IUXPanel)monoBehaviour;
[SerializeField] private GameObject monoBehaviour;
protected override IUXPanel service => monoBehaviour.GetComponent<IUXPanel>();
}
}

View File

@@ -24,6 +24,10 @@ namespace BITKit.UX
[SerializeField] private bool allowCursor;
[SerializeField] private bool allowInput;
[SerializeField] private bool autoEntry;
protected readonly InputActionGroup inputActionGroup = new()
{
allowGlobalActivation = false
};
public bool IsAnimate => isAnimate;
public bool IsValid => cancellationToken.IsCancellationRequested is false;
public string Index { get; private set; }
@@ -50,12 +54,14 @@ namespace BITKit.UX
{
OnEntryOrExit(true);
document.rootVisualElement.SetActive(true);
inputActionGroup.allowInput.AddElement(this);
OnEntry?.Invoke();
}
void IUXPanel.Exit()
{
if (IsValid is false) return;
OnEntryOrExit(false);
inputActionGroup.allowInput.RemoveElement(this);
try
{
document.rootVisualElement.SetActive(false);