| 246 | } |
| 247 | |
| 248 | ScriptingObject* ScriptingObject::ToNative(MObject* obj) |
| 249 | { |
| 250 | ScriptingObject* ptr = nullptr; |
| 251 | #if USE_CSHARP |
| 252 | if (obj) |
| 253 | { |
| 254 | #if USE_MONO || USE_MONO_AOT || DOTNET_HOST_MONO |
| 255 | const auto ptrField = MCore::Object::GetClass(obj)->GetField(ScriptingObject_unmanagedPtr); |
| 256 | CHECK_RETURN(ptrField, nullptr); |
| 257 | ptrField->GetValue(obj, &ptr); |
| 258 | #else |
| 259 | static const MField* ptrField = MCore::Object::GetClass(obj)->GetField(ScriptingObject_unmanagedPtr); |
| 260 | ptrField->GetValueReference(obj, &ptr); |
| 261 | #endif |
| 262 | } |
| 263 | #endif |
| 264 | return ptr; |
| 265 | } |
| 266 | |
| 267 | bool ScriptingObject::Is(const ScriptingTypeHandle& type) const |
| 268 | { |
nothing calls this directly
no test coverage detected