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

Method GetField

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

Source from the content-addressed store, hash-verified

1400}
1401
1402MField* MClass::GetField(const char* name) const
1403{
1404 // Lookup for cached field
1405 for (int32 i = 0; i < _fields.Count(); i++)
1406 {
1407 if (_fields[i]->GetName() == name)
1408 return _fields[i];
1409 }
1410
1411 // Find mono field
1412 MonoClassField* field = mono_class_get_field_from_name(_monoClass, name);
1413 if (field == nullptr)
1414 return nullptr;
1415
1416 // Create field
1417 auto mfield = New<MField>(field, name, (MClass*)this);
1418 _fields.Add(mfield);
1419 return mfield;
1420}
1421
1422const Array<MField*>& MClass::GetFields() const
1423{

Callers 15

AccessVariantFunction · 0.45
GetTypeSizeMethod · 0.45
ExtractArrayFromListMethod · 0.45
ConvertToMethod · 0.45
DeleteInstanceMethod · 0.45
ProcessGroupFunctionMethod · 0.45
ProcessGroupPackingMethod · 0.45
TickPropertyTrackMethod · 0.45
TickMethod · 0.45
TryParseMethod · 0.45
ToNativeMethod · 0.45
ChangeIDMethod · 0.45

Calls 3

CountMethod · 0.45
GetNameMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected