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

Function FindClass

Source/Engine/Scripting/Runtime/Mono.cpp:150–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 }
149
150 MClass* FindClass(MonoClass* monoClass, bool addIfMissing = true)
151 {
152 if (monoClass == nullptr)
153 return nullptr;
154 PROFILE_CPU();
155 auto& modules = BinaryModule::GetModules();
156 for (auto module : modules)
157 {
158 auto managedModule = dynamic_cast<ManagedBinaryModule*>(module);
159 if (managedModule && managedModule->Assembly->IsLoaded())
160 {
161 MClass* result = managedModule->Assembly->GetClass(monoClass);
162 if (result != nullptr)
163 return result;
164 }
165 }
166 if (addIfMissing)
167 {
168 MISSING_CODE("TODO: register new MClass"); // TODO: this might happen when for example querying class to array of game script type and it should add new MClass to handle this
169 }
170 return nullptr;
171 }
172}
173
174MDomain* MCore::CreateDomain(const StringAnsi& domainName)

Callers 15

TestScripting.cppFile · 0.85
AccessVariantFunction · 0.85
IsAssignableFromFunction · 0.85
ProcessGroupToolsMethod · 0.85
ProcessGroupFunctionMethod · 0.85
ProcessGroupPackingMethod · 0.85
DeserializeMethod · 0.85
TickPropertyTrackMethod · 0.85
InitCustomNodeMethod · 0.85
VariantTypeMethod · 0.85
InlineMethod · 0.85
ifFunction · 0.85

Calls 2

IsLoadedMethod · 0.45
GetClassMethod · 0.45

Tested by

no test coverage detected