using System.Collections; using System.Collections.Generic; using UnityEngine; namespace TcgEngine.UI { public class SelectorPanel : UIPanel { private static List panel_list = new List(); protected override void Awake() { base.Awake(); panel_list.Add(this); } protected virtual void OnDestroy() { panel_list.Remove(this); } public virtual void Show(AbilityData ability, Card card) { //Override this to show panel } public virtual bool ShouldShow() { return false; //Override this function, when this panel should show } public static List GetAll() { return panel_list; } public static void HideAll() { foreach (SelectorPanel panel in panel_list) { if(panel.IsVisible()) panel.Hide(); } } } }