本文整理汇总了TypeScript中ResourceManager.playSound函数的典型用法代码示例。如果您正苦于以下问题:TypeScript playSound函数的具体用法?TypeScript playSound怎么用?TypeScript playSound使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了playSound函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: weaponFired_
private weaponFired_(player : LocalPlayer, weapon : any) {
switch (weapon.type) {
case Weapon.Type.GUN:
this.resourceManager_.playSound('gun' + weapon.level);
break;
case Weapon.Type.BOMB:
if (weapon.vel == Vector.ZERO) {
this.resourceManager_.playSound('mine' + weapon.level);
} else {
this.resourceManager_.playSound('bomb' + weapon.level);
}
break;
case Weapon.Type.BURST:
this.resourceManager_.playSound('burst');
break;
case Weapon.Type.DECOY:
this.resourceManager_.playSound('decoy');
break;
case Weapon.Type.REPEL:
this.resourceManager_.playSound('repel');
break;
}
}
示例2: toggleMultifire_
/** Called when the local player toggles multifire. */
private toggleMultifire_(player : LocalPlayer, enabled : boolean) {
let resource = enabled ? 'multion' : 'multioff';
this.resourceManager_.playSound(resource);
}
示例3: bounce_
/** Called when the local player bounces off a wall. */
private bounce_(player : Player) {
// If the player was speeding, play a sound on the bounce.
if (player.getVelocity().magnitude() > 1) {
this.resourceManager_.playSound('bounce');
}
}
示例4: collectPrize_
/** Called when the local player collects a prize. */
private collectPrize_(player : Player, prize : Prize | null) {
this.resourceManager_.playSound('prize');
}
示例5: captureFlag_
/** Called when the local player captures a flag for the team. */
private captureFlag_(flag : Flag) {
this.resourceManager_.playSound('flag');
}