コード例 #1
0
void CFlowItemAction::Update(SActivationInfo* pActInfo)
{
	m_timerCountDown -= gEnv->pTimer->GetFrameTime();
	if (m_timerCountDown > 0.0f)
		return;

	IItem* pItem = GetItem(pActInfo);
	if (pItem)
		pItem->SetBusy(false);

	pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
	ActivateOutput(pActInfo, IAO_Done, true);
}
コード例 #2
0
void CFlowItemAction::Activate(SActivationInfo* pActInfo)
{
	IItem* pItem = GetItem(pActInfo);
	if (!pItem)
		return;

	CItem* pItemImpl = static_cast<CItem*>(pItem);
	bool busy = GetPortBool(pActInfo, IAI_Busy);
	bool loop = GetPortBool(pActInfo, IAI_Loop);
	const string& actionName = GetPortString(pActInfo, IAI_Action);

	FragmentID fragID = pItemImpl->GetFragmentID(actionName);
	pItemImpl->PlayAction(fragID, 0, loop);

	if (busy)
	{
		pItem->SetBusy(true);
	}
	if (busy || !loop)
	{
		uint ownerAnimationtime = pItemImpl->GetCurrentAnimationTime(eIGS_Owner);
		StartDoneCountDown(pActInfo, ownerAnimationtime / (float)1000.0f);
	}
}