本文整理汇总了C++中CAudioManager::CreateSound方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudioManager::CreateSound方法的具体用法?C++ CAudioManager::CreateSound怎么用?C++ CAudioManager::CreateSound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAudioManager
的用法示例。
在下文中一共展示了CAudioManager::CreateSound方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUp
void CPlasmaShot::SetUp(int shotowner, CGameObject * projectileowner, float damage, float damageradius, float velocity)
{
// Save the type of object that shot this weapon
SetOwner(shotowner);
// Damage of the projectile
SetDamage((int)damage);
m_ProjectileOwner = projectileowner;
if(shotowner == PLAYER_SHOT || FRIENDLY_SHOT)
{
m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 9);
m_PlasmaInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLASMAINAIR], 1);
}
else if(shotowner == ENEMY_SHOT)
{
m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 7);
m_PlasmaInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLASMAINAIR], 6);
}
m_PlasmaInAir->Play3DAudio(10.0f, 10000.0f, 100);
m_Active = true;
m_Velocity = velocity;
m_DamageRadius = damageradius;
m_CreationTime = g_time;
m_LifeTime = 3.0f;
// Get the position of the object
GetPosition(&m_CurPosition, 0);
m_LastPosition = m_CurPosition;
}
示例2: SetUp
void CTrackingMissile::SetUp(int shotOwner, int damage, bool left, float damageradius, float accuracy, CGameObject * projectileowner)
{
// Save the type of object that shot this weapon
SetOwner(shotOwner);
m_Tracking = false;
m_UpdatePeriod = accuracy;
m_SlerpScale = 1.0f / m_UpdatePeriod;
m_DamageRadius = damageradius;
// Damage of the projectile
SetDamage(damage);
m_Velocity = 40.0f;
// Pointer to the game object that owns this shot
m_ProjectileOwner = projectileowner;
if(shotOwner == PLAYER_SHOT)
{
m_MissileExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 9);
m_MissileInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_MISSILEINAIR], 7);
}
else if(shotOwner == ENEMY_SHOT)
{
m_MissileExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 7);
m_MissileInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_MISSILEINAIR], 6);
}
m_MissileInAir->Play3DAudio(10.0f, 10000.0f, 75);
m_Active = true;
m_CreationTime = g_time;
m_LifeTime = 10.0f;
CObjFrame temp = *m_RenderObj.GetFrame(0);
temp.GetOrientation(&m_Q0);
m_Q2 = m_Q0;
temp.RotateLocalX(-PI / 6.0f);
temp.GetOrientation(&m_Q1);
// Get the position of the object
GetPosition(&m_CurPosition, 0);
m_LastPosition = m_CurPosition;
}
示例3: SetUp
void CIonFlare::SetUp(int shotowner, CGameObject * projectileowner, float damage, float damageradius, float velocity)
{
// Save the type of object that shot this weapon
SetOwner(shotowner);
// Damage of the projectile
SetDamage((int)damage);
m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLAYER_IONCANNON], 10);
m_Active = true;
m_Velocity = velocity;
m_DamageRadius = damageradius;
m_CreationTime = g_time;
m_LifeTime = 3.0f;
}