using System; using System.Collections.Generic; namespace Awperative; public abstract partial class DockerEntity { public Component GetComponent() where Generic : Component => GetComponents()[0]; public Component[] GetComponents() where Generic : Component { List returnValue = []; foreach (Component 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(); } }