См. определение в файле ComponentsBank.c строка 38
39 {
40 if ( !Component.IsTypeExist(comp_type) )
41 {
42 Component.LogErrorBadCompType(comp_type, "EntityAI->CreateComponent(int comp_type)");
43 return NULL;
44 }
45
47 {
48 Component.LogWarningAlredyExist(comp_type, "EntityAI->CreateComponent(int comp_type)");
50 }
51
52
53 string clas_name = extended_class_name;
54
55 if ( clas_name ==
string.
Empty )
56 {
57 clas_name = Component.GetNameByType(comp_type);
58 }
59
60 Component comp = Component.Cast(clas_name.
ToType().Spawn());
61
64
66
68
69 return comp;
70 }
void SetParentEntityAI(EntityAI e)
bool IsComponentAlreadyExist(int comp_type)
ref Component m_Components[COMP_TYPE_COUNT]
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...
Перекрестные ссылки Empty, Component::Event_OnAwake(), Component::Event_OnInit(), Component::GetNameByType(), IsComponentAlreadyExist(), Component::IsTypeExist(), Component::LogErrorBadCompType(), Component::LogWarningAlredyExist(), m_Components, m_EntityParent, Component::SetParentEntityAI() и string::ToType().
Используется в GetComponent().