示例#1
0
文件: Entity.cpp 项目: caocao/naali
 void Entity::AddComponent(const Foundation::ComponentInterfacePtr &component)
 {
     // Must exist and be free
     if (component && component->GetParentEntity() == 0)
     {
         component->SetParentEntity(this);
         components_.push_back(component);
     
         ///\todo Ali: send event
     }
 }
示例#2
0
文件: Entity.cpp 项目: Chiru/naali
 void Entity::AddComponent(const Foundation::ComponentInterfacePtr &component, AttributeChange::Type change)
 {
     // Must exist and be free
     if (component && component->GetParentEntity() == 0)
     {
         component->SetParentEntity(this);
         components_.push_back(component);
     
         if (scene_)
             scene_->EmitComponentAdded(this, component.get(), change);
     }
 }