public GameObjectComponent GetComponent(Type T) { foreach (GameObjectComponent GOC in GameObjectComponents) { if (GOC.GetType() == T) { return(GOC); } } return(null); }
public void Destroy() { foreach (GameObject Child in Children) { Child.ShouldBeDeleted = true; } foreach (GameObjectComponent GOC in GameObjectComponents) { GOC.Destroy(); } if (Parent != null) { Parent.RemoveChild(this); } ShouldBeDeleted = true; Children.Clear(); }