MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / initFlaxEngine

Function initFlaxEngine

Source/Engine/Scripting/Scripting.cpp:1143–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1141}
1142
1143bool initFlaxEngine()
1144{
1145 // Cache common types
1146 if (StdTypesContainer::Instance()->Gather())
1147 return true;
1148
1149#if !COMPILE_WITHOUT_CSHARP
1150 // Init C# class library
1151 {
1152 auto scriptingClass = Scripting::GetStaticClass();
1153 ASSERT(scriptingClass);
1154 const auto initMethod = scriptingClass->GetMethod("Init");
1155 ASSERT(initMethod);
1156 MObject* exception = nullptr;
1157 initMethod->Invoke(nullptr, nullptr, &exception);
1158 if (exception)
1159 {
1160 MException ex(exception);
1161 ex.Log(LogType::Fatal, TEXT("FlaxEngine.Scripting.Init"));
1162 return true;
1163 }
1164 }
1165#endif
1166
1167 // TODO: move it somewhere to game instance class or similar
1168 MainRenderTask::Instance = New<MainRenderTask>();
1169
1170 return false;
1171}
1172
1173void onEngineLoaded(MAssembly* assembly)
1174{

Callers 1

onEngineLoadedFunction · 0.85

Calls 5

InstanceClass · 0.50
GatherMethod · 0.45
GetMethodMethod · 0.45
InvokeMethod · 0.45
LogMethod · 0.45

Tested by

no test coverage detected