本文整理汇总了C++中IActionMapManager::EnableActionMap方法的典型用法代码示例。如果您正苦于以下问题:C++ IActionMapManager::EnableActionMap方法的具体用法?C++ IActionMapManager::EnableActionMap怎么用?C++ IActionMapManager::EnableActionMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IActionMapManager
的用法示例。
在下文中一共展示了IActionMapManager::EnableActionMap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnableActionMaps
void CVehicleClient::EnableActionMaps(IVehicleSeat* pSeat, bool enable)
{
assert(pSeat);
// illegal to change action maps in demo playback - Lin
if (!IsDemoPlayback() && pSeat)
{
IActionMapManager* pActionMapMan = g_pGame->GetIGameFramework()->GetIActionMapManager();
CRY_ASSERT(pActionMapMan);
pActionMapMan->EnableActionMap("player", !enable);
EntityId passengerID = pSeat->GetPassenger();
// now the general vehicle controls
if (IActionMap* pActionMap = pActionMapMan->GetActionMap("vehicle_general"))
{
pActionMap->SetActionListener(enable ? passengerID : 0);
pActionMapMan->EnableActionMap("vehicle_general", enable);
}
// todo: if necessary enable the vehicle-specific action map here
// specific controls for this vehicle seat
const char* actionMap = pSeat->GetActionMap();
if (actionMap && actionMap[0])
{
if (IActionMap* pActionMap = pActionMapMan->GetActionMap(actionMap))
{
pActionMap->SetActionListener(enable ? passengerID : 0);
pActionMapMan->EnableActionMap(actionMap, enable);
}
}
}
}
示例2: PerformRipOff
//----------------------------------------------------------------------
void CVehicleMountedWeapon::PerformRipOff(CActor* pOwner)
{
IActionMapManager* pMapManager = gEnv->pGame->GetIGameFramework()->GetIActionMapManager();
assert(pMapManager);
pMapManager->EnableActionMap("vehicle_general", false);
IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(m_vehicleId);
if(pVehicle)
{
SVehicleEventParams params;
params.entityId = GetEntityId();
pVehicle->BroadcastVehicleEvent(eVE_WeaponRemoved, params);
if(pOwner)
{
if(gEnv->bMultiplayer)
{
const IEntity* pVehicleEnt = pVehicle->GetEntity();
IEntity* pEntity = pOwner->GetEntity();
const Matrix34& vehWMat = pVehicleEnt->GetWorldTM();
m_previousWSpaceOffsetPosition = pEntity->GetWorldPos();
m_localRipUserOffset = vehWMat.GetInverted().TransformPoint(m_previousWSpaceOffsetPosition);
}
pOwner->LinkToVehicle(0);
}
m_previousVehicleRotation = pVehicle->GetEntity()->GetWorldRotation();
}
CHeavyMountedWeapon::PerformRipOff(pOwner);
}
示例3: OnStep
EContextEstablishTaskResult OnStep( SContextEstablishState& state )
{
IActionMapManager *pActionMapMan = CCryAction::GetCryAction()->GetIActionMapManager();
pActionMapMan->Enable(false);
pActionMapMan->EnableActionMap("player", true);
pActionMapMan->EnableFilter(0, false); // disable all actionfilters
return eCETR_Ok;
}
示例4: OnEnterVehicleSeat
//------------------------------------------------------------------------
void CVehicleClient::OnEnterVehicleSeat(IVehicleSeat* pSeat)
{
m_bMovementFlagRight=m_bMovementFlagLeft=m_bMovementFlagForward=m_bMovementFlagBack=false;
m_fLeftRight = m_fForwardBackward = 0.f;
IVehicle* pVehicle = pSeat->GetVehicle();
assert(pVehicle);
IActorSystem* pActorSystem = gEnv->pGame->GetIGameFramework()->GetIActorSystem();
assert(pActorSystem);
IActor* pActor = pActorSystem->GetActor(pSeat->GetPassenger());
bool isThirdPerson = pActor->IsThirdPerson() || m_tp;
TVehicleViewId viewId = InvalidVehicleViewId;
TVehicleViewId firstViewId = InvalidVehicleViewId;
while (viewId = pSeat->GetNextView(viewId))
{
if (viewId == firstViewId)
break;
if (firstViewId == InvalidVehicleViewId)
firstViewId = viewId;
if (IVehicleView* pView = pSeat->GetView(viewId))
{
if (pView->IsThirdPerson() == isThirdPerson)
break;
}
}
if (viewId != InvalidVehicleViewId)
pSeat->SetView(viewId);
IActionMapManager* pMapManager = gEnv->pGame->GetIGameFramework()->GetIActionMapManager();
assert(pMapManager);
pMapManager->EnableActionMap("landvehicle", false);
pMapManager->EnableActionMap("seavehicle", false);
pMapManager->EnableActionMap("helicopter", false);
pMapManager->EnableActionMap("vtol", false);
pMapManager->EnableFilter ( "vehicle_no_seat_change_and_exit", true );
}