internal void AddComponent(MyActorComponent component) { // only flat hierarchy Debug.Assert(component.Type != MyActorComponentEnum.GroupLeaf || GetGroupRoot() == null); Debug.Assert(component.Type != MyActorComponentEnum.GroupRoot || GetGroupLeaf() == null); component.Assign(this); m_components.Add(component); }
internal void AddComponent <T>(MyActorComponent component) where T : MyActorComponent { // only flat hierarchy Debug.Assert(component.Type != MyActorComponentEnum.GroupLeaf || GetComponent <MyGroupRootComponent>() == null); Debug.Assert(component.Type != MyActorComponentEnum.GroupRoot || GetComponent <MyGroupLeafComponent>() == null); component.Assign(this); m_components.Add(typeof(T), component); }