| 1141 | } |
| 1142 | |
| 1143 | bool 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 | |
| 1173 | void onEngineLoaded(MAssembly* assembly) |
| 1174 | { |