Skip to content
cccskills
FreePublished on GitHub

unity-audio-generator

Unity プロジェクト向けにプロシージャル音声(SE・BGM)を C# Editor スクリプトで生成する。「音声を生成」「SEを作って」「BGMを作って」「サウンドアセット」「AudioGenerator」「効果音」「プロシージャルオーディオ」といったリクエスト時に使用。

WAV ファイル(44100Hz/16bit/Mono)を Assets フォルダに直接出力し、外部ツール不要で完結する。

The English summary is being prepared. Showing the original description.

Works withUnity
See how to install

Files included (12)

  • SKILL.md3.9 KB
  • assets/samples/appear.wav17.3 KB
  • assets/samples/AudioGenerator.cs7.0 KB
  • assets/samples/bgm.wav689.1 KB
  • assets/samples/bomb.wav34.5 KB
  • assets/samples/button.wav6.9 KB
  • assets/samples/clear.wav68.9 KB
  • assets/samples/combo.wav10.4 KB
  • assets/samples/gameover.wav68.9 KB
  • assets/samples/hit.wav13.0 KB
  • assets/samples/warning.wav8.7 KB
  • references/waveform-patterns.md5.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Unity Audio Generator

Unity Editor スクリプトで SE・BGM を WAV ファイルとしてプロシージャル生成する。外部ツールや素材サイト不要。

ワークフロー

  1. ユーザーの要件を確認(必要な SE 種類、BGM の雰囲気)
  2. Assets/Scripts/Editor/AudioGenerator.cs を作成
  3. Unity で Tools/Generate All Audio Assets メニューを実行
  4. AudioManager 等に生成した AudioClip を割り当て

スクリプト作成ガイド

基本構造

using UnityEngine;
using UnityEditor;
using System.IO;

public static class AudioGenerator
{
    private const int SampleRate = 44100;

    [MenuItem("Tools/Generate All Audio Assets")]
    public static void GenerateAll()
    {
        GenerateSE();
        GenerateBGM();
        AssetDatabase.Refresh();
        Debug.Log("[AudioGenerator] All audio assets generated.");
    }

    // SE/BGM 生成メソッド...
    // SaveWav メソッド...
}
  • Editor/ フォルダに配置(ビルドに含まれない)
  • [MenuItem] で Unity メニューからワンクリック生成
  • 生成後 AssetDatabase.Refresh() で自動インポート

出力先

Assets/Audio/SE/   → SE ファイル群
Assets/Audio/BGM/  → BGM ファイル群

ディレクトリは SaveWav 内で自動作成される。

波形パターンの選び方

用途推奨波形パラメータ目安
ヒット・タップSine + 高 decay0.1-0.2s, 400-600Hz, decay 8-15
ボタンクリックSine + 高 decay0.05-0.1s, 600-800Hz, decay 12-20
爆発・衝撃Noise + ローパス0.3-0.5s, cutoff 80-150Hz
出現・スライドSweep (上昇)0.15-0.3s, 300→600Hz
ダメージ・ミスSweep (下降)0.2-0.3s, 500→100Hz
コイン・アイテムSine 高音0.1s, 1000-1500Hz, decay 10-15
クリアジングルArpeggio (上昇)C5-E5-G5-C6, 0.2s/note
ゲームオーバーArpeggio (下降)B4-G4-E4-C4, 0.2s/note
BGMMelody+Bass+Perc8-16s loop, sine 0.3vol

波形生成の詳細パターンとコード例は waveform-patterns.md を参照。

AudioManager との連携

生成した WAV は Unity が自動で AudioClip としてインポートする。AudioManager の SerializeField に Inspector からドラッグ&ドロップ、または MCP ツールで割り当てる。

// AudioManager 側の典型的な構成
[SerializeField] private AudioClip hitSE;
[SerializeField] private AudioClip bombSE;
[SerializeField] private AudioClip bgmClip;

サンプル

