// Copyright (c) 2015 - 2023 Doozy Entertainment. All Rights Reserved. // This code can only be used under the standard Unity Asset Store End User License Agreement // A Copy of the EULA APPENDIX 1 is available at http://unity3d.com/company/legal/as_terms using System.Collections.Generic; using Doozy.Runtime.Common.Attributes; // ReSharper disable MemberCanBeProtected.Global // ReSharper disable MemberCanBePrivate.Global namespace Doozy.Runtime.UIManager.Containers.Internal { public abstract class UIContainerComponent : UIContainer where T : UIContainer { [ClearOnReload] public static HashSet database { get; } = new HashSet(); public T component { get; private set; } protected override void Awake() { database.Add(component = GetComponent()); base.Awake(); } protected override void OnEnable() { database.Remove(null); base.OnEnable(); } protected override void OnDestroy() { database.Remove(component); database.Remove(null); base.OnDestroy(); } } }