本文整理汇总了C++中FActiveSound::SetIntParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ FActiveSound::SetIntParameter方法的具体用法?C++ FActiveSound::SetIntParameter怎么用?C++ FActiveSound::SetIntParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FActiveSound
的用法示例。
在下文中一共展示了FActiveSound::SetIntParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetIntParameter
void UAudioComponent::SetIntParameter( FName InName, int32 InInt )
{
if (InName != NAME_None)
{
bool bFound = false;
// First see if an entry for this name already exists
for (int32 i = 0; i < InstanceParameters.Num(); i++)
{
FAudioComponentParam& P = InstanceParameters[i];
if (P.ParamName == InName)
{
P.IntParam = InInt;
bFound = true;
break;
}
}
// We didn't find one, so create a new one.
if (!bFound)
{
const int32 NewParamIndex = InstanceParameters.AddZeroed();
InstanceParameters[NewParamIndex].ParamName = InName;
InstanceParameters[NewParamIndex].IntParam = InInt;
}
// If we're active we need to push this value to the ActiveSound
if (bIsActive)
{
// TODO - Audio Threading. This call would be a task
if (FAudioDevice* AudioDevice = GetAudioDevice())
{
FActiveSound* ActiveSound = AudioDevice->FindActiveSound(this);
if (ActiveSound)
{
ActiveSound->SetIntParameter(InName, InInt);
}
}
}
}
}