using System; using System.Collections.Generic; namespace Awperative; public abstract partial class Docker { public Behavior Get() where Generic : Behavior => GetAll()[0]; public Behavior[] GetAll() where Generic : Behavior { List returnValue = []; foreach (Behavior component in _components) if (component is Generic) returnValue.Add(component); if(returnValue.Count == 0) { Debug.LogWarning("Scene has no components of this type"); return null; } return returnValue.ToArray(); } }