当前位置: 首页>>代码示例>>C++>>正文


C++ IPersistantDebug::AddEntityTag方法代码示例

本文整理汇总了C++中IPersistantDebug::AddEntityTag方法的典型用法代码示例。如果您正苦于以下问题:C++ IPersistantDebug::AddEntityTag方法的具体用法?C++ IPersistantDebug::AddEntityTag怎么用?C++ IPersistantDebug::AddEntityTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPersistantDebug的用法示例。


在下文中一共展示了IPersistantDebug::AddEntityTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProcessEvent

	void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
	{
#if !defined(_RELEASE)
		if (event == eFE_Initialize && IsPortActive(pActInfo, eIP_Draw))
		{
			m_waitTime = 0.0f;
			pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
		}
		else if (event == eFE_Activate && IsPortActive(pActInfo, eIP_Draw))
		{
			IEntity* pEntity = pActInfo->pEntity;
			if (pEntity)
			{
				IPersistantDebug* pPersistentDebug = CCryAction::GetCryAction()->GetIPersistantDebug();
				if (pPersistentDebug)
				{
					SEntityTagParams params;
					params.entity = pEntity->GetId();
					params.text = GetPortString(pActInfo, eIP_Message);
					params.size = GetPortFloat(pActInfo, eIP_FontSize);
					params.color = ColorF(GetPortVec3(pActInfo, eIP_Color), 1.0f);
					params.visibleTime = GetPortFloat(pActInfo, eIP_Time);
					params.fadeTime = GetPortFloat(pActInfo, eIP_FadeTime);
					params.viewDistance = GetPortFloat(pActInfo, eIP_ViewDistance);
					params.staticId = GetPortString(pActInfo, eIP_StaticID);
					params.column = GetPortInt(pActInfo, eIP_Column);
					params.tagContext = "FG_DrawEntityTagAdvanced";

					pPersistentDebug->AddEntityTag(params);

					m_waitTime = gEnv->pTimer->GetFrameStartTime() + (params.fadeTime + params.visibleTime);
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
				}
			}
		}
		else if (event == eFE_Update)
		{
			if (m_waitTime < gEnv->pTimer->GetFrameStartTime())
			{
				m_waitTime.SetSeconds(0.0f);
				pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
				ActivateOutput(pActInfo, eOP_Done, GetPortAny(pActInfo, eIP_Draw));
			}
		}
#endif
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:46,代码来源:FlowDebugNodes.cpp

示例2: PersistantEntityTag

//-------------------------------------------------------------------------
// Required Params: entityId, const char *text
// Optional Params: float size, Vec3 color, float visibleTime, float fadeTime, float viewDistance, const char* staticId, int columnNum, const char* contextTag
int CScriptBind_Action::PersistantEntityTag(IFunctionHandler* pH, ScriptHandle entityId, const char *text)
{
	IPersistantDebug* pPD = CCryAction::GetCryAction()->GetIPersistantDebug();

	SEntityTagParams params;
	params.entity = (EntityId)entityId.n;
	params.text = text;
	params.tagContext = "scriptbind";

	// Optional params
	if (pH->GetParamType(3) != svtNull) // Size
		pH->GetParam(3, params.size);
	if (pH->GetParamType(4) != svtNull) // Color
	{
		Vec3 color;
		pH->GetParam(4, color);
		params.color = ColorF(color, 1.f);
	}
	if (pH->GetParamType(5) != svtNull) // Visible Time
		pH->GetParam(5, params.visibleTime);
	if (pH->GetParamType(6) != svtNull) // Fade Time
		pH->GetParam(6, params.fadeTime);
	if (pH->GetParamType(7) != svtNull) // View Distance
		pH->GetParam(7, params.viewDistance);
	if (pH->GetParamType(8) != svtNull) // Static ID
	{
		const char *staticId;
		pH->GetParam(8, staticId);
		params.staticId = staticId;
	}
	if (pH->GetParamType(9) != svtNull) // Column Num
		pH->GetParam(9, params.column);
	if (pH->GetParamType(10) != svtNull) // Context Tag
	{
		const char *tagContext;
		pH->GetParam(10, tagContext);
		params.tagContext = tagContext; // overrides default one set above
	}

	pPD->AddEntityTag(params);
	
	return pH->EndFunction();
}
开发者ID:aronarts,项目名称:FireNET,代码行数:46,代码来源:ScriptBind_Action.cpp


注:本文中的IPersistantDebug::AddEntityTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。