This commit is contained in:
CortexCore
2023-06-05 16:25:06 +08:00
parent 9027120bb8
commit 4565ff2e35
2947 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.Events;
namespace BITKit.UX
{
public interface IWindowComponent : IActivable { }
public class UXWindow : UXElement<VisualElement>
{
IWindowComponent[] components;
public override void Set(bool active)
{
try
{
visualElement.style.display = (active) ? DisplayStyle.Flex : DisplayStyle.None;
}
catch (System.Exception)
{
BIT4Log.Warnning(gameObject);
throw;
}
foreach (var x in components)
{
x.SetActive(active);
}
}
public override void OnStart()
{
base.OnStart();
components = GetComponentsInChildren<IWindowComponent>(true);
if(visualElement is null)
{
Debug.Log($"{transform.name} bind failure");
}
}
}
}