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

Method RemoveObject

Source/Engine/Networking/NetworkReplicator.cpp:1480–1494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1478}
1479
1480void NetworkReplicator::RemoveObject(ScriptingObject* obj)
1481{
1482 if (!obj || NetworkManager::IsOffline())
1483 return;
1484 ScopeLock lock(ObjectsLock);
1485 const auto it = Objects.Find(obj->GetID());
1486 if (it == Objects.End())
1487 return;
1488
1489 // Remove object from the list
1490 NETWORK_REPLICATOR_LOG(Info, "[NetworkReplicator] Remove object {}, owned by {}", obj->GetID().ToString(), it->Item.ParentId.ToString());
1491 if (Hierarchy && it->Item.Role == NetworkObjectRole::OwnedAuthoritative)
1492 Hierarchy->RemoveObject(obj);
1493 Objects.Remove(it);
1494}
1495
1496void NetworkReplicator::SpawnObject(ScriptingObject* obj)
1497{

Calls 6

IsOfflineFunction · 0.85
GetIDMethod · 0.80
FindMethod · 0.45
EndMethod · 0.45
ToStringMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected