# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
---
## [0.7.1] - 2025-12-18
### Added - 新機能
#### Audio System API (39 APIs) ⭐ New Feature
AudioSource、AudioListener、AudioClip、AudioMixerの包括的な操作APIを追加。
**AudioSource API (9 APIs)**
- `unity.audio.createSource` - AudioSource作成
- `unity.audio.deleteSource` - AudioSource削除
- `unity.audio.play` - 再生開始
- `unity.audio.stop` - 停止
- `unity.audio.pause` - 一時停止
- `unity.audio.setClip` - AudioClip設定
- `unity.audio.setProperty` - プロパティ設定 (volume, pitch, loop, spatialBlend等)
- `unity.audio.getInfo` - AudioSource情報取得
- `unity.audio.list` - シーン内AudioSource一覧
**AudioMixer Basic API (4 APIs)**
- `unity.audio.loadMixer` - AudioMixerロード
- `unity.audio.setMixerFloat` - Mixerパラメータ設定
- `unity.audio.getMixerFloat` - Mixerパラメータ取得
- `unity.audio.listMixerGroups` - MixerGroup一覧
**AudioMixer Extended API (18 APIs)**
- グループ操作: `getGroup`, `setGroupVolume`, `getGroupVolume`, `setGroupMute`, `listGroupEffects`
- エフェクト操作: `addEffect`, `removeEffect`, `moveEffect`, `getEffectParams`, `setEffectParam`, `getEffectEnabled`, `setEffectEnabled`
- スナップショット: `listSnapshots`, `transitionToSnapshot`, `clearSnapshots`
- センド操作: `setSend`, `getSend`
**AudioClip API (3 APIs)**
- `unity.audio.listClips` - AudioClip一覧
- `unity.audio.getClipInfo` - AudioClip情報取得
- `unity.audio.importClip` - 音声ファイルインポート
**AudioListener API (5 APIs)**
- `unity.audio.createListener` - AudioListener作成
- `unity.audio.deleteListener` - AudioListener削除
- `unity.audio.listListeners` - AudioListener一覧(複数検出時に警告)
- `unity.audio.getListenerInfo` - AudioListener情報取得
- `unity.audio.setListenerProperty` - プロパティ設定
#### InputSystem Extended API (12 APIs) ⭐ New Feature
Input Actionsの編集・管理APIを追加。
**Setup API (3 APIs)**
- `unity.inputsystem.getSetupStatus` - セットアップ状態確認
- `unity.inputsystem.createDefaultAsset` - Input Actionsアセット作成
- `unity.inputsystem.regenerateInputClass` - C#クラス再生成
**ActionMap API (3 APIs)**
- `unity.inputsystem.addActionMap` - アクションマップ追加
- `unity.inputsystem.removeActionMap` - アクションマップ削除
- `unity.inputsystem.listActionMaps` - アクションマップ一覧
**Action API (3 APIs)**
- `unity.inputsystem.addAction` - アクション追加
- `unity.inputsystem.removeAction` - アクション削除
- `unity.inputsystem.listActions` - アクション一覧
**Binding API (3 APIs)**
- `unity.inputsystem.addBinding` - バインディング追加
- `unity.inputsystem.removeBinding` - バインディング削除
- `unity.inputsystem.listBindings` - バインディング一覧
#### AnimatorOverride API (2 APIs) ⭐ New Feature
AnimatorOverrideControllerの作成・管理APIを追加。
- `unity.animator.createOverrideController` - AnimatorOverrideController作成
- `unity.animator.setOverrideClip` - オーバーライドクリップ設定
### Documentation
- Wiki: [Audio-APIs.md](https://github.com/dsgarage/CC2UniMCP/wiki/Audio-APIs) 追加
- Wiki: [InputSystem-APIs.md](https://github.com/dsgarage/CC2UniMCP/wiki/InputSystem-APIs) 追加
- Wiki: [AnimatorOverride-APIs.md](https://github.com/dsgarage/CC2UniMCP/wiki/AnimatorOverride-APIs) 追加
---
## [0.7.0] - 2025-12-13
### Added - 新機能
#### UIToolkit専用API (150+ APIs) - Issue #59 ⭐ Major Feature
UIToolkit専用の包括的なAPIを追加。アセットのセットアップからUI構築、シーン配置、Prefab化までをシームレスに対応。
**ファイル構成:**
```
Editor/UIToolkit/
├── UIToolkitAssetManager.cs - アセット管理
├── UIToolkitElementBuilder.cs - 要素操作
├── UIToolkitStyleOperations.cs - スタイル管理
├── UIToolkitComponentTemplates.cs - テンプレート
├── UIToolkitLayoutHelpers.cs - レイアウト
├── UIToolkitRuntimeOperations.cs - ランタイム操作
├── SceneSetup/
│ └── UIToolkitSceneSetup.cs - シーンセットアップ
├── Theme/
│ └── UIToolkitThemeManager.cs - テーマ管理
├── Localization/
│ └── UIToolkitLocalizationManager.cs - ローカライゼーション
├── Animation/
│ └── UIToolkitAnimationController.cs - アニメーション
├── Responsive/
│ └── UIToolkitResponsiveManager.cs - レスポンシブ
├── Presets/ - プリセット集
├── Debug/
│ └── UIToolkitDebugTools.cs - デバッグツール
├── Accessibility/
│ └── UIToolkitAccessibilityManager.cs - アクセシビリティ
├── AssetDependencies/
│ └── UIToolkitAssetDependencyManager.cs - 依存関係
└── DI/ - DI/MVVMパターン
```
##### Phase 1: アセット管理 (10 APIs)
- `unity.uitoolkit.asset.createUxml` - UXML作成(テンプレート選択可能)
- `unity.uitoolkit.asset.getUxmlContent` - UXML内容取得
- `unity.uitoolkit.asset.updateUxml` - UXML内容更新
- `unity.uitoolkit.asset.createUss` - USS作成
- `unity.uitoolkit.asset.getUssContent` - USS内容取得
- `unity.uitoolkit.asset.updateUss` - USS内容更新
- `unity.uitoolkit.asset.linkStyleSheet` - UXMLにUSSをリンク
- `unity.uitoolkit.asset.createPanelSettings` - PanelSettings作成
- `unity.uitoolkit.asset.getPanelSettings` - PanelSettings取得
- `unity.uitoolkit.asset.updatePanelSettings` - PanelSettings更新
##### Phase 2: UXML要素操作 (7 APIs)
- `unity.uitoolkit.element.add` - 要素追加
- `unity.uitoolkit.element.remove` - 要素削除
- `unity.uitoolkit.element.update` - 要素更新
- `unity.uitoolkit.element.query` - 要素クエリ
- `unity.uitoolkit.element.getHierarchy` - 要素階層取得
- `unity.uitoolkit.element.move` - 要素移動
- `unity.uitoolkit.element.duplicate` - 要素複製
##### Phase 3: スタイル操作 (11 APIs)
- `unity.uitoolkit.style.addRule` - USSルール追加
- `unity.uitoolkit.style.updateRule` - USSルール更新
- `unity.uitoolkit.style.removeRule` - USSルール削除
- `unity.uitoolkit.style.getRule` - USSルール取得
- `unity.uitoolkit.style.setProperty` / `removeProperty`
- `unity.uitoolkit.style.setVariable` / `getVariables`
- `unity.uitoolkit.style.setInlineStyle`
- `unity.uitoolkit.style.addClass` / `removeClass`
##### Phase 4: UI部品テンプレート (13 APIs)
- `unity.uitoolkit.template.textField` - テキストフィールド
- `unity.uitoolkit.template.button` - ボタン
- `unity.uitoolkit.template.toggle` - トグル
- `unity.uitoolkit.template.slider` - スライダー
- `unity.uitoolkit.template.dropdown` - ドロップダウン
- `unity.uitoolkit.template.card` - カード
- `unity.uitoolkit.template.scrollView` - スクロールビュー
- `unity.uitoolkit.template.foldout` - フォールドアウト
- `unity.uitoolkit.template.tabView` - タブビュー
- `unity.uitoolkit.template.listView` - リストビュー
- `unity.uitoolkit.template.treeView` - ツリービュー
- `unity.uitoolkit.template.progressBar` - プログレスバー
- `unity.uitoolkit.template.form` - フォーム
##### Phase 5: レイアウトヘルパー (10 APIs)
- `unity.uitoolkit.layout.flexContainer` / `flexRow` / `flexColumn`
- `unity.uitoolkit.layout.center` / `spacer`
- `unity.uitoolkit.layout.grid` / `gridItem`
- `unity.uitoolkit.layout.screenLayout` / `absolutePosition`
- `unity.uitoolkit.layout.generateStyles`
##### Phase 6: ランタイム操作 (15 APIs)
- `unity.uitoolkit.runtime.createUIDocument` / `getUIDocument` / `listUIDocuments`
- `unity.uitoolkit.runtime.query` / `getHierarchy`
- `unity.uitoolkit.runtime.setText` / `setValue` / `setVisible` / `setEnabled`
- `unity.uitoolkit.runtime.addClass` / `removeClass`
- `unity.uitoolkit.runtime.generateController` / `generateEventHandler`
- `unity.uitoolkit.runtime.listInteractiveElements` / `generateBindingCode`
##### シーンセットアップ (8 APIs) - 新規追加
シーン選択 → GameObject作成 → UIDocument設定 → Prefab化までのワンセット操作。
- `unity.uitoolkit.scene.setupComplete` - 完全セットアップ(ワンショット)
- `unity.uitoolkit.scene.setTargetScene` - ターゲットシーン設定
- `unity.uitoolkit.scene.getLoadedScenes` - ロード済みシーン一覧
- `unity.uitoolkit.scene.createUIGameObject` - UI用GameObject作成
- `unity.uitoolkit.scene.configureUIDocument` - UIDocument設定
- `unity.uitoolkit.scene.saveAsPrefab` - Prefab保存
- `unity.uitoolkit.scene.instantiatePrefab` - Prefabインスタンス化
- `unity.uitoolkit.scene.getUIDocumentsInScene` - シーン内UIDocument一覧
**使用例(ワンショットセットアップ):**
```json
{
"method": "unity.uitoolkit.scene.setupComplete",
"params": {
"gameObjectName": "MainMenuUI",
"uxmlPath": "Assets/UI/MainMenu.uxml",
"panelSettingsPath": "Assets/UI/DefaultPanelSettings.asset",
"sortingOrder": 10,
"createPrefab": true,
"prefabPath": "Assets/Prefabs/UI/MainMenuUI.prefab"
}
}
```
##### テーマ管理 (8 APIs)
- `unity.uitoolkit.theme.create` / `get` / `list` / `delete`
- `unity.uitoolkit.theme.setColor` / `setSpacing`
- `unity.uitoolkit.theme.generateUSS` / `generateDarkModeUSS`
##### ローカライゼーション (11 APIs)
- `unity.uitoolkit.localization.addLocale` / `removeLocale` / `listLocales`
- `unity.uitoolkit.localization.setCurrentLocale`
- `unity.uitoolkit.localization.addTranslation` / `addTranslations` / `getTranslation`
- `unity.uitoolkit.localization.generateScript`
- `unity.uitoolkit.localization.exportToJson` / `importFromJson`
- `unity.uitoolkit.localization.generateRTLStyles`
##### アニメーション (10 APIs)
- `unity.uitoolkit.animation.define` / `addKeyframe` / `remove` / `list`
- `unity.uitoolkit.animation.generateTransitionUSS`
- `unity.uitoolkit.animation.createFade` / `createSlide` / `createScale` / `createRotate`
- `unity.uitoolkit.animation.applyToElement`
##### レスポンシブデザイン (7 APIs)
- `unity.uitoolkit.responsive.setBreakpoint` / `getBreakpoints` / `removeBreakpoint`
- `unity.uitoolkit.responsive.createRuleSet` / `addBreakpointStyle`
- `unity.uitoolkit.responsive.generateUSS` / `generateHelperScript`
##### プリセット (18+ APIs)
- ナビゲーションUI: tabBar, bottomNav, sidebar, breadcrumb, pagination, contextMenu, dropdown, navbar
- ゲームUI: hud, healthBar, inventory, quickSlots, skillBar, dialogBox, virtualJoystick, dpad, actionButtons
- 通知UI: alertBar, tooltip, badge, loadingOverlay
##### デバッグツール (7 APIs)
- `unity.uitoolkit.debug.analyzeUXML` / `analyzeUSS`
- `unity.uitoolkit.debug.validateUXML` / `validateUSS`
- `unity.uitoolkit.debug.generateOverlay` / `generateScript` / `profileUI`
##### アクセシビリティ (7 APIs)
- `unity.uitoolkit.accessibility.setAriaLabel` / `setTabIndex` / `setRole`
- `unity.uitoolkit.accessibility.generateFocusStyles` / `checkColorContrast`
- `unity.uitoolkit.accessibility.generateScreenReaderHelper` / `generateHighContrastUSS`
##### アセット依存関係 (5 APIs)
- `unity.uitoolkit.dependency.analyze` / `findReferences` / `findUnused`
- `unity.uitoolkit.dependency.generateGraph` / `analyzeBundle`
##### DI/MVVM (30+ APIs)
- DIコンテナ、状態管理、イベントバス、MVVMパターン、データバインディング、ViewModel生成、バインディングビルダー
##### テスト
- 22個のテストファイルを作成(日本語メソッド名)
- UIToolkitTestUtility - テストクリーンアップユーティリティ
#### Compositing API (Issue #70)
意図ベースのコンポジット視点でのルック管理システムを追加。
**Core APIs:**
- `unity.compositing.analyzeScene` - シーン全体のコンポジット状態分析
- `unity.compositing.setIntent` - 意図ベースのルック設定(dramatic, soft, vibrant等)
- `unity.compositing.diagnose` - レンダリング・ポストプロセス問題診断
- `unity.compositing.quickSetup` - シーン全体のクイックセットアップ
**Preset APIs:**
- `unity.compositing.presets.list` - 利用可能なプリセット一覧
- `unity.compositing.presets.apply` - プリセット適用
- `unity.compositing.presets.save` - カスタムプリセット保存
**使用例:**
```json
// シーン分析
{
"method": "unity.compositing.analyzeScene",
"params": {}
}
// ドラマチックなルック設定
{
"method": "unity.compositing.setIntent",
"params": {
"intent": "dramatic",
"intensity": 0.8
}
}
```
**アーキテクチャ改善:**
- `PackageApiInvoker` - リフレクションベースのAPI呼び出し機構
- パッケージ依存APIの疎結合化(#if ディレクティブからリフレクションへ移行)
- `McpApiLogger` - API呼び出しログ機能
#### Volume API追加 (Issue #67)
Volume/PostProcessing APIを拡張。
- `unity.volume.createProfile` - 新規VolumeProfile作成
- `unity.volume.assignProfile` - VolumeへのProfile割り当て
#### Core API追加 (Issue #69)
基本APIの機能拡張。
- `unity.gameobject.destroy` - GameObject削除API
- `unity.renderer.setMaterial` - RendererへのMaterial適用API
- `LightingCore` - パラメータ処理の改善(ネストオブジェクト対応)
### Changed - 変更
#### テスト日本語化
テストコードを日本語で記述するルールを追加。
- テストメソッド名: 日本語
- コメント・Assertメッセージ: 日本語
- `Samples~/CameraExtension/Tests/Editor/CameraTests.cs` 全面改訂
- `Samples~/VolumeExtension/Tests/Editor/VolumeTests.cs` リフレクションベースに改訂
#### テストasmdef修正
- GUID参照から名前参照への変更
- `LocalMcp.CameraExtension.Tests.Editor.asmdef`
- `LocalMcp.VolumeExtension.Tests.Editor.asmdef`
#### package.json サンプル定義追加
- Camera Extension
- Volume Extension
- Compositing Extension
#### TextMeshPro FontAsset APIs (2 APIs)
FontAsset情報取得機能をTextMeshPro APIに追加。
- `unity.textmeshpro.getFontAssetInfo` - FontAsset詳細情報取得
- フォント名、ファミリー名、スタイル名
- ポイントサイズ、スケール
- アセントライン、キャップライン、ミーンライン、ベースライン、ディセントライン
- アトラスサイズ(幅・高さ)
- 文字数、グリフ数
- マテリアル名、シェーダー名
- フォールバックフォント数
- `unity.textmeshpro.listFontAssets` - プロジェクト内FontAsset一覧取得
- searchPath: 検索パス指定
- includePackages: パッケージ内フォント含む(デフォルト: true)
**使用例:**
```json
// FontAsset情報取得
{
"method": "unity.textmeshpro.getFontAssetInfo",
"params": {
"gameObjectPath": "Canvas/TitleText"
}
}
// FontAsset一覧取得
{
"method": "unity.textmeshpro.listFontAssets",
"params": {
"includePackages": true
}
}
```
#### Material API (12 APIs)
マテリアルのプロパティ取得・設定機能を追加。
**Core APIs:**
- `unity.material.getInfo` - マテリアル情報取得
- `unity.material.getProperty` - 特定プロパティ値取得
- `unity.material.setProperty` - プロパティ値設定(型自動判定)
- `unity.material.listProperties` - シェーダープロパティ一覧
**Convenience APIs:**
- `unity.material.setColor` - カラープロパティ設定(HEX対応)
- `unity.material.setFloat` - Float/Rangeプロパティ設定
- `unity.material.setVector` - Vectorプロパティ設定
- `unity.material.setTexture` - テクスチャ設定
- `unity.material.setKeyword` - シェーダーキーワード有効/無効
- `unity.material.setRenderQueue` - レンダーキュー設定
**Utility APIs:**
- `unity.material.create` - 新規マテリアル作成
- `unity.material.copyProperties` - プロパティコピー
**使用例:**
```json
// マテリアル情報取得
{
"method": "unity.material.getInfo",
"params": {
"gameObjectPath": "Cube",
"includeAllProperties": true
}
}
// カラー設定
{
"method": "unity.material.setColor",
"params": {
"gameObjectPath": "Cube",
"propertyName": "_Color",
"color": "#FF5500"
}
}
// Metallic設定
{
"method": "unity.material.setFloat",
"params": {
"gameObjectPath": "Cube",
"propertyName": "_Metallic",
"value": 0.8
}
}
// エミッション有効化
{
"method": "unity.material.setKeyword",
"params": {
"gameObjectPath": "Cube",
"keyword": "_EMISSION",
"enabled": true
}
}
```
#### Shader API (22 APIs)
ShaderGraphではカバーできないシェーダーカテゴリ専用のAPI。
**関連Issue:** #63
**Core Shader APIs (5 APIs):**
- `unity.shader.getInfo` - シェーダー情報取得
- `unity.shader.reimport` - シェーダー再インポート
- `unity.shader.getCompileErrors` - コンパイルエラー取得
- `unity.shader.listAll` - 全シェーダー一覧
- `unity.shader.find` - キーワード/カテゴリ検索
**TextMeshPro Shader APIs (6 APIs):**
- `unity.shader.tmp.listPresets` - TMPシェーダープリセット一覧
- `unity.shader.tmp.applyDistanceField` - Distance Fieldシェーダー適用
- `unity.shader.tmp.setOutline` - アウトライン効果設定
- `unity.shader.tmp.setGlow` - グロー効果設定
- `unity.shader.tmp.setBevel` - ベベル効果設定
- `unity.shader.tmp.setUnderlay` - アンダーレイ効果設定
**UI Shader APIs (4 APIs):**
- `unity.shader.ui.listPresets` - UIシェーダープリセット一覧
- `unity.shader.ui.applyDefault` - デフォルトUIシェーダー適用
- `unity.shader.ui.setMask` - マスク設定
- `unity.shader.ui.setStencil` - ステンシル設定
**Particle Shader APIs (3 APIs):**
- `unity.shader.particle.listPresets` - パーティクルシェーダープリセット一覧
- `unity.shader.particle.applyShader` - パーティクルシェーダー適用
- `unity.shader.particle.setBlendMode` - ブレンドモード設定
**Skybox Shader APIs (4 APIs):**
- `unity.shader.skybox.listPresets` - スカイボックスシェーダープリセット一覧
- `unity.shader.skybox.applyProcedural` - プロシージャルスカイボックス適用
- `unity.shader.skybox.applyCubemap` - キューブマップスカイボックス適用
- `unity.shader.skybox.applyPanoramic` - パノラマスカイボックス適用
**Sprite Shader APIs (2 APIs):**
- `unity.shader.sprite.listPresets` - スプライトシェーダープリセット一覧
- `unity.shader.sprite.applyShader` - スプライトシェーダー適用
**使用例:**
```json
// シェーダー情報取得
{
"method": "unity.shader.getInfo",
"params": {
"shaderName": "Standard"
}
}
// TMPアウトライン設定
{
"method": "unity.shader.tmp.setOutline",
"params": {
"materialName": "TMP_Material",
"color": "#FF0000",
"width": 0.2
}
}
// パーティクルブレンドモード設定
{
"method": "unity.shader.particle.setBlendMode",
"params": {
"materialName": "ParticleMaterial",
"blendMode": "additive"
}
}
```
### Changed - 変更
- `unity.textmeshpro.getInfo` に `includeFontAssetInfo` パラメーター追加
- true指定でFontAsset情報も含めて返す
#### uGUI API (13 APIs)
Unity uGUI (Canvas, RectTransform, UI要素) をMCP経由で制御するAPIセットを追加。
**関連Issue:** #62
**RectTransform APIs (6 APIs):**
- `unity.rectTransform.setSize` - sizeDelta設定(幅・高さ)
- `unity.rectTransform.setPosition` - anchoredPosition設定
- `unity.rectTransform.setAnchors` - anchorMin/Max設定
- `unity.rectTransform.setPivot` - pivot設定
- `unity.rectTransform.setOffsets` - offsetMin/Max設定
- `unity.rectTransform.getInfo` - RectTransform情報取得
**Canvas APIs (3 APIs):**
- `unity.canvas.create` - Canvas + EventSystem作成
- renderMode: ScreenSpaceOverlay/Camera/WorldSpace
- scalerMode: ScaleWithScreenSize/ConstantPixelSize/ConstantPhysicalSize
- referenceResolution設定
- `unity.canvas.setScaler` - CanvasScaler設定変更
- `unity.canvas.getInfo` - Canvas情報取得
**UI Element Presets (4 APIs):**
- `unity.ui.createButton` - Button作成(Text子オブジェクト付き)
- `unity.ui.createPanel` - Panel作成(背景色設定可能)
- `unity.ui.createImage` - Image作成(Sprite設定可能)
- `unity.ui.createText` - Legacy Text作成(TMPro非使用時用)
**使用例:**
```json
// Canvas作成
{
"method": "unity.canvas.create",
"params": {
"name": "MainCanvas",
"renderMode": "ScreenSpaceOverlay",
"scalerMode": "ScaleWithScreenSize",
"referenceResolution": {"x": 1920, "y": 1080}
}
}
// RectTransformサイズ設定
{
"method": "unity.rectTransform.setSize",
"params": {
"gameObjectPath": "MainCanvas/Panel",
"width": 400,
"height": 300
}
}
// 中央配置
{
"method": "unity.rectTransform.setAnchors",
"params": {
"gameObjectPath": "MainCanvas/Panel",
"anchorMin": {"x": 0.5, "y": 0.5},
"anchorMax": {"x": 0.5, "y": 0.5}
}
}
// Button作成
{
"method": "unity.ui.createButton",
"params": {
"name": "SubmitButton",
"parent": "MainCanvas",
"text": "Submit",
"width": 200,
"height": 50
}
}
```
#### uGUI Extension (Sample)
Package ManagerからインポートできるuGUI APIのテストスイート。
**インポート方法:**
1. Package Manager > Unity MCP Server > Samples
2. "uGUI Extension" の Import をクリック
**含まれるテスト:**
- 20個のuGUI API全てのEditmodeテスト
- RectTransform, Canvas, UI要素のテスト
- 統合ワークフローテスト
**テスト実行:**
Window > General > Test Runner > EditMode > LocalMcp.uGUIExtension.Tests.Editor
#### TextMeshPro API (13 APIs)
TextMeshProテキストを詳細に設定・自動作成するAPIセットを追加。
`com.unity.textmeshpro`パッケージの有無に関わらず、適切にエラーハンドリングが行われます。
**関連Issue:** #61
**Core APIs (9 APIs):**
- `unity.textmeshpro.create` - TextMeshProオブジェクト作成(UI/3D)
- UI用(TextMeshProUGUI)と3D用(TextMeshPro)の両方をサポート
- 親オブジェクト指定、位置指定、初期フォントサイズ設定
- `unity.textmeshpro.setText` - テキスト内容変更
- `unity.textmeshpro.setStyle` - スタイル設定
- フォントサイズ、フォントスタイル(Bold/Italic/Underline等)
- 色(HEX形式: #RRGGBB, #RRGGBBAA)
- アウトライン色・幅、頂点グラデーント
- `unity.textmeshpro.setLayout` - レイアウト設定
- アライメント(Left/Center/Right/Justified等)
- 文字間隔、単語間隔、行間隔、段落間隔
- ワードラップ
- `unity.textmeshpro.setAutoSize` - 自動サイズ調整設定
- 最小/最大フォントサイズ
- `unity.textmeshpro.setOverflow` - オーバーフローモード設定
- Overflow/Ellipsis/Masking/Truncate/ScrollRect/Page/Linked
- `unity.textmeshpro.setFont` - フォントアセット設定
- `unity.textmeshpro.getInfo` - TMP情報取得
- コンポーネントタイプ、テキスト内容、スタイル設定
- レンダリング情報(preferredWidth/Height等)
- `unity.textmeshpro.createMultiple` - 複数テキスト一括作成
**Preset APIs (4 APIs):**
- `unity.textmeshpro.preset.title` - タイトルプリセット
- hero(72pt、bold、centered、white)
- chapter(48pt、bold、left-aligned、gradient)
- section(36pt、bold、left-aligned)
- subtitle(24pt、italic、centered、gray)
- `unity.textmeshpro.preset.body` - 本文プリセット
- default(18pt、normal、left-aligned、word wrap)
- small(14pt、normal、gray)
- large(24pt、normal、wider spacing)
- caption(12pt、italic、centered、gray)
- `unity.textmeshpro.preset.button` - ボタンプリセット
- primary(20pt、bold、centered、white)
- secondary(18pt、normal、centered、light gray)
- danger(20pt、bold、centered、red)
- success(20pt、bold、centered、green)
- link(18pt、underline、centered、blue)
- `unity.textmeshpro.preset.hud` - HUDプリセット
- score(32pt、bold、right-aligned、gold)
- timer(36pt、bold、centered、white)
- health(28pt、bold、left-aligned、red)
- ammo(24pt、bold、right-aligned、light blue)
- notification(20pt、normal、centered、yellow)
- damage(40pt、bold、centered、red with outline)
- level(24pt、bold、left-aligned、green)
**使用例:**
```json
// UI用TextMeshProを作成
{
"method": "unity.textmeshpro.create",
"params": {
"gameObjectName": "TitleText",
"parent": "Canvas",
"text": "Game Title",
"type": "ui",
"fontSize": 48
}
}
// スタイルを設定
{
"method": "unity.textmeshpro.setStyle",
"params": {
"gameObjectPath": "Canvas/TitleText",
"fontSize": 48,
"fontStyle": "Bold",
"color": "#FFD700"
}
}
// HUDプリセットを適用
{
"method": "unity.textmeshpro.preset.hud",
"params": {
"gameObjectName": "ScoreText",
"parent": "Canvas/HUD",
"text": "Score: 0",
"style": "score"
}
}
```
**技術的特徴:**
- リフレクションによるTMProパッケージへの動的アクセス
- パッケージ未インストール時の適切なエラーハンドリング
- HEXカラーコード(#RRGGBB、#RRGGBBAA)のサポート
- UI用(TextMeshProUGUI)と3D用(TextMeshPro)の両対応
#### TextMeshPro Extension (Sample)
Package ManagerからインポートできるTextMeshPro APIのテストスイート。
**インポート方法:**
1. Package Manager > Unity MCP Server > Samples
2. "TextMeshPro Extension" の Import をクリック
**含まれるテスト:**
- 22個のTextMeshPro API全てのEditmodeテスト
- パッケージ検出と未インストール時のグレースフルな動作
- 日本語のテスト名とメッセージ
**テスト実行:**
Window > General > Test Runner > EditMode > LocalMcp.TextMeshProExtension.Tests.Editor
#### Component Property API (1 API)
TextMeshProなどランタイムプロパティを持つコンポーネントの設定に対応。
- `unity.component.setProperty` - リフレクションによるプロパティ設定
- SerializedPropertyを使わないランタイムプロパティに対応
- HEXカラー文字列のサポート(#RGB, #RGBA, #RRGGBB, #RRGGBBAA)
- enum値の名前指定(case-insensitive)
- Vector2/Vector3/Vector4/Color/Quaternionのサポート
**使用例:**
```json
// TextMeshProのテキスト設定
{
"method": "unity.component.setProperty",
"params": {
"gameObjectPath": "Canvas/TitleText",
"componentType": "TMPro.TextMeshProUGUI",
"propertyName": "text",
"value": "Hello World"
}
}
// HEXカラー設定
{
"method": "unity.component.setProperty",
"params": {
"gameObjectPath": "Canvas/TitleText",
"componentType": "TMPro.TextMeshProUGUI",
"propertyName": "color",
"value": "#FFD700"
}
}
```
#### Debug Diagnostics API (5 APIs)
バグ診断・トラブルシューティング支援のための包括的なAPIセットを追加。
Claude Codeによるバグ対応を効率化します。
**関連Issue:** #60
**診断API (3 APIs):**
- `unity.debug.diagnose` - シーン全体またはGameObjectの総合診断
- Missing参照、Missingスクリプト、nullコンポーネントの検出
- 未設定のAnimator Controller検出
- パフォーマンス・レンダリング問題の検出
- 深刻度別(critical/warning/info)のレポート
- `unity.debug.findProblematicObjects` - 問題タイプ別にGameObjectを検索
- コンポーネントフィルタによる絞り込み
- 非アクティブオブジェクトの検査オプション
- `unity.debug.inspectObject` - 特定GameObjectの詳細診断
- 子オブジェクトの再帰的検査
- Transform情報、コンポーネント状態の詳細
**エラーログ分析API (1 API):**
- `unity.debug.analyzeErrorLogs` - コンソールログの分析とパターン検出
- NullReferenceException、MissingReferenceExceptionなどのパターン認識
- エラー発生箇所(スクリプト名、メソッド名、行番号)の特定
- 関連GameObjectの推測
- 修正提案の自動生成
**レポート生成API (1 API):**
- `unity.debug.generateReport` - 包括的な診断レポートの生成
- Markdown形式 or JSON形式で出力
- シーン統計情報(GameObject数、メッシュ数、ライト数など)
- パフォーマンスメトリクス(頂点数、三角形数、マテリアル数など)
- Missing参照・Missingスクリプトの一覧
- 推奨事項(Recommendations)の自動生成
**使用例:**
```json
// シーン全体を診断
{
"method": "unity.debug.diagnose",
"params": {
"scope": "scene",
"checks": ["missingReferences", "missingScripts"]
}
}
// エラーログを分析
{
"method": "unity.debug.analyzeErrorLogs",
"params": {
"timeRange": 300,
"detectPatterns": true
}
}
// Markdownレポートを生成
{
"method": "unity.debug.generateReport",
"params": {
"format": "markdown"
}
}
```
**技術的特徴:**
- 既存のSerializedObjectInspectorとGlobalLogCaptureを活用
- エラーパターンの自動分類と修正提案
- パフォーマンス問題の自動検出
#### Unity Recorder API (23 APIs)
Unity公式のRecorderパッケージ(com.unity.recorder)をMCP経由で制御するAPIを追加。
#### Recorder MCP Extension (Sample)
Package ManagerからインポートできるRecorder APIのテストスイート。
**インポート方法:**
1. Package Manager > Unity MCP Server > Samples
2. "Recorder MCP Extension" の Import をクリック
**含まれるテスト:**
- 23個のRecorder API全てのEditmodeテスト
- パッケージ検出と未インストール時のグレースフルな動作
- 日本語のテスト名とメッセージ
**テスト実行:**
Window > General > Test Runner > EditMode > LocalMcp.RecorderExtension.Tests.Editor
**プリセットAPI (6 APIs):**
- `unity.recorder.preset.qaTestVideo` - QAテスト用動画録画(MP4, Medium品質)
- `unity.recorder.preset.cinematicExport` - 高品質シネマティック書き出し(ProRes/MP4, 4K)
- `unity.recorder.preset.gifCapture` - SNS用GIF作成
- `unity.recorder.preset.thumbnailSequence` - サムネイル画像生成
- `unity.recorder.preset.motionCapture` - キャラクターモーション録画
- `unity.recorder.preset.audioCapture` - 音声のみ録画
**基本操作API (6 APIs):**
- `unity.recorder.createSession` - 録画セッション作成
- `unity.recorder.prepareRecording` - 録画準備
- `unity.recorder.startRecording` - 録画開始(Playモード必須)
- `unity.recorder.stopRecording` - 録画停止・ファイル生成
- `unity.recorder.isRecording` - 録画状態確認
- `unity.recorder.getStatus` - 詳細ステータス取得
**設定API (6 APIs):**
- `unity.recorder.setFrameRate` - フレームレート設定
- `unity.recorder.setCapFrameRate` - フレームレート制限設定
- `unity.recorder.setRecordModeManual` - マニュアルモード設定
- `unity.recorder.setRecordModeFrameInterval` - フレーム範囲モード設定
- `unity.recorder.setRecordModeTimeInterval` - 時間範囲モード設定
- `unity.recorder.setRecordModeSingleFrame` - 単一フレームモード設定
**詳細Recorder作成API (3 APIs):**
- `unity.recorder.createMovieRecorder` - Movie Recorder作成(詳細設定)
- `unity.recorder.createImageRecorder` - Image Recorder作成(詳細設定)
- `unity.recorder.createAnimationRecorder` - Animation Recorder作成
**管理API (2 APIs):**
- `unity.recorder.listRecorderSettings` - Recorder設定一覧取得
- `unity.recorder.clearSession` - セッションクリア
**ハイブリッドアプローチ:**
- プリセットAPIで簡単に即使用可能
- 基本APIで詳細なカスタマイズも可能
**技術的特徴:**
- リフレクションによるRecorderパッケージへの動的アクセス
- パッケージ未インストール時の適切なエラーハンドリング
- Editor専用(スタンドアロンビルドでは不可)
**関連Issue:** #55
### Fixed - バグ修正
#### テストサンプル修正
パッケージ依存テストのasmdef設定とAPIテストの修正。
**asmdef defineConstraints追加:**
- `LocalMcp.RecorderExtension.Tests.Editor.asmdef` - `UNITY_RECORDER`
- `LocalMcp.CinemachineExtension.Tests.Editor.asmdef` - `CINEMACHINE_2_OR_NEWER || CINEMACHINE_3_OR_NEWER`
- `LocalMcp.ShaderGraphExtension.Tests.Editor.asmdef` - `SHADERGRAPH_AVAILABLE`
- `TimelineExtensionTests.asmdef` - `UNITY_TIMELINE`
- `ProBuilderExtensionTests.asmdef` - `PROBUILDER_5_0_OR_NEWER`
- `LocalMcp.VolumeExtension.Tests.Editor.asmdef` - `URP_AVAILABLE`
- `LocalMcp.CompositingExtension.Tests.Editor.asmdef` - `URP_AVAILABLE || HDRP_AVAILABLE`
**テストusing文追加:**
- CinemachineApiTests.cs: `using LocalMcp.UnityServer.Cinemachine;`
- ShaderGraphBuilderTests.cs: `using LocalMcp.UnityServer.ShaderGraph;`
- RecorderControllerTests.cs: `using LocalMcp.UnityServer.Recorder;`
- VolumeTests.cs: `using LocalMcp.UnityServer.Volume;`
- CompositingTests.cs: `using LocalMcp.UnityServer.Compositing;`
#### JSONレスポンス形式修正
- `JsonRpcResponseHelper.SuccessJson` メソッド追加 - 生のJSONを結果として返す
- `MaterialController.cs` - SuccessMessageからSuccessJsonに変更
- `ShaderController.cs` - SuccessMessageからSuccessJsonに変更
#### テストアサーション修正
- `ShaderTests.cs` - `keyword`パラメータを`shaderName`に修正
- `TestRunnerControlTests.cs` - エラーチェックを柔軟に修正
- `MaterialApplyTests.cs` - success判定を両形式対応に修正
#### uGUIController修正
- `ExtractFloatParam`ヘルパー追加 - JsonUtilityのnullable float非対応を回避
---
## [0.6.4] - 2025-12-11
### Added - 新機能
#### Timeline API (42 APIs) - Issue #56
Unity Timelineパッケージ対応の包括的なAPIセットを追加。
**TimelineAsset管理 (6 APIs):**
- `unity.timeline.create` / `delete` / `get` / `list`
- `unity.timeline.setDuration` / `duplicate`
**PlayableDirector制御 (10 APIs):**
- `unity.timeline.director.bind` / `play` / `stop` / `pause` / `resume`
- `unity.timeline.director.setTime` / `evaluate` / `getState`
- `unity.timeline.director.setBinding` / `getBindings`
**Track操作 (10 APIs):**
- `unity.timeline.track.create` / `delete` / `get` / `list`
- `unity.timeline.track.setMuted` / `setLocked` / `setParent` / `reorder`
- `unity.timeline.track.setAnimationTrackSettings` / `setActivationTrackSettings`
**Clip操作 (12 APIs):**
- `unity.timeline.clip.create` / `delete` / `get` / `list` / `duplicate`
- `unity.timeline.clip.setTiming` / `setBlend` / `setEase` / `setDisplayName`
- `unity.timeline.clip.setAnimationClipSettings` / `setAudioClipSettings` / `setControlClipSettings`
**Marker操作 (4 APIs):**
- `unity.timeline.marker.create` / `delete` / `list`
- `unity.timeline.marker.setSignalEmitterSettings`
## [0.6.3] - 2025-12-09
### Fixed - バグ修正
- Set Asset Array APIの修正
## [0.6.2] - 2025-12-09
### Fixed - バグ修正
- HTTP Server APIルーティングの修正
## [0.6.1] - 2025-12-09
### Fixed - バグ修正
- 軽微なバグ修正
## [0.6.0] - 2025-12-09
### Added - 新機能
#### AnimatorController Extension APIs
AnimatorController操作の包括的なAPIセットを追加。
## [0.5.1] - 2025-01-17
### Fixed - バグ修正
#### Update Package メニューのバージョン参照問題を修正
**問題:**
- GitHubリポジトリのデフォルトブランチが `develop` だった
- `Update Package` メニューがブランチを指定せずにGit URLを使用
- そのため `develop` ブランチ(リリース前のコード)を取得してしまい、一つ前のバージョンが表示される
**修正内容:**
- GitHubのデフォルトブランチを `main` に変更
- `Update Package` メニューで明示的に `#main` ブランチを指定
- README.md のリポジトリURLを `ugarageMCP` から `CC2UniMCP` に更新
- package.json の author URL も `CC2UniMCP` に更新
**影響:**
- ✅ `Update Package` メニューが常に最新のリリースバージョンを取得
- ✅ バージョン確認が正しく動作
- ✅ リポジトリ名の統一
## [0.5.0] - 2025-01-17
### Added - 新機能
#### Build Pipeline APIs
**新規追加:**
- `unity.build.player` - ビルドパイプライン実行
- `unity.build.getSettings` - ビルド設定取得
- `unity.build.setSettings` - ビルド設定変更
#### Package Management APIs
**新規追加:**
- `unity.package.export` - パッケージのエクスポート
- `unity.package.import` - パッケージのインポート
- `unity.package.list` - インストール済みパッケージ一覧
- `unity.package.add` - パッケージの追加
- `unity.package.remove` - パッケージの削除
- `unity.package.embed` - パッケージの埋め込み
- `unity.package.pack` - パッケージのパック
#### iOS Build Settings APIs
**新規追加:**
- `unity.build.ios.setPlist` - Info.plist設定
- `unity.build.ios.setXcodeSettings` - Xcode設定
- `unity.build.ios.setEntitlements` - Entitlements設定
- `unity.build.ios.setBuildNumber` - ビルド番号設定
- `unity.build.ios.getSettings` - iOS設定取得
#### Android Build Settings APIs
**新規追加:**
- `unity.build.android.setKeystore` - Keystore設定
- `unity.build.android.setGradleProperties` - Gradle設定
- `unity.build.android.setManifest` - AndroidManifest設定
- `unity.build.android.setBundleVersionCode` - バージョンコード設定
- `unity.build.android.getSettings` - Android設定取得
#### BuildProfile APIs (Unity 2022+)
**新規追加:**
- `unity.build.profile.list` - BuildProfile一覧
- `unity.build.profile.activate` - BuildProfile有効化
- `unity.build.profile.create` - BuildProfile作成
- `unity.build.profile.getSettings` - BuildProfile設定取得
- `unity.build.profile.setSettings` - BuildProfile設定変更
#### Build Processor Management APIs
**新規追加:**
- `unity.build.addPreprocessor` - ビルド前処理追加
- `unity.build.addPostprocessor` - ビルド後処理追加
- `unity.build.removePreprocessor` - ビルド前処理削除
- `unity.build.removePostprocessor` - ビルド後処理削除
- `unity.build.listProcessors` - プロセッサ一覧
- `unity.build.executeProcessor` - プロセッサ実行
#### Platform Build Settings APIs
**新規追加:**
- `unity.build.platform.getSettings` - プラットフォーム設定取得
- `unity.build.platform.setSettings` - プラットフォーム設定変更
### Changed - 変更
#### Documentation構造の改善
**変更内容:**
- `docs/` フォルダを `Documentation~/` に移行
- Unity Package Manager標準に準拠
- パッケージ配布からドキュメントを除外
- ProBuilder MCP Extension サンプルを package.json に追加
**メリット:**
- ✅ Unity標準のドキュメント構造に準拠
- ✅ パッケージサイズの削減
- ✅ サンプルの適切な管理
## [0.4.13] - 2024-11-14
### Fixed - バグ修正
#### PackageCache パス問題の修正
**問題:**
- git URL からインストールした場合、パッケージは `Library/PackageCache` に配置される
- v0.4.12 のセットアップコードは `Packages/com.local.mcp.unityserver` を前提としていた
- 自動セットアップボタンが「No such file or directory」エラーで失敗
- Claude Code 設定も相対パス + cwd 方式では動作しない
**修正内容:**
- `GetPackagePath()` を使用して PackageCache の実際のパスを取得
- Claude Code 設定で mcp-bridge/index.js の絶対パスを使用(cwd 不要)
- README.md でセットアップウィンドウからのコピーを推奨
**影響:**
- ✅ git URL インストールでも自動セットアップが正常に動作
- ✅ Claude Code 設定が確実に動作
- ✅ ユーザーがパスを手動で調べる必要がない
## [0.4.12] - 2024-11-14
### Changed - セットアップ改善
#### MCP Bridge セットアップの簡素化
**変更前:**
- GitHubからリポジトリをクローン
- プロジェクトルートにファイルをコピー
- npm install を実行
**変更後:**
- パッケージ内の `mcp-bridge-template` で直接 `npm install`
- ファイルコピー不要
- Claude Code設定で相対パス + `cwd` を使用
**メリット:**
- ✅ セットアップ手順が大幅に簡略化(3ステップ → 1ステップ)
- ✅ 複数のUnityプロジェクトで共通のmcp-bridgeを使用可能
- ✅ パッケージ更新時の再セットアップが簡単(npm install のみ)
- ✅ プロジェクトルートにファイルを配置不要
**初回セットアップウィンドウの改善:**
- バージョン表記を v0.4.12 に更新
- セットアップ手順を簡素化
- 日本語テストプロンプトをファイル(`test_prompts_ja.md`)から読み込むように変更
- 不要なメニューアイテムを削除
**Claude Code設定例:**
```json
{
"mcpServers": {
"unity": {
"command": "node",
"args": ["Packages/com.local.mcp.unityserver/mcp-bridge-template/index.js"],
"cwd": "/absolute/path/to/YourUnityProject"
}
}
}
```
### Changed - パッケージ改善
#### テストコードの配布除外
**問題:**
- 配布パッケージに不要なテストコードが含まれていた
- `tests/` ディレクトリ(シェルスクリプトテスト)
- `Editor/Tests/` ディレクトリ(Unity Test Frameworkテスト)
- `TestUnityProject/` (テスト用Unityプロジェクト)
- その他テスト関連ドキュメント
**修正内容:**
- テストコードをgitトラッキングから削除(36ファイル、3146行削除)
- `.gitignore` を更新してテストファイルを除外
- 配布パッケージサイズの削減とクリーンアップ
**保持したファイル:**
- `Editor/McpServerTestWindow.cs` - ユーザー向けテストツール(正式機能)
- `Editor/UnityTestRunnerControl.cs` - Unity Test Runner制御API(正式機能)
**影響:**
- パッケージサイズが大幅に削減
- エンドユーザーの混乱を防止
- 配布パッケージがプロダクションコードのみを含むようになった
## [0.4.11] - 2025-11-12
### Fixed - バグ修正
#### PhysicMaterial バージョン別対応の実装
**問題:**
- v0.4.10 で `PhysicsMaterial` → `PhysicMaterial` に変更したが、Unity 2023.3+ では `PhysicsMaterial` が正しい
- Unity のバージョンによって API 名が異なる:
- Unity 2021.3 - 2023.2: `PhysicMaterial` (s なし)
- Unity 2023.3+: `PhysicsMaterial` (s 付き)
**修正内容:**
- `#if UNITY_2023_3_OR_NEWER` ディレクティブを使用してバージョン別に対応
- 全ての Unity バージョン (2021.3+) で正しくコンパイルされるように修正
**コード例:**
```csharp
#if UNITY_2023_3_OR_NEWER
PhysicsMaterial physicMaterial = new PhysicsMaterial();
#else
PhysicMaterial physicMaterial = new PhysicMaterial();
#endif
```
**影響範囲:**
- `Editor/UnityAssetCreator.cs` - CreatePhysicsMaterial メソッド
## [0.4.10] - 2025-11-12
### Fixed - バグ修正
#### 1. PhysicMaterial 型エラーの修正
**問題:**
- `UnityAssetCreator.cs:142` で `PhysicsMaterial` 型が見つからないコンパイルエラー
- Unity 2022.3 では 3D 物理マテリアルのクラス名は `PhysicMaterial` (s なし)
**修正内容:**
- `PhysicsMaterial` → `PhysicMaterial` に修正
- Unity の正しい API を使用するように変更
**影響範囲:**
- `Editor/UnityAssetCreator.cs` - CreatePhysicsMaterial メソッド
#### 2. Test Assembly 解決エラーの修正
**問題:**
- Burst コンパイラが `LocalMcp.UnityServer.Editor.Tests` アセンブリを解決できずビルド失敗
- Test アセンブリが通常のビルドプロセスに含まれていた
**修正内容:**
- `LocalMcp.UnityServer.Editor.Tests.asmdef` の設定を変更
- `autoReferenced: false` に設定(自動参照を無効化)
- `defineConstraints: ["UNITY_INCLUDE_TESTS"]` を追加(テスト実行時のみ有効化)
**影響範囲:**
- `Editor/Tests/LocalMcp.UnityServer.Editor.Tests.asmdef`
**結果:**
- Unity 2022.3+ でのコンパイルエラーを解消
- Test アセンブリは必要な時のみロードされるように最適化
## [0.4.9] - 2025-11-10
### Added - 新機能追加
#### 1. Play Mode 制御 API (Issue #39)
Unity Editor の Play Mode を MCP 経由で制御する機能を実装しました。
**新規API:**
- `unity.editor.play` - Play Mode 開始
- `unity.editor.stop` - Play Mode 停止
- `unity.editor.pause` - Play Mode 一時停止
- `unity.editor.resume` - Play Mode 再開
- `unity.editor.step` - 1フレーム進める
- `unity.editor.getPlayModeState` - Play Mode ステータス取得
- `unity.editor.playAndCaptureLogs` - 一時的に再生してログをキャプチャ(統合API)
**実装ファイル:**
- `Editor/EditorPlayModeControl.cs` (新規作成)
**使用例:**
```bash
# Play Mode 開始
curl -X POST http://localhost:5051/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"unity.editor.play","params":{},"id":1}'
# 3秒間再生してログ取得
curl -X POST http://localhost:5051/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"unity.editor.playAndCaptureLogs","params":{"duration":3.0,"logLimit":50},"id":1}'
```
#### 2. Unity Test Runner API (Issue #40)
Unity Test Runner を MCP 経由で制御し、テスト実行と詳細な結果取得を可能にしました。
**新規API:**
- `unity.test.runAll` - 全テスト実行
- `unity.test.runByCategory` - カテゴリ別テスト実行
- `unity.test.runByAssembly` - アセンブリ別テスト実行
- `unity.test.runSpecific` - 特定のテスト実行
- `unity.test.getResults` - テスト結果取得(詳細なエラー情報含む)
- `unity.test.list` - テスト一覧取得
- `unity.test.status` - Test Runner ステータス取得
**実装ファイル:**
- `Editor/UnityTestRunnerControl.cs` (新規作成)
**特徴:**
- 詳細なテスト結果(テスト名、ステータス、実行時間、エラーメッセージ、スタックトレース)
- EditMode/PlayMode/All のモード指定
- カテゴリ、アセンブリ、テスト名でのフィルタリング
**使用例:**
```bash
# 全EditModeテスト実行
curl -X POST http://localhost:5051/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"unity.test.runAll","params":{"mode":"EditMode"},"id":1}'
# テスト結果取得
curl -X POST http://localhost:5051/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"unity.test.getResults","params":{},"id":1}'
```
#### 3. シーンを開く API (Issue #34)
既存のシーンファイルを Unity Editor で開く機能を実装しました。
**新規API:**
- `unity.scene.open` - シーンファイルを開く
**実装ファイル:**
- `Editor/SceneSetupCommand.cs` (OpenScene メソッド追加)
**パラメータ:**
- `scenePath`: シーンファイルのパス
- `mode`: "single" または "additive" (デフォルト: "single")
**使用例:**
```bash
curl -X POST http://localhost:5051/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"unity.scene.open","params":{"scenePath":"Assets/Scenes/MainScene.unity","mode":"single"},"id":1}'
```
#### 4. 接続リトライ機能 (Issue #35, #36)
Unity Editor との接続状態を監視し、リトライを支援する機能を実装しました。
**新規API:**
- `unity.connection.status` - 接続ステータス取得
- `unity.connection.ping` - 接続確認
- `unity.connection.reset` - 統計情報リセット
**実装ファイル:**
- `Editor/ConnectionHealthMonitor.cs` (新規作成)
**機能:**
- リクエスト成功/失敗の自動記録
- 接続状態の監視
- アップタイム計測
**使用例:**
```bash
# 接続ステータス確認
curl -X POST http://localhost:5051/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"unity.connection.status","params":{},"id":1}'
```
#### 5. SerializedProperty 書き込み API (Issue #9)
private/protected/SerializeField フィールドへの書き込みを可能にする API を実装しました。
**新規API:**
- `unity.component.setSerializedProperty` - SerializedProperty 経由でフィールド値を設定
**実装ファイル:**
- `Editor/SerializedPropertyWriter.cs` (新規作成)
**対応する型:**
- Integer, Boolean, Float, String
- Color, Vector2, Vector3, Vector4
- Enum
- ObjectReference (Asset参照)
**使用例:**
```bash
# privateフィールドの書き込み
curl -X POST http://localhost:5051/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"unity.component.setSerializedProperty",
"params":{
"gameObjectPath":"Player",
"componentType":"PlayerController",
"propertyPath":"m_Speed",
"value":"10.5",
"valueType":"float"
},
"id":1
}'
```
#### 6. コンパイル待機機能 (Issue #38)
Unity のスクリプトコンパイル状態を確認し、コンパイル中の操作を防ぐ機能を実装しました。
**新規API:**
- `unity.compile.status` - コンパイルステータス取得
- `unity.compile.waitForCompile` - コンパイル完了待機
**実装ファイル:**
- `Editor/CompileWaitHelper.cs` (新規作成)
**改善:**
- `unity.component.add` に自動コンパイルチェックを追加
- コンパイル中の場合、適切なエラーメッセージを表示
- アセット更新中も検出
**使用例:**
```bash
# コンパイル状態確認
curl -X POST http://localhost:5051/api/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"unity.compile.status","params":{},"id":1}'
```
#### 7. ProjectSettings 制御 API (Issue #43)
Unity ProjectSettings を MCP 経由で取得・変更できる API を実装しました。
**新規API (8つ):**
- `unity.project.getPlayerSettings` / `unity.project.setPlayerSettings` - PlayerSettings 取得・変更
- `unity.project.getQualitySettings` / `unity.project.setQualitySettings` - QualitySettings 取得・変更
- `unity.project.getPhysicsSettings` / `unity.project.setPhysicsSettings` - PhysicsSettings 取得・変更
- `unity.project.getTimeSettings` / `unity.project.setTimeSettings` - TimeSettings 取得・変更
**実装ファイル:**
- `Editor/ProjectSettingsController.cs` (新規作成、550行)
**対応する設定項目:**
- **PlayerSettings**: companyName, productName, bundleVersion, colorSpace, 画面設定、自動回転等
- **QualitySettings**: vSyncCount, antiAliasing, shadowDistance, anisotropicFiltering等
- **PhysicsSettings**: gravity, solverIterations, bounceThreshold, sleepThreshold等
- **TimeSettings**: fixedDeltaTime, maximumDeltaTime, timeScale等
**使用例:**
```bash
# PlayerSettings変更
curl -X POST http://localhost:5051/api/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"unity.project.setPlayerSettings",
"params":{
"companyName":"MyCompany",
"productName":"MyGame",
"colorSpace":"Linear"
},
"id":1
}'
```
### Fixed - バグ修正と改善
#### 1. AnimatorController作成のAssetDatabase同期問題を改善 (Issue #42)
**問題:** フォルダ作成直後に `unity.animator.create` を実行すると "Creating asset at path ... failed" エラー
**改善内容:**
- `ImportAssetOptions.ForceSynchronousImport` による強制同期
- ディレクトリの事前チェックと自動作成
- AssetDatabaseが認識していない場合、AssetDatabase経由で作成を試みる
- 詳細なエラーメッセージ
**ファイル:**
- `Editor/AnimatorBuilder.cs` (CreateController メソッド改善)
#### 2. HTTP APIエンドポイントの明確化 (Issue #41)
**問題:** エンドポイントが `/api/mcp` であることが不明確で、ユーザーが `/` にアクセスして "Not found" エラー
**改善内容:**
- Unity Editorメニューに「API Info」機能を追加
- `MCP > Server > Show API Info` - 全API情報表示
- `MCP > Server > Copy API Test Command` - テストコマンドをコピー
- `MCP > Server > Open API Documentation` - ドキュメントを開く
- すべてのテストスクリプトを正しいエンドポイント `/api/mcp` に修正
**ファイル:**
- `Editor/McpServerInfo.cs` (新規作成)
- `tests/*.sh` (BASE_URL を `/mcp` → `/api/mcp` に修正)
### Testing - テスト体制の確立
テストワークフローとテストスクリプトを整備しました。
**新規テストスクリプト:**
- `tests/test_connection_health.sh` - 接続監視機能テスト
- `tests/test_scene_open.sh` - シーンオープンAPIテスト
- `tests/test_play_mode_control.sh` - Play Mode制御APIテスト (14テストケース)
- `tests/test_unity_test_runner.sh` - Test Runner APIテスト (10テストケース)
- `tests/test_compile_wait.sh` - コンパイル待機機能テスト (6テストケース)
- `tests/test_project_settings.sh` - ProjectSettings APIテスト (14テストケース)
- `tests/run_all_tests.sh` - 全テスト実行スクリプト
- `tests/test_template.sh` - テストテンプレート
**テストワークフロー文書:**
- `TESTING_WORKFLOW.md` - テストワークフローガイド
### Documentation - ドキュメント改善
- テストワークフローの文書化
- 各APIの使用例追加
- Issue管理をラベルからマイルストーンに移行
### Summary - まとめ
**v0.4.9は大型アップデートです!**
#### 新機能
- **33個の新規API** を追加
- Play Mode制御: 7 API
- Test Runner: 7 API
- Scene操作: 1 API
- 接続監視: 3 API
- SerializedProperty: 1 API
- コンパイル待機: 2 API
- ProjectSettings: 8 API
- API情報表示: 3 Editorメニュー
- **6個の新規Editorファイル** を作成
- `EditorPlayModeControl.cs` (Play Mode制御)
- `UnityTestRunnerControl.cs` (Test Runner統合)
- `ConnectionHealthMonitor.cs` (接続監視)
- `SerializedPropertyWriter.cs` (SerializedProperty書き込み)
- `CompileWaitHelper.cs` (コンパイル待機)
- `ProjectSettingsController.cs` (ProjectSettings制御)
- `McpServerInfo.cs` (API情報表示)
- **6個のテストスクリプト** を作成(合計44テストケース)
#### バグ修正・改善
- AnimatorController作成のAssetDatabase同期問題を解決
- HTTP APIエンドポイントの明確化とドキュメント改善
- コンポーネント追加時の自動コンパイルチェック
#### 影響
- Unity MCP Server の機能が**大幅に拡充**されました
- **Play Mode制御**により、Claude Code から Unity のゲーム実行を完全制御可能に
- **Test Runner統合**により、テストの自動化と詳細な結果取得が可能に
- **SerializedProperty対応**により、private/protectedフィールドへのアクセスが可能に
- **ProjectSettings制御**により、プロジェクト設定の自動化が可能に
- **コンパイル待機機能**により、エラーハンドリングが改善
- **テスト体制の整備**により、品質保証が向上
- **API情報表示機能**により、開発者体験が向上
#### 統計
- **実装したIssue数**: 10個 (#9, #34, #35, #36, #38, #39, #40, #41, #42, #43)
- **新規API数**: 33個
- **新規ファイル数**: 13個(Editor: 7, Tests: 6)
- **テストケース数**: 44ケース
- **総コード行数**: 約3000行追加
## [0.4.8] - 2025-11-09
### Fixed - サーバー起動の完全な MonoBehaviour 脱却
#### McpEditorServerLauncher の GameObject 依存を完全削除
- **GameObject を使わない設計に変更**
- `serverObject` を削除
- `wsServer`、`httpServer` を直接フィールドで保持
- `new UnityMcpServer()` で直接インスタンス化
- `AddComponent<>()` 呼び出しを削除
**変更内容**:
**Before (GameObject 使用)**:
```csharp
private static GameObject serverObject;
// GameObject 作成してコンポーネント追加
serverObject = new GameObject("[MCP Server]");
var wsServer = serverObject.AddComponent<UnityMcpServer>();
var httpServer = serverObject.AddComponent<UnityMcpHttpServer>();
```
**After (GameObject 不使用)**:
```csharp
private static UnityMcpServer wsServer;
private static UnityMcpHttpServer httpServer;
// 直接インスタンス化
wsServer = new UnityMcpServer();
httpServer = new UnityMcpHttpServer();
```
#### サーバー停止処理の改善
- `Cleanup()` メソッド呼び出しに変更
- `DestroyImmediate()` 削除
- GlobalLogCapture のクリーンアップ追加
**変更内容**:
```csharp
// Before
if (serverObject != null)
{
var server = serverObject.GetComponent<UnityMcpServer>();
server.StopServer();
DestroyImmediate(serverObject);
}
// After
if (wsServer != null)
{
wsServer.Cleanup();
wsServer = null;
}
if (httpServer != null)
{
httpServer.Cleanup();
httpServer = null;
}
GlobalLogCapture.Instance?.Cleanup();
```
#### サーバー状態チェックの改善
- GameObject の存在チェックから、サーバーインスタンスの直接チェックに変更
- より正確な稼働状態の判定
**変更内容**:
```csharp
// Before
if (serverObject != null)
// After
if (wsServer != null || httpServer != null)
```
### 設計改善
**完全な MonoBehaviour 脱却**:
- UnityMainThreadDispatcher: static class (v0.4.7)
- GlobalLogCapture: 通常のクラス (既存)
- UnityMcpServer: 通常のクラスとして使用 (v0.4.8)
- UnityMcpHttpServer: 通常のクラスとして使用 (v0.4.8)
**利点**:
- ✅ GameObject 不要
- ✅ シンプルな設計
- ✅ ライフサイクル管理が明確
- ✅ Editor 専用ツールとして適切
### Impact
- ✅ サーバー起動・停止が確実に動作
- ✅ GameObject への依存完全排除
- ✅ Editor フォルダに完全対応
- ✅ MonoBehaviour の問題から完全解放
## [0.4.7] - 2025-11-09
### Fixed - アーキテクチャ根本修正 (Issue #33, #34, #35, #36)
#### UnityMainThreadDispatcher 再設計 (Issue #35)
- **MonoBehaviour から static class に完全書き換え**
- GameObject 不要
- `[InitializeOnLoadMethod]` で自動初期化
- `EditorApplication.update` でメインスレッド実行
- Editor フォルダに配置可能
**変更点**:
| 項目 | 旧実装 | 新実装 |
|------|--------|--------|
| 基底クラス | MonoBehaviour | static class |
| GameObject | 必要 | **不要** |
| 初期化 | Instance getter | [InitializeOnLoadMethod] |
| メインスレッド | Update() | EditorApplication.update |
| 配置 | Runtime 必須 | **Editor 可能** |
#### GlobalLogCapture 改善 (Issue #36)
- **不要な null チェックを削除**
- GlobalLogCapture は Singleton パターンで必ず初期化される
- Instance は null にならない
- McpEditorServerLauncher のエラーチェック削除
### Impact - 解決した問題
#### ✅ Issue #33 解決: ビルドエラー修正
- すべてのコードを Editor フォルダに配置
- Editor API (`UnityEditor`) を自由に使用可能
- iOS/Android/WebGL ビルド成功
#### ✅ Issue #34 解決: 初期化エラー修正
- MonoBehaviour 不要で GameObject アタッチ不要
- Editor フォルダに配置可能
- 自動初期化で確実に起動
#### ✅ Issue #35 解決: アーキテクチャ改善
- Editor 専用ツールとして正しい設計
- シンプルで保守しやすいコード
- 将来の同様問題を防止
#### ✅ Issue #36 解決: コード簡素化
- 不要なエラーチェック削除
- GlobalLogCapture は必ず動作
### Technical Details
**公開 API (互換性維持)**:
- `UnityMainThreadDispatcher.Enqueue(Action)` - 変更なし
- `UnityMainThreadDispatcher.EnqueueAndWait<T>(Func<T>)` - 変更なし
- `UnityMainThreadDispatcher.EnqueueAndWait(Action)` - 変更なし
- `UnityMainThreadDispatcher.IsMainThread()` - 変更なし
- `UnityMainThreadDispatcher.SetVerboseLogging(bool)` - 新規追加
**破壊的変更**:
- なし (公開 API は完全互換)
**コミット**:
- f9480d3: UnityMainThreadDispatcher を static class に再設計
- a357a88: GlobalLogCapture の不要な null チェック削除
### 設計思想
**MCP Server = Editor 専用開発ツール**
- ビルドに含めない
- Runtime コード不要
- MonoBehaviour 不使用
- EditorApplication API 活用
**利点**:
- ✅ シンプルな設計
- ✅ 明確な責任範囲
- ✅ 保守性の向上
- ✅ ビルドエラーの根絶
## [0.4.6] - 2025-11-09
### Added - Package Management Features
- **MCP > Package Version** menu item
- Display current package version in dialog
- Show repository information (github.com/dsgarage/CC2UniMCP)
- Console log output for version tracking
- Uses PackageManager.Client.List() API for accurate version detection
- **MCP > Update Package** enhanced with version context
- Shows current version before updating
- Better user context for update decision
### Fixed - Version Detection
- **GetPackageVersion() accuracy** - Fixed incorrect version display (0.0.0)
- Primary method: Use PackageManager.Client.List() API
- Get version directly from PackageInfo.version
- Fallback: Multiple file path attempts for edge cases
- Works with both local and git packages
### Menu Structure
```
MCP/
├── Server/
│ ├── Start
│ ├── Stop
│ └── Status
├── Package Version ← NEW
└── Update Package ← Enhanced with version display
```
### Implementation Details
- PackageManager.Client.List() for reliable version detection
- Synchronous request handling with polling
- Multiple fallback paths for package.json
- Regex-based version extraction from JSON
- Error handling for missing package information
### User Experience
**Package Version dialog:**
```
Unity MCP Server
Current Version: 0.4.6
Repository: github.com/dsgarage/CC2UniMCP
```
**Update Package dialog (enhanced):**
```
Current version: 0.4.6
This will update the Unity MCP Server package to the latest version from GitHub.
...
```
### Impact
- ✅ **Easy version checking** - No need to open Package Manager
- ✅ **Update context** - See current version before updating
- ✅ **Troubleshooting** - Version logged in Console
- ✅ **Accurate detection** - Uses official Unity PackageInfo API
## [0.4.5] - 2025-11-09
### Fixed - Namespace Inconsistency
- **UnityMainThreadDispatcher Initialization Failure** - Fixed namespace mismatch
- Error: `[MCP] Failed to initialize UnityMainThreadDispatcher`
- 4 Editor files used `LocalMcp.UnityServer.Editor` namespace
- All other files (20+) used `LocalMcp.UnityServer` namespace
- McpEditorServerLauncher couldn't access UnityMainThreadDispatcher due to namespace mismatch
- **Solution**: Unified all files to use `LocalMcp.UnityServer` namespace
### Changed
- **Namespace Unification** - All code now uses single namespace
- Changed 4 Editor files from `LocalMcp.UnityServer.Editor` → `LocalMcp.UnityServer`
- Files changed:
- Editor/McpEditorServerLauncher.cs
- Editor/McpSetupWindow.cs
- Editor/McpEditorClipboardMenu.cs
- Editor/McpServerTestWindow.cs
- Assembly name remains: `LocalMcp.UnityServer.Editor` (Editor-only)
- Root namespace: `LocalMcp.UnityServer` (shared across all files)
### Impact
- ✅ **MCP Server starts successfully** on Unity Editor launch
- ✅ **UnityMainThreadDispatcher initializes** without errors
- ✅ **All Editor files** can access shared utilities
- ✅ **Consistent namespace** across entire package
### Technical Details
- Assembly Definition: `LocalMcp.UnityServer.Editor`
- Root Namespace: `LocalMcp.UnityServer`
- Platform Restriction: `"includePlatforms": ["Editor"]`
- No sub-namespaces required
## [0.4.4] - 2025-11-09
### Fixed - Critical Build Failures (Issue #33)
- **iOS/Android/WebGL Build Errors** - Moved all code from Runtime to Editor folder
- Runtime folder contained 12 files with `using UnityEditor` dependencies
- Error: `CS0246: The type or namespace name 'SerializedProperty' could not be found`
- Error: `CS0246: The type or namespace name 'AssetDatabase' could not be found`
- **Root Cause**: MCP Server is Editor-only development tool, should never be in Runtime
- **Solution**: Moved ALL 20 Runtime/*.cs files to Editor/ folder
- Runtime folder no longer exists - all code in Editor/
- **Assembly Definition Conflicts** - Fixed duplicate .asmdef files
- Removed duplicate `LocalMcp.UnityServer.asmdef` from Runtime migration
- Kept existing `LocalMcp.UnityServer.Editor.asmdef` in Editor folder
- Removed obsolete Runtime assembly reference
- Single Editor-only assembly: `LocalMcp.UnityServer.Editor`
### Changed
- **Package Structure** - Complete reorganization for Editor-only architecture
- Before: Runtime/ and Editor/ folders (incorrect)
- After: Editor/ folder only (correct)
- All MCP Server code now in Editor/ where it belongs
- **Assembly Definition** - Editor-only platform restriction
```json
{
"name": "LocalMcp.UnityServer.Editor",
"rootNamespace": "LocalMcp.UnityServer",
"includePlatforms": ["Editor"]
}
```
### Added
- **RELEASE_CHECKLIST.md** - Build testing section (Issue #33 prevention)
- iOS/Android/WebGL build verification required before release
- Runtime folder Editor dependency checks
- Assembly Definition platform restriction validation
- Prevents future build failures
### Files Moved (20 files)
- Runtime/AnimatorBuilder.cs → Editor/AnimatorBuilder.cs
- Runtime/AnimatorControl.cs → Editor/AnimatorControl.cs
- Runtime/AnimatorParameter.cs → Editor/AnimatorParameter.cs
- Runtime/AssetDatabaseProvider.cs → Editor/AssetDatabaseProvider.cs
- Runtime/ComponentReflection.cs → Editor/ComponentReflection.cs
- Runtime/EditorMethodInvoker.cs → Editor/EditorMethodInvoker.cs
- Runtime/GlobalLogCapture.cs → Editor/GlobalLogCapture.cs
- Runtime/JsonRpcRequest.cs → Editor/JsonRpcRequest.cs
- Runtime/McpLogStream.cs → Editor/McpLogStream.cs
- Runtime/McpPortManager.cs → Editor/McpPortManager.cs
- Runtime/McpServerConfig.cs → Editor/McpServerConfig.cs
- Runtime/McpSession.cs → Editor/McpSession.cs
- Runtime/PrefabOperations.cs → Editor/PrefabOperations.cs
- Runtime/SceneSetupCommand.cs → Editor/SceneSetupCommand.cs
- Runtime/SerializedObjectInspector.cs → Editor/SerializedObjectInspector.cs
- Runtime/UIToolkitAssetCreator.cs → Editor/UIToolkitAssetCreator.cs
- Runtime/UnityAssetCreator.cs → Editor/UnityAssetCreator.cs
- Runtime/UnityMainThreadDispatcher.cs → Editor/UnityMainThreadDispatcher.cs
- Runtime/UnityMcpHttpServer.cs → Editor/UnityMcpHttpServer.cs
- Runtime/UnityMcpServer.cs → Editor/UnityMcpServer.cs
### Impact
- ✅ **All platform builds now succeed** (iOS/Android/WebGL)
- ✅ **No Runtime code** - MCP Server correctly positioned as Editor tool
- ✅ **No build inclusion** - Package never compiled into game builds
- ✅ **Future prevention** - Release checklist ensures no recurrence
### Technical Details
- Commit 799acad: Moved all Runtime files to Editor
- All .meta files moved with source files
- Runtime folder deleted from package
- Editor-only Assembly Definition enforced
- Build test requirements added to release process
### GitHub Issues Resolved
- Issue #33: Critical - iOS/Android/WebGL Build Failures
### Migration Notes
- **No user action required** - Package structure change is transparent
- **Existing projects** - Package Manager will handle file reorganization
- **Build compatibility** - Builds that were failing will now succeed
## [0.4.3] - 2025-11-09
### Fixed
- **CS0117 Compilation Error** - Fixed `Menu.MenuItemExists` not available in Unity 2021.3
- `Menu.MenuItemExists` is only available in Unity 2019.1+
- Changed to use `EditorApplication.ExecuteMenuItem` return value for validation
- `ExecuteMenuItem` returns false if menu item doesn't exist or fails to execute
- **CS1503/CS0029 Type Mismatch Errors** - Fixed `LogEntry.type` type mismatch
- `LogEntry.type` is `LogType` enum, not `string`
- Changed `type.ToString()` to `type` in LogEntry creation
- Updated `ShouldIncludeLog` signature from `(string, string)` to `(LogType, string)`
- Use `LogType` enum comparison instead of string comparison
- **Scene Creation GUI Changes** - Prevent scene creation/setup from changing Unity Editor GUI
- `unity.asset.createScene`: Create scene without opening it in GUI
- Save current active scene before creating new scene
- Close newly created scene immediately after saving
- Restore original active scene
- `unity.scene.setup`: Use active scene instead of creating new one
- Removed `NewScene` call that switched GUI to new scene
- Use `SceneManager.GetActiveScene()` instead
- Validate scene name if provided, return error if mismatch
### Changed
- **unity.asset.createScene** behavior
- Scene asset is created but GUI remains unchanged
- Maintains user's current workspace
- **unity.scene.setup** behavior
- No longer creates new scene automatically
- If `sceneName` parameter provided, validates it matches active scene
- Returns error if scene name doesn't match, instructing user to open desired scene first
### Technical Details
- Runtime/EditorMethodInvoker.cs: Use ExecuteMenuItem return value instead of Menu.MenuItemExists
- Runtime/McpLogStream.cs: Fixed LogEntry.type type (string → LogType)
- Runtime/UnityAssetCreator.cs: Close created scene to prevent GUI changes
- Runtime/SceneSetupCommand.cs: Remove NewScene call, use GetActiveScene()
### Impact
- ✅ Compiles successfully in Unity 2021.3
- ✅ No unexpected scene switching in Unity Editor GUI
- ✅ Maintains user's current workspace while allowing API operations
- ✅ Scene creation/setup happens in background without disrupting workflow
## [0.4.2] - 2025-11-09
### Fixed
- **CS0101 Compilation Error** - Removed duplicate `LogEntry` class definition
- `LogEntry` was defined in both `McpLogStream.cs` and `GlobalLogCapture.cs`
- Removed duplicate from `McpLogStream.cs`, keeping single definition in `GlobalLogCapture.cs`
- Fixes "The namespace 'LocalMcp.UnityServer' already contains a definition for 'LogEntry'" error
- **CS0579 Compilation Error** - Fixed duplicate `[Serializable]` attribute
- Resolved by removing duplicate `LogEntry` class
### Technical Details
- Runtime/McpLogStream.cs: Removed duplicate LogEntry class (lines 201-211)
- LogEntry class now only exists in GlobalLogCapture.cs
## [0.4.1] - 2025-11-09
### Added - SerializedObject Inspection APIs
- **unity.serialized.inspect** - Get detailed SerializedProperty information
- Returns comprehensive property data including missing reference detection
- Property details: propertyPath, name, displayName, propertyType
- For ObjectReference: objectReferenceValue, objectReferenceInstanceIDValue, isMissing
- Type-specific values (intValue, boolValue, floatValue, stringValue, etc.)
- Missing reference detection logic: null value with non-zero instance ID
- **unity.serialized.validateMissingReferences** - Validate specific GameObject
- Scans all components for missing references
- Returns list of missing references with component and property details
- Useful for debugging broken references
- **unity.serialized.validateSceneMissingReferences** - Validate entire scene
- Scans all GameObjects in scene for missing references
- Comprehensive scene validation
- Returns complete list of all missing references
### Added - Editor Method Execution APIs
- **unity.editor.executeMenuItem** - Execute Unity Editor menu items
- Run any Unity menu command programmatically
- Works with built-in and custom menu items
- Uses EditorApplication.ExecuteMenuItem()
- **unity.editor.invokeStaticMethod** - Invoke static methods via reflection
- Execute static methods without GameObject context
- Automatic parameter type inference (int, float, bool, string)
- Support for parameterless and parameterized methods
- Returns method result value
- **unity.editor.listMenuItems** - List all available MenuItem attributes
- Discovers all [MenuItem] attributes using reflection
- Returns menu paths and priority values
- Useful for discovering available commands
### Fixed - Log History System
- **unity.log.history** now returns actual logs from GlobalLogCapture
- Previous implementation created new McpLogStream instance per request (empty logs)
- Now uses persistent GlobalLogCapture singleton
- Log history persists across HTTP requests
- Proper log filtering by level (all/warning/error/info)
- Returns newest logs first with total count
### Added - Global Log Capture System
- **GlobalLogCapture** MonoBehaviour singleton
- Initialized on Unity Editor startup in McpEditorServerLauncher
- Captures all Unity logs from Application.logMessageReceived
- Maintains rolling buffer of last 1000 log entries
- Thread-safe log access with lock
- Persists across HTTP requests and domain reloads
### Technical Details
- Runtime/SerializedObjectInspector.cs: New file with 3 inspection APIs
- Runtime/EditorMethodInvoker.cs: New file with 3 method execution APIs
- Runtime/GlobalLogCapture.cs: New file with persistent log capture
- Runtime/UnityMcpHttpServer.cs: Registered 6 new APIs, fixed log history
- Runtime/McpSession.cs: Registered 6 new APIs for WebSocket
- Editor/McpEditorServerLauncher.cs: Initialize GlobalLogCapture on startup
### Use Cases
```json
// Inspect SerializedObject properties
{
"method": "unity.serialized.inspect",
"params": {
"gameObjectPath": "Player",
"componentType": "PlayerController"
}
}
// Validate missing references on specific GameObject
{
"method": "unity.serialized.validateMissingReferences",
"params": {
"gameObjectPath": "Player"
}
}
// Execute Unity menu item
{
"method": "unity.editor.executeMenuItem",
"params": {
"menuItemPath": "Assets/Refresh"
}
}
// Invoke static method
{
"method": "unity.editor.invokeStaticMethod",
"params": {
"typeName": "UnityEditor.AssetDatabase",
"methodName": "Refresh"
}
}
```
### Impact
- ✅ Missing reference detection capability (Issue #17)
- ✅ Static method execution without GameObject context
- ✅ Editor menu command automation
- ✅ Fixed log history returning empty results
- ✅ 6 new APIs for advanced Unity Editor control
- ✅ Total API count: 52 APIs
### GitHub Issues Resolved
- Issue #17: Missing Reference Detection and Editor Method Execution
## [0.4.0] - 2025-11-08
### Added
- **Connection Monitoring System**: MCP Bridge now monitors Unity Editor connection status
- Health check endpoint (`/health`) on Unity HTTP server returns project info
- Automatic connection monitoring every 10 seconds
- Auto-reconnection when Unity Editor restarts
- Clear error messages displayed in Claude Code when Unity is not running
- Distinguish between initial connection failure and connection loss
- **Logging Control System**: Reduce verbose output for cleaner experience
- `MCP_VERBOSE` environment variable to control log verbosity
- Default: Only log connection state changes (connect/disconnect/reconnect)
- Verbose mode: Log all API calls and internal operations
- Unity side: Suppress EnqueueAndWait and ExecuteQueuedActions logs by default
- Error logs always shown (timeouts, exceptions, warnings)
- **MCP Bridge Template**: Bundled mcp-bridge setup in Unity package
- Template files in `mcp-bridge-template/` directory
- Automated setup script (`setup-mcp-bridge.sh`)
- Creates mcp-bridge at project root (same level as Assets/)
- npm dependencies installed automatically
- README with detailed setup instructions
- **Future Plans Documentation**: Repository separation policy documented
- `mcp-bridge-template/FUTURE_PLANS.md`
- Decision criteria for separating mcp-bridge to own repository
- Proposed repository structures (independent vs monorepo)
- Migration plan and decision log
### Changed
- **Connection Error Handling**: Improved error messages
- Claude Code shows clear messages when Unity is not connected
- Detailed troubleshooting information in error messages
- Connection state tracking with clear status indicators
- **Health Check Implementation**: Use UnityMainThreadDispatcher
- Fixed "productName can only be called from main thread" error
- Health endpoint executed on main thread via UnityMainThreadDispatcher
- Returns project name, Unity version, and timestamp
- **Log Output**: Significantly reduced log spam
- Connection established: Always shown with project info and Unity version
- Connection lost: Always shown with error details and reconnection message
- Periodic health checks: Silent unless state changes
- API calls: Only logged in verbose mode
- Internal operations: Only logged in verbose mode
### Fixed
- Main thread access error when calling `Application.productName` in health check
- Excessive logging from UnityMainThreadDispatcher operations
- mcp-bridge infinite import loop caused by embedded node_modules
- TestUnityProject embedded in package causing import warnings
- Missing .meta files for mcp-bridge-template files
### Documentation
- Updated README with mcp-bridge setup instructions
- Added mcp-bridge-template/README.md with detailed setup guide
- Added mcp-bridge-template/FUTURE_PLANS.md for development roadmap
- Added logging control documentation
- Updated troubleshooting section with connection monitoring info
## [0.3.16] - 2025-01-07
### Fixed
- **Critical: ComponentReflection class structure corrected**
- Fixed class structure where parameter classes were incorrectly placed outside ComponentReflection class
- Removed erroneous closing brace at line 1129 that was closing ComponentReflection class too early
- All parameter classes (ComponentAddParams, ComponentSetReferenceParams, ComponentSetParams, etc.) are now properly nested inside ComponentReflection class
- Added ComponentSetParams class for component field setting operations
- Fixes CS0426 errors: "The type name 'ComponentAddParams' does not exist in the type 'ComponentReflection'"
- Fixes CS0426 errors: "The type name 'ComponentSetReferenceParams' does not exist in the type 'ComponentReflection'"
- Fixes CS0426 errors: "The type name 'ComponentSetParams' does not exist in the type 'ComponentReflection'"
- Fixes CS1022 error: "Type or namespace definition, or end-of-file expected"
### Technical Details
- Original structure had ComponentReflection class closing at line 1129, leaving all parameter classes outside the class
- New structure properly closes ComponentReflection class after #endregion, with all parameter classes nested inside
- Brace count: 287 opening braces, 287 closing braces (balanced)
## [0.3.15] - 2025-01-07
### Fixed
- **Critical: Missing ComponentReflection class closing brace**
- Added missing closing brace for ComponentReflection class after #endregion
- This was causing all nested parameter classes to be inaccessible from other files
- Fixes CS0426 errors: "The type name 'ComponentAddParams' does not exist in the type 'ComponentReflection'"
- Fixes CS0426 errors: "The type name 'ComponentSetReferenceParams' does not exist in the type 'ComponentReflection'"
### Technical Details
- The ComponentReflection class was missing its closing brace, causing all nested parameter classes to be outside the class scope
- Correct structure is now: #endregion → } (class) → } (namespace)
- All parameter classes (ComponentAddParams, ComponentSetReferenceParams, etc.) are now properly nested inside ComponentReflection class
## [0.3.14] - 2025-01-07
### Fixed
- **CS0426 Compilation Errors** - Added missing public parameter classes
- Added `ComponentReflection.ComponentSetParams` class for component field setting operations
- Added `UnityAssetCreator.CreateScriptableObjectParams` class for ScriptableObject creation
- These classes are required by `SceneSetupCommand.cs` for the `unity.scene.setupArchitecture` API
- Fixes "The type name does not exist in the type" compilation errors
### Technical Details
- ComponentReflection.cs: Added `ComponentSetParams` class (line 1384-1394)
- UnityAssetCreator.cs: Added `CreateScriptableObjectParams` class (line 434-442)
- Both classes are now properly declared as `public` and `[Serializable]`
## [0.3.13] - 2025-01-07
### Added - Array/List Operations
- **unity.component.setArrayElement** - Set an element in an array or list field
- Supports both arrays and lists
- Index-based element modification
- Works with SerializedProperty for proper Editor integration
- **unity.component.addArrayElement** - Add an element to an array or list
- Automatic array size increase
- Optional value initialization
- Returns new array size
- **unity.component.removeArrayElement** - Remove an element from an array or list
- Index-based deletion
- Proper array size management
- Range validation
### Added - Asset Management Operations
- **unity.asset.delete** - Delete an asset from the project
- Safe asset deletion with existence check
- Proper AssetDatabase integration
- Returns success status
- **unity.asset.move** - Move an asset to a new path
- Source and destination validation
- Prevents overwriting existing assets
- Returns detailed error messages
- **unity.asset.copy** - Copy an asset to a new location
- Creates duplicate with new path
- Preserves original asset
- Validates source and destination
### Technical Details
- ComponentReflection.cs: Added 3 array/list operation methods
- AssetDatabaseProvider.cs: Added 3 asset management methods
- McpSession.cs: Registered 6 new APIs
- UnityMcpHttpServer.cs: Registered 6 new APIs
- test_prompts_ja.md: Added 6 new test cases (テスト 3-5 through 3-7, 4-2-5-1 through 4-2-5-3)
- All operations use SerializedProperty for proper Unity Editor integration
### Use Cases
```json
// Set array element
{
"method": "unity.component.setArrayElement",
"params": {
"gameObjectPath": "LineRenderer",
"componentType": "LineRenderer",
"fieldName": "positions",
"index": 0,
"value": "{\"x\": 0, \"y\": 1, \"z\": 0}"
}
}
// Add array element
{
"method": "unity.component.addArrayElement",
"params": {
"gameObjectPath": "MyObject",
"componentType": "MyScript",
"fieldName": "items",
"value": "newItem"
}
}
// Delete asset
{
"method": "unity.asset.delete",
"params": {
"assetPath": "Assets/TestMaterial.mat"
}
}
// Move asset
{
"method": "unity.asset.move",
"params": {
"oldPath": "Assets/OldFolder/Material.mat",
"newPath": "Assets/NewFolder/Material.mat"
}
}
```
### Impact
- ✅ Complete array/list manipulation in components
- ✅ Full asset lifecycle management (create, move, copy, delete)
- ✅ 6 new APIs for advanced editing
- ✅ Total API count: 52 APIs
## [0.3.12] - 2025-01-07
### Added - GameObject Basic Operations
- **unity.gameObject.delete** - Delete GameObjects from scene
- Uses DestroyImmediate for Editor mode
- Safe deletion with proper cleanup
- **unity.gameObject.setActive** - Toggle GameObject active state
- Set active/inactive state dynamically
- Affects GameObject and all children
- **unity.gameObject.setParent** - Change GameObject parent-child relationships
- Set new parent or clear parent (make root)
- Option to maintain world position (worldPositionStays parameter)
### Added - Transform Operations
- **unity.transform.setPosition** - Set Transform position
- Support for both local and world space
- Direct Vector3 position setting
- **unity.transform.setRotation** - Set Transform rotation
- Euler angle input (x, y, z degrees)
- Support for both local and world space
- **unity.transform.setScale** - Set Transform scale
- Direct Vector3 scale setting
- Always in local space (as per Unity design)
### Added - Prefab Operations
- **unity.prefab.instantiate** - Instantiate prefab from asset path
- Load prefab from Assets path
- Optional parent and name setting
- Position and rotation support
- Returns instance path, name, and ID
- **unity.prefab.create** - Create prefab from scene GameObject
- SaveAsPrefabAsset workflow
- Automatic directory creation
- .prefab extension auto-append
- **unity.prefab.apply** - Apply instance changes to prefab asset
- ApplyPrefabInstance for override application
- Works with prefab instances only
- Full prefab hierarchy support
- **unity.prefab.revert** - Revert instance to match prefab asset
- RevertPrefabInstance for resetting overrides
- Discards all instance modifications
- **unity.prefab.unpack** - Completely unpack prefab instance
- Breaks prefab connection
- Converts to regular GameObjects
### Added - Scene Architecture Setup (v0.3.11)
- **unity.scene.setupArchitecture** - Complete automated scene setup
- Auto-creates AvatarPlacementSettings ScriptableObject
- Auto-creates AvatarInstanceManager, AvatarFollowController, AvatarSwipeController GameObjects
- Automatic component addition and reference configuration
- Dynamic ARAnchorManager discovery via FindObjectOfType
- Configures PlaceAvatarOnPlaneOnly and CameraCaptureController if present
- Marks scene as dirty for save
- Returns detailed step-by-step execution log
- 100% automated workflow for AR avatar scene setup
### Technical Details
- SceneSetupCommand.cs: Added 7 new methods (DeleteGameObject, SetGameObjectActive, SetGameObjectParent, SetTransformPosition, SetTransformRotation, SetTransformScale, SetupSceneArchitecture)
- PrefabOperations.cs: New file with 5 prefab methods
- McpSession.cs: Registered 12 new APIs (1 scene + 6 GameObject/Transform + 5 Prefab)
- UnityMcpHttpServer.cs: Registered 12 new APIs
- test_prompts_ja.md: Added 8 new test cases (テスト 2-5 through 2-12)
- All operations support proper error handling and validation
### Use Cases
```json
// Delete GameObject
{
"method": "unity.gameObject.delete",
"params": { "gameObjectPath": "TestObject" }
}
// Set parent with world position maintained
{
"method": "unity.gameObject.setParent",
"params": {
"gameObjectPath": "Child",
"parentPath": "Parent",
"worldPositionStays": true
}
}
// Set local position
{
"method": "unity.transform.setPosition",
"params": {
"gameObjectPath": "Main Camera",
"x": 0, "y": 5, "z": -10,
"local": true
}
}
// Instantiate prefab
{
"method": "unity.prefab.instantiate",
"params": {
"prefabPath": "Assets/Prefabs/Player.prefab",
"name": "Player1",
"position": {"x": 0, "y": 0, "z": 0}
}
}
// Complete scene setup
{
"method": "unity.scene.setupArchitecture",
"params": {}
}
```
### Impact
- ✅ Complete GameObject lifecycle management (create, modify, delete)
- ✅ Full Transform manipulation capabilities
- ✅ Complete Prefab workflow support
- ✅ One-command complete scene architecture setup
- ✅ 11 new APIs for scene manipulation
- ✅ Total API count: 46 APIs
## [0.3.10] - 2025-01-07
### Fixed - Meta File Management Scripts
- Added missing .meta files for check_meta_files.sh and generate_meta_files.sh
- Updated scripts to not exclude themselves from meta file checks
- All 31 files now have proper .meta files with no warnings
### Impact
- ✅ Complete elimination of all "Asset has no meta file" warnings
- ✅ Meta file management tools themselves are now properly tracked
- ✅ Zero Unity Console warnings on package import
## [0.3.9] - 2025-01-07
### Added - Meta File Management Tools
- **check_meta_files.sh** - Automated meta file validation script
- Checks all files in package for corresponding .meta files
- Returns exit code 0 if all .meta files exist
- Lists missing .meta files for debugging
- **generate_meta_files.sh** - Automated meta file generator
- Auto-generates missing .meta files with proper GUIDs
- Supports MonoImporter, TextScriptImporter, DefaultImporter
- Excludes system files (.DS_Store, LICENSE, README.md, etc.)
- Updated RELEASE_CHECKLIST.md with automated meta file check step
### Fixed - Unity Package Warnings
- "Asset has no meta file, but it's in an immutable folder" warnings eliminated
- All documentation files (.md, .txt) now have .meta files
- All script files (.sh) now have .meta files
### Impact
- ✅ No more Unity Console warnings about missing .meta files
- ✅ Automated validation prevents future meta file issues
- ✅ Clean Unity package import experience
## [0.3.8] - 2025-01-07
### Added - FindObjectOfType API
- **unity.scene.findObjectOfType** - Find objects by component type in scene
- Equivalent to Unity's `Object.FindObjectOfType<T>()`
- Search for components without knowing GameObject path
- Support for `includeInactive` parameter (default: false)
- Returns GameObject path, name, instanceId, and active state
- Critical for AR/XR workflows where components are on dynamic GameObjects
### Use Case
```json
// Find ARAnchorManager in scene
{
"method": "unity.scene.findObjectOfType",
"params": {
"componentType": "UnityEngine.XR.ARFoundation.ARAnchorManager",
"includeInactive": false
}
}
```
### Response
```json
{
"result": {
"found": true,
"gameObjectPath": "XR Origin/AR Session Origin",
"gameObjectName": "AR Session Origin",
"componentType": "UnityEngine.XR.ARFoundation.ARAnchorManager",
"instanceId": 12345,
"isActive": true
}
}
```
### Technical Details
- SceneSetupCommand.cs: Added FindObjectOfType method
- ComponentReflection.cs: Made FindComponentType public for reuse
- McpSession.cs: Registered unity.scene.findObjectOfType API
- UnityMcpHttpServer.cs: Registered unity.scene.findObjectOfType API
- Uses Resources.FindObjectsOfTypeAll for inactive objects
- Uses Object.FindObjectOfType for active-only search
- Filters out asset objects (only scene objects returned)
### Impact
- ✅ 100% API coverage for AvatarSceneSetup.cs functionality
- ✅ Can now find AR Foundation components dynamically
- ✅ No need to hardcode GameObject paths for runtime components
- ✅ Full automated scene setup via MCP APIs
### Example
- Added `example_avatar_scene_setup.sh` - Complete AR avatar scene setup script
- Demonstrates MCP-based equivalent of AvatarSceneSetup.cs editor extension
- Includes FindObjectOfType usage for ARAnchorManager discovery
### Added - Meta File Management Tools
- **check_meta_files.sh** - Automated meta file validation script
- Checks all files in package for corresponding .meta files
- Returns exit code 0 if all .meta files exist
- Lists missing .meta files for debugging
- **generate_meta_files.sh** - Automated meta file generator
- Auto-generates missing .meta files with proper GUIDs
- Supports MonoImporter, TextScriptImporter, DefaultImporter
- Excludes system files (.DS_Store, LICENSE, README.md, etc.)
- Updated RELEASE_CHECKLIST.md with automated meta file check step
### Fixed - Unity Package Warnings
- "Asset has no meta file, but it's in an immutable folder" warnings eliminated
- All documentation files (.md, .txt) now have .meta files
- All script files (.sh) now have .meta files
### Impact
- ✅ No more Unity Console warnings about missing .meta files
- ✅ Automated validation prevents future meta file issues
- ✅ Clean Unity package import experience
## [0.3.7] - 2025-01-07
### Added - Documentation
- **TROUBLESHOOTING.md** - Comprehensive troubleshooting guide
- Connection issues diagnosis with flowchart
- 6 common causes and solutions
- Debug command collection
- FAQ section
- Step-by-step problem diagnosis
### Impact
- ✅ Better user support and self-service
- ✅ Faster problem resolution
- ✅ Reduced GitHub issues for common problems
## [0.3.6] - 2025-01-07
### Fixed - Performance Issue
- **unity.scene.list timeout**: Added `maxDepth` parameter to limit recursion depth
- Default depth: 2 levels (prevents timeout on large scenes)
- Configurable via `params.maxDepth` parameter
- Added `childCount` field to show total children even when not fully serialized
- Backward compatible: no params = default depth 2
### Changed
- **unity.scene.list** now accepts optional `maxDepth` parameter
```json
{
"method": "unity.scene.list",
"params": {
"maxDepth": 3
}
}
```
### Added
- `SceneListParams` class with `maxDepth` field
- `childCount` field in `GameObjectData` to show total children
- `maxDepth` field in `SceneListResult` to indicate depth used
### Technical Details
- SceneSetupCommand.cs: Added depth limiting to SerializeGameObject
- SceneSetupCommand.cs: Added SceneListParams data structure
- McpSession.cs: Updated to pass params to ListScene
- UnityMcpHttpServer.cs: Updated to pass params to ListScene
### Impact
- ✅ No more timeouts on large scenes
- ✅ Faster response times
- ✅ Backward compatible with existing code
- ✅ Still provides full hierarchy info when needed
## [0.3.5] - 2025-01-07
### Fixed - Additional Duplicate Definition
- **CS0101**: Removed duplicate `Vector2Data` from `AnimatorParameter.cs`
- Vector2Data was defined in both `AnimatorParameter.cs` (line 65) and `SceneSetupCommand.cs` (line 512)
- Kept single definition in `SceneSetupCommand.cs` as centralized location
- **Meta file warnings**: Added missing `.meta` files
- `PACKAGE_UPDATE_WORKFLOW.md.meta`
- `RELEASE_CHECKLIST.md.meta`
### Technical Details
- AnimatorParameter.cs: Removed Vector2Data class (lines 61-74)
- AnimatorAddStateParams now uses Vector2Data from SceneSetupCommand.cs
- All vector/quaternion data types remain in single location (SceneSetupCommand.cs)
### Impact
- ✅ All compilation errors resolved
- ✅ No meta file warnings
- ✅ Package compiles successfully in Unity 6000.2.8f1
## [0.3.4] - 2025-01-07
### Fixed - Compilation Errors
- **CS0101**: Removed duplicate `Vector2Data` and `Vector4Data` class definitions
- Classes were defined in both `ComponentReflection.cs` and `SceneSetupCommand.cs`
- Consolidated all vector/quaternion data types in `SceneSetupCommand.cs`
- **CS0579**: Fixed duplicate `[Serializable]` attribute errors
- **Meta file warning**: Added missing `.meta` file for `test_prompts_ja.md`
- **Assembly resolution error**: Fixed as consequence of compilation error fixes
### Added - Documentation
- **PACKAGE_UPDATE_WORKFLOW.md** - Complete package development and release workflow
- Development phase guidelines
- Testing procedures
- Release checklist
- CI/CD automation plans
- Troubleshooting guide
- **RELEASE_CHECKLIST.md** - Pre-release verification checklist
- Code quality checks
- Functional tests
- Documentation requirements
- Git and GitHub procedures
### Technical Details
- ComponentReflection.cs: Removed duplicate Vector2Data and Vector4Data classes
- SceneSetupCommand.cs: Added Vector2Data and Vector4Data to centralized data types
- test_prompts_ja.md.meta: Created meta file to prevent Unity warnings
- All vector/quaternion data types now in single location (SceneSetupCommand.cs)
### Impact
- ✅ Package now compiles successfully in Unity
- ✅ No compilation errors or warnings
- ✅ All MCP APIs functional
- ✅ Improved development workflow with comprehensive documentation
### GitHub Issues Resolved
- Issue #15: v0.3.3 Compilation Error - Duplicate Class Definitions
## [0.3.3] - 2025-01-07
### Added - Object Reference and SerializedField Support
- **unity.component.setReference** - Set object references on component fields
- Support for asset references (ScriptableObject, Material, Prefab, etc.)
- Support for component references (Camera, Transform, etc.)
- Support for GameObject references
- Type checking and validation
- Works with both public and private fields via SerializedObject
- **SerializedObject-based field access** - Access private [SerializeField] fields
- Enhanced `unity.component.inspect` to show private serialized fields
- Enhanced `unity.component.set` to modify private serialized fields
- Full Unity Editor integration with Undo/Redo support
- Inspector synchronization
- Type-safe property access
### Changed
- `unity.component.inspect` now uses SerializedObject to enumerate all serialized fields
- Includes private fields with [SerializeField] attribute
- Better value representation for object references
- `unity.component.set` now prioritizes SerializedObject for field setting
- Supports both public and private fields
- Fallback to reflection for public properties
### Technical Details
- ComponentReflection.cs: Added SetReference method with asset/component/GameObject resolution
- ComponentReflection.cs: Added GetSerializedPropertyValue and SetSerializedPropertyValue helpers
- ComponentReflection.cs: Modified InspectComponent to use SerializedProperty iteration
- ComponentReflection.cs: Modified SetField to use SerializedObject for fields
- McpSession.cs: Registered unity.component.setReference API
- UnityMcpHttpServer.cs: Registered unity.component.setReference API
### Use Cases
```json
// Set ScriptableObject reference
{
"method": "unity.component.setReference",
"params": {
"gameObjectPath": "AvatarInstanceManager",
"componentType": "AICam.VRM.AvatarInstanceManager",
"fieldName": "settings",
"referenceType": "asset",
"referencePath": "Assets/Settings/DefaultAvatarPlacementSettings.asset"
}
}
// Set Component reference
{
"method": "unity.component.setReference",
"params": {
"gameObjectPath": "AvatarInstanceManager",
"componentType": "AICam.VRM.AvatarInstanceManager",
"fieldName": "arCamera",
"referenceType": "component",
"referenceGameObjectPath": "XR Origin/Camera Offset/AR Camera",
"referenceComponentType": "Camera"
}
}
// Set private SerializeField value
{
"method": "unity.component.set",
"params": {
"gameObjectPath": "AvatarFollowController",
"componentType": "AICam.VRM.AvatarFollowController",
"fieldName": "followDistance",
"value": 2.5
}
}
```
### GitHub Issues Resolved
- Issue #13: Object Reference Setting API
- Issue #14: SerializedField Access Support
## [0.3.2] - 2025-01-07
### Fixed
- **ThreadAbortException handling** - Silently handle ThreadAbortException during Unity domain reload
- Prevents error logs when Unity recompiles scripts
- Proper thread cleanup with Thread.ResetAbort()
- Applied to all server threads (WebSocket, HTTP, Sessions)
- No functional impact - servers automatically restart after reload
### Technical Details
- UnityMcpServer.cs: Added ThreadAbortException catch in ServerLoop
- McpSession.cs: Added ThreadAbortException catch in HandleClient
- UnityMcpHttpServer.cs: Added ThreadAbortException catch in ServerLoop
- Improved error logging to only show unexpected errors
## [0.3.1] - 2025-01-07
### Added - Scene Editing APIs
- **unity.component.add** - Add components to GameObjects dynamically
- Intelligent type resolution across all assemblies
- Support for Unity built-in and custom MonoBehaviour types
- Duplicate component prevention
- **unity.component.remove** - Remove components from GameObjects
- Safe component removal with Transform protection
- Proper cleanup with DestroyImmediate
- **unity.asset.createScriptableObject** - Create ScriptableObject assets
- Dynamic type loading from any assembly
- Automatic directory creation
- Full AssetDatabase integration
- **unity.asset.createFolder** - Create folders in project (now on WebSocket)
- **unity.scene.save** - Save Unity scenes
- Save active scene or specific scene by path
- Full EditorSceneManager integration
- **unity.editor.executeMenuItem** - Execute Unity menu items
- Run custom editor commands
- MenuItem path-based invocation
- **Asset Creation APIs on WebSocket** - All asset creation APIs now available via WebSocket
- createMaterial, createScene, createPhysicsMaterial, etc.
### Changed
- Empty GameObject creation now documented (primitiveType parameter is optional)
- Improved error messages for component operations
### Fixed
- Asset creation APIs were HTTP-only, now available on WebSocket
### Technical Details
- ComponentReflection.cs: Added AddComponent, RemoveComponent with intelligent type finder
- UnityAssetCreator.cs: Added CreateScriptableObject with type resolution
- SceneSetupCommand.cs: Added SaveScene and ExecuteMenuItem
- McpSession.cs: Registered all new APIs in WebSocket handler
- UnityMcpHttpServer.cs: Registered all new APIs in HTTP handler
### GitHub Issues Resolved
- Issue #4: Component Addition API
- Issue #5: ScriptableObject Creation API
- Issue #6: Folder Creation WebSocket Support
- Issue #7: Scene Save API
- Issue #8: MenuItem Execution API
- Issue #11: Component Removal API
### Planned for v0.2.0
- Editor UI for MCP Server status visualization
- Connected clients list display
- Real-time communication log viewer
- Server start/stop controls
- Connection statistics
### Planned for v0.3.0
- Multiple Unity project simultaneous connection support
- Automatic port assignment
- Client identification system
- Connection conflict resolution
### Planned for v1.0.0
- Stability improvements
- Performance optimizations
- Comprehensive documentation
- Full unit test coverage
- Production-ready release
## [0.1.0] - 2025-10-30
### Added
- Initial release of Unity MCP Server
- WebSocket server running on ws://localhost:5050
- JSON-RPC protocol implementation
- **Log Stream System**
- `unity.log.stream` - Real-time log streaming
- `unity.log.history` - Log history retrieval
- Debug.Log, Warning, Error capture
- Log filtering by level (all/warning/error)
- **Scene Management**
- `unity.scene.list` - Scene structure retrieval
- `unity.scene.setup` - Scene initialization
- `unity.create` - GameObject creation
- Automatic Camera and Light setup
- **Asset Database Access**
- `unity.asset.list` - Asset enumeration by type
- `unity.asset.find` - Asset search by path/GUID
- Support for all Unity asset types
- GUID to path conversion
- **Component Reflection**
- `unity.component.list` - Component enumeration
- `unity.component.inspect` - Component details retrieval
- `unity.component.set` - Field/Property modification
- `unity.component.invoke` - Method invocation
- Support for primitive types and Unity types
- **Animator Controller Builder**
- `unity.animator.create` - AnimatorController creation
- `unity.animator.addState` - State addition
- `unity.animator.addTransition` - Transition creation
- `unity.animator.addParameter` - Parameter addition
- `unity.animator.assignClip` - AnimationClip assignment
- `unity.animator.bind` - GameObject binding
- **Editor Integration**
- Automatic server startup on Unity Editor launch
- `MCP` menu in Unity Editor
- "Copy Test YAML to Clipboard" function
- **Documentation**
- Comprehensive README
- Wiki pages for each feature
- API reference documentation
- Usage examples
- **Test Project**
- Sample Unity project for testing
- Package Manager integration example
### Technical Details
- Unity 2021.3+ compatibility
- No external server dependencies
- Fully self-contained in Unity Editor
- Supports both EditMode and PlayMode
### Known Limitations
- Single connection only (multi-project support coming in v0.3.0)
- BlendTree not supported (planned for future release)
- Sub-State Machine not supported (planned for future release)
- Array/List property setting not supported (planned for future release)
- Local network only (security by design)
## Version Roadmap
### v0.1.0 - Initial Release ✅
**Focus:** Core functionality and basic API
- Log streaming
- Scene management
- Asset database access
- Component reflection
- Animator controller builder
- Basic editor integration
**Target Date:** 2025-10-30
**Status:** Released
### v0.2.0 - Editor UI Enhancement
**Focus:** Visualization and user experience
- MCP Server status dashboard
- Connected clients monitoring
- Real-time communication log viewer
- Server controls (start/stop/restart)
- Connection statistics and metrics
- Visual feedback for API calls
**Target Date:** 2025-Q1
**Status:** Planned
### v0.3.0 - Multi-Project Support
**Focus:** Scalability and flexibility
- Multiple Unity project simultaneous connections
- Dynamic port assignment and management
- Client identification and session management
- Connection conflict detection and resolution
- Per-project configuration
- Cross-project communication
**Target Date:** 2025-Q2
**Status:** Planned
### v0.4.0 - Advanced Features
**Focus:** Extended capabilities
- BlendTree support
- Sub-State Machine support
- Array/List property manipulation
- Coroutine execution API
- UnityEvent subscription
- Component add/remove operations
- Scene saving functionality
- Prefab instantiation
**Target Date:** 2025-Q3
**Status:** Planned
### v0.5.0 - Performance & Security
**Focus:** Optimization and hardening
- Performance profiling and optimization
- Message batching and compression
- Authentication and authorization
- SSL/TLS support (optional)
- Rate limiting
- Error recovery mechanisms
- Memory usage optimization
**Target Date:** 2025-Q4
**Status:** Planned
### v1.0.0 - Production Ready
**Focus:** Stability and completeness
- Full stability testing
- Comprehensive unit tests
- Integration tests
- Performance benchmarks
- Complete API documentation
- Video tutorials
- Sample projects and use cases
- Community feedback integration
- Long-term support commitment
**Target Date:** 2026-Q1
**Status:** Planned
## Migration Guides
### Upgrading to v0.2.0 (When Released)
No breaking changes expected. All existing APIs will remain compatible.
### Upgrading to v0.3.0 (When Released)
- Connection URL format will change to include project identifier
- Update your ClaudeCode configuration to specify target project
- Existing single-project setups will continue to work with default project ID
### Upgrading to v1.0.0 (When Released)
- API may be finalized with minor breaking changes
- Deprecated functions from earlier versions will be removed
- Migration script will be provided
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
## Support
- GitHub Issues: [https://github.com/yourusername/UnityMCP/issues](https://github.com/yourusername/UnityMCP/issues)
- Wiki: [https://github.com/yourusername/UnityMCP/wiki](https://github.com/yourusername/UnityMCP/wiki)
---
[Unreleased]: https://github.com/yourusername/UnityMCP/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/yourusername/UnityMCP/releases/tag/v0.1.0