本文整理汇总了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;
}
}
开发者ID:krslynx,项目名称:dotproduct,代码行数:27,代码来源:LocalPlayerSprite.ts
示例2: toggleMultifire_
/** Called when the local player toggles multifire. */
private toggleMultifire_(player : LocalPlayer, enabled : boolean) {
let resource = enabled ? 'multion' : 'multioff';
this.resourceManager_.playSound(resource);
}
开发者ID:krslynx,项目名称:dotproduct,代码行数:5,代码来源:LocalPlayerSprite.ts
示例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');
}
}
开发者ID:krslynx,项目名称:dotproduct,代码行数:7,代码来源:LocalPlayerSprite.ts
示例4: collectPrize_
/** Called when the local player collects a prize. */
private collectPrize_(player : Player, prize : Prize | null) {
this.resourceManager_.playSound('prize');
}
开发者ID:krslynx,项目名称:dotproduct,代码行数:4,代码来源:LocalPlayerSprite.ts
示例5: captureFlag_
/** Called when the local player captures a flag for the team. */
private captureFlag_(flag : Flag) {
this.resourceManager_.playSound('flag');
}
开发者ID:krslynx,项目名称:dotproduct,代码行数:4,代码来源:LocalPlayerSprite.ts
注:本文中的ResourceManager.playSound函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论