本文整理汇总了C++中ObjectPtr::SetLayer方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPtr::SetLayer方法的具体用法?C++ ObjectPtr::SetLayer怎么用?C++ ObjectPtr::SetLayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectPtr
的用法示例。
在下文中一共展示了ObjectPtr::SetLayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void CoreLayer2D_Imp::RemoveObject(ObjectPtr object)
{
{
auto o = CoreObject2DToImp(object);
o->OnRemoving(m_renderer);
#if __CULLING_2D__
if (object->GetObjectType() == Object2DType::Map)
{
auto mapObj = (CoreMapObject2D_Imp*)o;
auto &chips = mapObj->GetChips();
for (auto c : chips)
{
auto chipImp = (CoreChip2D_Imp*)c;
auto cObj = chipImp->GetCullingObject();
RemoveTransformedObject(cObj);
auto userData = (Culling2DUserData*)(cObj->GetUserData());
SafeDelete(userData);
world->RemoveObject(cObj);
}
}
else if (object->GetObjectType() != Object2DType::Camera)
{
auto cObj = o->GetCullingObject();
RemoveTransformedObject(cObj);
auto userData = (Culling2DUserData*)(cObj->GetUserData());
SafeDelete(userData);
world->RemoveObject(cObj);
}
#endif
}
object->SetLayer(nullptr);
if (object->GetObjectType() == Object2DType::Camera)
{
auto camera = (CoreCameraObject2D*)object;
m_cameras.remove(camera);
SafeRelease(camera);
}
else
{
m_objects.remove(object);
SafeRelease(object);
}
}