public GameObject() { Transform = new Transform(); Children = new ListMAQ <GameObject>(); Components = new ListMAQ <Component>(); Children.BeforeAdding += ChildrenOnBeforeAdding; Components.BeforeAdding += ComponentsOnBeforeAdding; Components.Add(Transform); }
private void ChildrenOnBeforeAdding(ListMAQ <GameObject> collection, GameObject newItem) { newItem.Parent = this; newItem.Game = Game; }
private void ComponentsOnBeforeAdding(ListMAQ <Component> collection, Component newItem) { newItem.GameObject = this; }