本文整理匯總了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');
}