示例#1
0
        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);
        }
示例#2
0
        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);
        }