public void AddComponent(IBaseComponent child_) { Type type = child_.GetType(); if (!_children.ContainsKey(type)) { _children.Add(type, new List <IBaseComponent>()); } else if (child_.IsOneChildOfAKind && _children[type].Count > 0) { Debug.Log(GetType().Name + " couldn't attach more than one child of type: " + type.Name); return; } _children[type].Add(child_); child_.Parent = this; child_.Init(); }