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 { 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(true); if(visualElement is null) { Debug.Log($"{transform.name} bind failure"); } } } }