28 void Event_OnFrame(
IEntity other,
float timeSlice);
29 Shape DebugBBoxDraw();
30 void DebugBBoxSetColor(
int color);
31 void DebugBBoxDelete();
32 Shape DebugDirectionDraw(
float distance = 1);
33 void DebugDirectionSetColor(
int color);
34 void DebugDirectionDelete();
48 static string GetNameByType(
int comp_type)
50 if ( IsTypeExist(comp_type) ==
false )
52 LogErrorBadCompType(comp_type,
"Component->GetNameByType()");
56 return m_CompNames[comp_type];
62 static bool IsTypeExist(
int comp_type)
76 static void LogErrorBadCompType(
int comp_type,
string fnc_name)
78 string msg =
"Bad parameter comp_type='"+comp_type.ToString()+
"'. Parameter must be 0-"+(
COMP_TYPE_COUNT - 1).
ToString()+
". Returning component name 'None'.";
79 Debug.LogError(msg,
"Component",
"n/a", fnc_name);
85 static void LogWarningAlredyExist(
int comp_type,
string fnc_name)
87 string msg =
"Component '"+
Component.GetNameByType(comp_type)+
"' already exists!";
88 Debug.LogError(msg,
"Component",
"n/a", fnc_name);
118 void LogThis(
string msg,
string fnc_name =
"n/a")
126 void LogThisWarning(
string msg,
string fnc_name =
"n/a")
128 Debug.LogWarning(msg, GetCompName(),
"n/a", fnc_name, m_ThisEntityAI.ToString());
134 void LogThisError(
string msg,
string fnc_name =
"n/a")
136 Debug.LogError(msg, GetCompName(),
"n/a", fnc_name, m_ThisEntityAI.ToString());
144 return Component.GetNameByType(this.GetCompType());
158 void Event_OnItemAttached(
EntityAI item,
string slot_name)
160 LogThis(
"" + item +
" -> " + slot_name,
"Event_OnItemAttached");
167 void Event_OnItemDetached(
EntityAI item,
string slot_name)
169 LogThis(
"" + item +
" <- " + slot_name,
"Event_OnItemDetached");