assets/samples/ にもぐら叩きゲーム用に生成した実例を同梱。

  • AudioGenerator.cs - 完全な生成スクリプト(SE 8種 + BGM 1曲)
  • SE: hit, bomb, appear, combo, warning, button, clear, gameover(各 WAV)
  • BGM: bgm.wav(8秒ループ、メロディ+ベース+パーカッション)

新規プロジェクトでは AudioGenerator.cs をベースにカスタマイズするのが最速。

注意事項

  • 生成スクリプトは Editor/ フォルダ必須(UnityEditor 名前空間使用のため)
  • WAV は 44100Hz / 16bit / Mono 固定(ブラウザゲーム向けに軽量)
  • BGM はループ再生前提で末尾を自然に終わらせる
  • volume は 0.3-0.8 程度に抑える(音割れ防止)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Unity カジュアルゲームを仕様駆動開発(Specification-Driven Development)で作成する。仕様を先に確定させ、設計・実装・テストを行うことで手戻りを最小化する。「ゲームを作って」「仕様駆動開発」「SDD」「ゲーム企画書」「機能仕様書」「技術仕様書」「テスト仕様書」「タスクリスト」「Unityゲーム開発」「カジュアルゲーム」といったリクエスト時に使用。Phase 1(企画書)からPhase 8(リリース)まで段階的にドキュメントを作成し、仕様に基づいて実装・テスト・検証を行う。

The English summary is being prepared. Showing the original description.

umezy/hcg-workflows6Updated Mar 18, 2026

ゲーム画面全てのスクリーンショットを撮影し、スクショとコードベースを分析して改善提案を行う。「レビュー」「改善提案」「ゲームレビュー」「スクショして改善」「画面チェック」「ビジュアルレビュー」「UI改善」「UX改善」「フィードバック」といったリクエスト時に使用。

The English summary is being prepared. Showing the original description.

umezy/hcg-workflows6Updated Mar 18, 2026

WebGL ビルド成果物を StatiCrypt で暗号化し、GitHub Pages にデプロイする。「デプロイ」「GitHub Pages」「公開して」「アップロード」といったリクエスト時に使用。パスワードは Build/ 内で管理し、リポジトリ作成からプッシュまでを自動化する。

The English summary is being prepared. Showing the original description.

umezy/hcg-workflows6Updated Mar 18, 2026

Unity MCP を使った実装検証スキル。コンパイルエラー確認(L1)、Play Mode 動作確認(L2)、スクリーンショット目視確認(L3)の3段階で検証する。「検証して」「動作確認」「Play Mode で確認」「スクリーンショットで確認」「エラーチェック」といったリクエスト時、または他スキル(dev-game 等)から参照されて使用。

The English summary is being prepared. Showing the original description.

umezy/hcg-workflows6Updated Mar 18, 2026

Unity MCPのセットアップと接続を行う。Unity EditorとClaude Codeの間でMCP接続を確立するための手順を実行する。「Unity MCP セットアップ」「MCP接続」「Unity MCP設定」「UnityMCP」「MCP For Unity」「MCPが繋がらない」「Unity Editorと接続」といったリクエスト時に使用。新規セットアップとトラブルシューティングの両方に対応。

The English summary is being prepared. Showing the original description.

umezy/hcg-workflows6Updated Mar 18, 2026

Unity ゲームに DebugManager + McpRemoteControl を実装し、エージェント(Claude Code / MCP)が Play Mode 中のゲーム状態を自動制御できるようにする。God モード、画面遷移、スコア操作を MCP から直接実行し、受け入れテストを人手なしで自動化する。「デバッグ」「DebugManager」「God モード」「MCP リモート制御」「自動テスト」「受け入れテスト自動化」といったリクエスト時、または dev-game スキルの Phase 6(DebugManager 実装)・Phase 7(テスト検証)から参照されて使用。

The English summary is being prepared. Showing the original description.

umezy/hcg-workflows6Updated Mar 18, 2026

See all skills by umezy

Report a problem with this skill