當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ResourceManager.playSound函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。