本文整理汇总了C++中CGameObject::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameObject::GetNext方法的具体用法?C++ CGameObject::GetNext怎么用?C++ CGameObject::GetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameObject
的用法示例。
在下文中一共展示了CGameObject::GetNext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DebugLayout
void DebugLayout()
{
float y_offset = 100;
CPlayer* LocalPlayer;
if (NetworkManager)
{
LocalPlayer = NetworkManager->GetLocalPlayer();
Render::DrawText(20, y_offset, color_white, DT_LEFT, "R3DNetwork: %x", NetworkManager);
y_offset += 15;
}
CObjectManager* ObjectManager = CObjectManager::Get();
if (ObjectManager)
{
Render::DrawText(20, y_offset, color_white, DT_LEFT, "ObjectManager: %x", ObjectManager);
y_offset += 15;
//Finds LocalPlayer in the main menu (For the shooting range)
if (!LocalPlayer)
{
CGameObject* Object = ObjectManager->GetFirst();
for (CGameObject* Object = ObjectManager->GetFirst(); Object && Object->GetNext(); Object = Object->GetNext())
{
if (Object->GetObjectInfo()->m_id == OBJECT_AI_PLAYER)
{
LocalPlayer = (CPlayer*)Object;
break;
}
}
}
}
if (LocalPlayer)
{
Render::DrawText(20, y_offset, color_white, DT_LEFT, "LocalPlayer: %x [0x%x]", LocalPlayer, LocalPlayer->GetObjectInfo());
y_offset += 15;
for (int slot = 0; slot < SLOT_MAX; slot++)
{
Weapon* pWeapon = LocalPlayer->m_weaponSlots[slot];
if (!pWeapon)
continue;
Render::DrawText(40, y_offset, color_white, DT_LEFT, "Slot Weapon %i: %x (CWeaponConfig: %x)", slot, pWeapon, pWeapon->GetWeaponConfig());
y_offset += 15;
}
Render::DrawTextA(20, y_offset, color_white, DT_LEFT, "Health: %f", LocalPlayer->GetHealth());
}
}