Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ uv.lock
# Claude Code
.claude/*
!.claude/plugins/
TestProject/Screenshots/
7 changes: 6 additions & 1 deletion README.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Complexity](https://img.shields.io/badge/complexity-A%2FB-brightgreen)](https://github.com/bigdra50/unity-cli/actions/workflows/ci.yml)
[![Maintainability](https://img.shields.io/badge/maintainability-A-brightgreen)](https://github.com/bigdra50/unity-cli/actions/workflows/ci.yml)
[![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/)
[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey)](https://github.com/bigdra50/unity-cli)
[![Unity](https://img.shields.io/badge/Unity-2022.3%2B-black?logo=unity)](https://unity.com/)
[![openupm](https://img.shields.io/npm/v/com.bigdra50.unity-bridge?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.bigdra50.unity-bridge/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -125,6 +126,9 @@ u completion -s bash >> ~/.bashrc

# Fish
u completion -s fish > ~/.config/fish/completions/unity-cli.fish

# PowerShell
u completion -s powershell >> $PROFILE
```

### プロジェクトを開く
Expand Down Expand Up @@ -549,7 +553,8 @@ flowchart TB

```bash
# Relay Serverが起動しているか確認
lsof -i :6500
lsof -i :6500 # macOS / Linux
netstat -ano | findstr :6500 # Windows

# 接続中インスタンス確認
u instances
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Complexity](https://img.shields.io/badge/complexity-A%2FB-brightgreen)](https://github.com/bigdra50/unity-cli/actions/workflows/ci.yml)
[![Maintainability](https://img.shields.io/badge/maintainability-A-brightgreen)](https://github.com/bigdra50/unity-cli/actions/workflows/ci.yml)
[![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/)
[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey)](https://github.com/bigdra50/unity-cli)
[![Unity](https://img.shields.io/badge/Unity-2022.3%2B-black?logo=unity)](https://unity.com/)
[![openupm](https://img.shields.io/npm/v/com.bigdra50.unity-bridge?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.bigdra50.unity-bridge/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -125,6 +126,9 @@ u completion -s bash >> ~/.bashrc

# Fish
u completion -s fish > ~/.config/fish/completions/unity-cli.fish

# PowerShell
u completion -s powershell >> $PROFILE
```

### Open Project
Expand Down Expand Up @@ -549,7 +553,8 @@ See [docs/protocol-spec.md](docs/protocol-spec.md) for details.

```bash
# Check if Relay Server is running
lsof -i :6500
lsof -i :6500 # macOS / Linux
netstat -ano | findstr :6500 # Windows

# Check connected instances
u instances
Expand Down
20 changes: 10 additions & 10 deletions TestProject/Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
Expand Down Expand Up @@ -284,7 +284,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c7aa501fcf147478b82d310cebf26faa, type: 3}
m_Name:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::SampleHUDController
--- !u!114 &334705904
MonoBehaviour:
Expand All @@ -296,7 +296,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_Name:
m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument
m_PanelSettings: {fileID: 0}
m_ParentUI: {fileID: 0}
Expand Down Expand Up @@ -350,14 +350,14 @@ Light:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410087039}
m_Enabled: 1
serializedVersion: 11
serializedVersion: 12
m_Type: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 2
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_CookieSize2D: {x: 10, y: 10}
m_Shadows:
m_Type: 2
m_Resolution: -1
Expand Down Expand Up @@ -432,8 +432,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_CustomShadowLayers: 0
Expand Down Expand Up @@ -478,8 +478,8 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Name:
m_EditorClassIdentifier:
m_IsGlobal: 1
priority: 0
blendDistance: 0
Expand Down
18 changes: 13 additions & 5 deletions TestProject/Assets/Settings/Mobile_RPAsset.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ MonoBehaviour:
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
m_Name: Mobile_RPAsset
m_EditorClassIdentifier:
k_AssetVersion: 12
k_AssetPreviousVersion: 12
m_EditorClassIdentifier:
k_AssetVersion: 13
k_AssetPreviousVersion: 13
m_RendererType: 1
m_RendererData: {fileID: 0}
m_RendererDataList:
Expand Down Expand Up @@ -53,6 +53,7 @@ MonoBehaviour:
m_AdditionalLightsShadowResolutionTierHigh: 1024
m_ReflectionProbeBlending: 1
m_ReflectionProbeBoxProjection: 1
m_ReflectionProbeAtlas: 1
m_ShadowDistance: 50
m_ShadowCascadeCount: 1
m_Cascade2Split: 0.25
Expand All @@ -78,11 +79,11 @@ MonoBehaviour:
m_UseAdaptivePerformance: 1
m_ColorGradingMode: 0
m_ColorGradingLutSize: 32
m_AllowPostProcessAlphaOutput: 0
m_UseFastSRGBLinearConversion: 1
m_SupportDataDrivenLensFlare: 1
m_SupportScreenSpaceLensFlare: 1
m_GPUResidentDrawerMode: 0
m_UseLegacyLightmaps: 0
m_SmallMeshScreenPercentage: 0
m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0
m_ShadowType: 1
Expand All @@ -98,7 +99,7 @@ MonoBehaviour:
m_Values: []
obsoleteHasProbeVolumes:
m_Keys: []
m_Values:
m_Values:
m_PrefilteringModeMainLightShadows: 3
m_PrefilteringModeAdditionalLight: 4
m_PrefilteringModeAdditionalLightShadows: 0
Expand All @@ -109,6 +110,7 @@ MonoBehaviour:
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterAlphaOutput: 0
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 0
Expand All @@ -126,8 +128,14 @@ MonoBehaviour:
m_PrefilterSoftShadowsQualityHigh: 1
m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 1
m_PrefilterScreenSpaceIrradiance: 0
m_PrefilterNativeRenderPass: 1
m_PrefilterUseLegacyLightmaps: 0
m_PrefilterBicubicLightmapSampling: 0
m_PrefilterReflectionProbeRotation: 0
m_PrefilterReflectionProbeBlending: 0
m_PrefilterReflectionProbeBoxProjection: 0
m_PrefilterReflectionProbeAtlas: 0
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 0
m_Textures:
Expand Down
18 changes: 13 additions & 5 deletions TestProject/Assets/Settings/PC_RPAsset.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ MonoBehaviour:
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
m_Name: PC_RPAsset
m_EditorClassIdentifier:
k_AssetVersion: 12
k_AssetPreviousVersion: 12
m_EditorClassIdentifier:
k_AssetVersion: 13
k_AssetPreviousVersion: 13
m_RendererType: 1
m_RendererData: {fileID: 0}
m_RendererDataList:
Expand Down Expand Up @@ -53,6 +53,7 @@ MonoBehaviour:
m_AdditionalLightsShadowResolutionTierHigh: 1024
m_ReflectionProbeBlending: 1
m_ReflectionProbeBoxProjection: 1
m_ReflectionProbeAtlas: 1
m_ShadowDistance: 50
m_ShadowCascadeCount: 4
m_Cascade2Split: 0.25
Expand All @@ -78,11 +79,11 @@ MonoBehaviour:
m_UseAdaptivePerformance: 1
m_ColorGradingMode: 0
m_ColorGradingLutSize: 32
m_AllowPostProcessAlphaOutput: 0
m_UseFastSRGBLinearConversion: 0
m_SupportDataDrivenLensFlare: 1
m_SupportScreenSpaceLensFlare: 1
m_GPUResidentDrawerMode: 0
m_UseLegacyLightmaps: 0
m_SmallMeshScreenPercentage: 0
m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0
m_ShadowType: 1
Expand All @@ -98,7 +99,7 @@ MonoBehaviour:
m_Values: []
obsoleteHasProbeVolumes:
m_Keys: []
m_Values:
m_Values:
m_PrefilteringModeMainLightShadows: 3
m_PrefilteringModeAdditionalLight: 4
m_PrefilteringModeAdditionalLightShadows: 0
Expand All @@ -109,6 +110,7 @@ MonoBehaviour:
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 0
m_PrefilterHDROutput: 1
m_PrefilterAlphaOutput: 0
m_PrefilterSSAODepthNormals: 0
m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 1
Expand All @@ -126,8 +128,14 @@ MonoBehaviour:
m_PrefilterSoftShadowsQualityHigh: 0
m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 1
m_PrefilterScreenSpaceIrradiance: 0
m_PrefilterNativeRenderPass: 1
m_PrefilterUseLegacyLightmaps: 0
m_PrefilterBicubicLightmapSampling: 0
m_PrefilterReflectionProbeRotation: 0
m_PrefilterReflectionProbeBlending: 0
m_PrefilterReflectionProbeBoxProjection: 0
m_PrefilterReflectionProbeAtlas: 0
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 0
m_Textures:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MonoBehaviour:
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3}
m_Name: UniversalRenderPipelineGlobalSettings
m_EditorClassIdentifier:
m_EditorClassIdentifier:
m_ShaderStrippingSetting:
m_Version: 0
m_ExportShaderVariants: 1
Expand Down Expand Up @@ -62,9 +62,14 @@ MonoBehaviour:
- rid: 8078647796443643910
- rid: 8078647796443643911
- rid: 8078647796443643912
- rid: 4376185446353862849
- rid: 4376185446353862850
- rid: 4376185446353862851
- rid: 4376185446353862852
- rid: 4376185446353862853
m_RuntimeSettings:
m_List: []
m_AssetVersion: 8
m_AssetVersion: 10
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
m_RenderingLayerNames:
- Light Layer default
Expand All @@ -90,10 +95,45 @@ MonoBehaviour:
m_Values: []
obsoleteHasProbeVolumes:
m_Keys: []
m_Values:
m_Values:
references:
version: 2
RefIds:
- rid: 4376185446353862849
type: {class: RayTracingRenderPipelineResources, ns: UnityEngine.Rendering.UnifiedRayTracing, asm: Unity.UnifiedRayTracing.Runtime}
data:
m_Version: 1
m_GeometryPoolKernels: {fileID: 7200000, guid: 98e3d58cae7210c4786f67f504c9e899, type: 3}
m_CopyBuffer: {fileID: 7200000, guid: 1b95b5dcf48d1914c9e1e7405c7660e3, type: 3}
m_CopyPositions: {fileID: 7200000, guid: 1ad53a96b58d3c3488dde4f14db1aaeb, type: 3}
m_BitHistogram: {fileID: 7200000, guid: 8670f7ce4b60cef43bed36148aa1b0a2, type: 3}
m_BlockReducePart: {fileID: 7200000, guid: 4e034cc8ea2635c4e9f063e5ddc7ea7a, type: 3}
m_BlockScan: {fileID: 7200000, guid: 4d6d5de35fa45ef4a92119397a045cc9, type: 3}
m_BuildHlbvh: {fileID: 7200000, guid: 2d70cd6be91bd7843a39a54b51c15b13, type: 3}
m_RestructureBvh: {fileID: 7200000, guid: 56641cb88dcb31a4398a4997ef7a7a8c, type: 3}
m_Scatter: {fileID: 7200000, guid: a2eaeefdac4637a44b734e85b7be9186, type: 3}
- rid: 4376185446353862850
type: {class: OnTilePostProcessResource, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_Version: 0
m_UberPostShader: {fileID: 4800000, guid: fe4f13c1004a07d4ea1e30bfd0326d9e, type: 3}
- rid: 4376185446353862851
type: {class: URPTerrainShaderSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_Version: 0
m_IncludeTerrainShaders: 1
- rid: 4376185446353862852
type: {class: UniversalRenderPipelineRuntimeTerrainShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_Version: 0
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
- rid: 4376185446353862853
type: {class: URPReflectionProbeSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Universal.Runtime}
data:
version: 1
useReflectionProbeRotation: 0
- rid: 6852985685364965376
type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
Expand Down Expand Up @@ -135,9 +175,9 @@ MonoBehaviour:
m_CoreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3}
m_SamplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
m_TerrainDetailLit: {fileID: 0}
m_TerrainDetailGrassBillboard: {fileID: 0}
m_TerrainDetailGrass: {fileID: 0}
- rid: 6852985685364965381
type: {class: UniversalRenderPipelineRuntimeTextures, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
Expand All @@ -155,11 +195,11 @@ MonoBehaviour:
m_SpriteUnshadowShader: {fileID: 4800000, guid: de02b375720b5c445afe83cd483bedf3, type: 3}
m_GeometryShadowShader: {fileID: 4800000, guid: 19349a0f9a7ed4c48a27445bcf92e5e1, type: 3}
m_GeometryUnshadowShader: {fileID: 4800000, guid: 77774d9009bb81447b048c907d4c6273, type: 3}
m_FallOffLookup: {fileID: 2800000, guid: 5688ab254e4c0634f8d6c8e0792331ca, type: 3}
m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2}
m_DefaultMesh2DLitMaterial: {fileID: 2100000, guid: 9452ae1262a74094f8a68013fbcd1834, type: 2}
- rid: 6852985685364965383
type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
Expand Down Expand Up @@ -232,7 +272,7 @@ MonoBehaviour:
m_version: 0
m_IncludeReferencedInScenes: 0
m_IncludeAssetsByLabel: 0
m_LabelToInclude:
m_LabelToInclude:
- rid: 6852985685364965392
type: {class: ShaderStrippingSetting, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data:
Expand Down
5 changes: 5 additions & 0 deletions TestProject/Assets/Tests/Editor/BridgeManagerAsyncTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using UnityBridge;
using UnityEngine;
using UnityEngine.TestTools;

namespace Game.Tests.Editor
{
Expand Down Expand Up @@ -43,6 +46,8 @@ public async Task ExecuteCommandOnMainThreadAsync_DispatcherThrows_SendsErrorVia

// async Task なので await で例外ハンドリングを確認できる
// 内部 catch で SendCommandErrorAsync が呼ばれるため、例外は伝播しない
BridgeLog.Enabled = true;
LogAssert.Expect(LogType.Error, new Regex("Command execution failed: InvalidOperationException - test error"));
await manager.ExecuteCommandOnMainThreadAsync(args);
Comment on lines +50 to 51
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check BridgeLog's Enabled property definition and default value
echo "=== BridgeLog.cs Enabled property ==="
rg -n "Enabled" --type=cs -B2 -A5 UnityBridge/Editor/Helpers/BridgeLog.cs

echo ""
echo "=== BridgeLog initialization/usage in BridgeManagerAsyncTests ==="
rg -n "BridgeLog\|SetUp\|setUp" --type=cs -B2 -A3 TestProject/Assets/Tests/Editor/BridgeManagerAsyncTests.cs

echo ""
echo "=== Test file structure and full context around lines 49-50 ==="
sed -n '1,60p' TestProject/Assets/Tests/Editor/BridgeManagerAsyncTests.cs | cat -n

Repository: bigdra50/unity-cli

Length of output: 5232


🏁 Script executed:

#!/bin/bash
# Check if there's a test fixture or setup class that configures BridgeLog
echo "=== Looking for test fixture or setup files ==="
fd -e cs TestProject/Assets/Tests/Editor/ | xargs rg -l "SetUp\|TearDown\|OneTimeSetUp" --type=cs

echo ""
echo "=== Check for BridgeLog.Enabled assignments in test files ==="
rg -n "BridgeLog\\.Enabled" --type=cs TestProject/Assets/Tests/

Repository: bigdra50/unity-cli

Length of output: 623


🏁 Script executed:

#!/bin/bash
# Verify the file matches the coding guidelines
echo "=== Verify file location and asmdef ==="
ls -la TestProject/Assets/Tests/Editor/BridgeManagerAsyncTests.cs
if [ -f "TestProject/Assets/Tests/Editor/Game.Tests.Editor.asmdef" ]; then
  echo "asmdef file found:"
  cat TestProject/Assets/Tests/Editor/Game.Tests.Editor.asmdef
else
  echo "Looking for asmdef files in the directory:"
  find TestProject/Assets/Tests/Editor/ -name "*.asmdef"
fi

Repository: bigdra50/unity-cli

Length of output: 551


🏁 Script executed:

#!/bin/bash
# Search for all assignments to BridgeLog.Enabled in the entire codebase
echo "=== All BridgeLog.Enabled assignments ==="
rg -n "BridgeLog\.Enabled\s*=" --type=cs

echo ""
echo "=== Search for EditorPrefs modifications related to EnabledKey ==="
rg -n "UnityBridge\.LogEnabled\|EnabledKey" --type=cs

Repository: bigdra50/unity-cli

Length of output: 275


🏁 Script executed:

#!/bin/bash
# Check if there are any other tests in the same file that might disable logging
echo "=== All test methods in BridgeManagerAsyncTests.cs ==="
rg -n "\[Test\]\|\[OneTimeSetUp\]\|\[SetUp\]\|\[TearDown\]\|public.*Task.*\(" --type=cs TestProject/Assets/Tests/Editor/BridgeManagerAsyncTests.cs | head -20

Repository: bigdra50/unity-cli

Length of output: 116


🏁 Script executed:

#!/bin/bash
# Check ExecuteCommandOnMainThreadAsync implementation to understand error logging
echo "=== ExecuteCommandOnMainThreadAsync implementation ==="
rg -n "ExecuteCommandOnMainThreadAsync" --type=cs -A 30 UnityBridge/Editor/ | head -50

Repository: bigdra50/unity-cli

Length of output: 3172


テスト実行時の BridgeLog.Enabled 状態に依存しています

BridgeLog.Errorif (!Enabled) return; のガード節を持つため、Debug.LogError が呼び出されるには BridgeLog.Enabledtrue である必要があります。デフォルト値は true ですが、このテストは明示的に BridgeLog.Enabled を設定していないため、EditorPrefs から previous session の値が読み込まれる可能性があります。LogAssert.Expect が確実に機能するよう、テストメソッドの開始時に BridgeLog.Enabled = true; を明示的に設定してください。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@TestProject/Assets/Tests/Editor/BridgeManagerAsyncTests.cs` around lines 49 -
50, This test depends on BridgeLog.Enabled being true so BridgeLog.Error will
call Debug.LogError; at the start of the test method set BridgeLog.Enabled =
true to ensure LogAssert.Expect(LogType.Error, ...) will see the error, i.e.
before calling manager.ExecuteCommandOnMainThreadAsync(args) explicitly assign
BridgeLog.Enabled = true (and optionally restore the previous value at the end
of the test if needed).


Assert.That(sentErrors.Count, Is.EqualTo(1));
Expand Down
Loading