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
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,33 @@ public static class EditorAddressablesSync

static EditorAddressablesSync()
{
// バッチモード(CI)ではUseExistingBuildモードだとカタログ未存在で
// AddressablesBuildScriptHooksがダイアログを表示しハングするため、
// Play Mode ScriptをUse Asset Database(シミュレーション)に切り替える
if (Application.isBatchMode)
{
SwitchToAssetDatabaseMode();
}

EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
}

/// <summary>
/// Addressables Play Mode ScriptをUse Asset Database(インデックス0)に切り替える
/// </summary>
private static void SwitchToAssetDatabaseMode()
{
var settings = AddressableAssetSettingsDefaultObject.Settings;
if (settings == null) return;

const int assetDatabaseIndex = 0; // BuildScriptFastMode
if (settings.ActivePlayModeDataBuilderIndex != assetDatabaseIndex)
{
settings.ActivePlayModeDataBuilderIndex = assetDatabaseIndex;
Debug.Log("[AddressablesSync] Batch mode: Play Mode Script を Use Asset Database に切り替えました");
}
}

private static void OnPlayModeStateChanged(PlayModeStateChange state)
{
if (state == PlayModeStateChange.ExitingEditMode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public void MockGameSceneWithArgAndResult_CanSetCanceled()
}

[Test]
public void MockGameSceneWithArgAndResult_CanSetException()
public async Task MockGameSceneWithArgAndResult_CanSetException()
{
var scene = new MockGameSceneWithArgAndResult<string, int>();
scene.ResultTcs = new UniTaskCompletionSource<int>();
Expand All @@ -308,6 +308,16 @@ public void MockGameSceneWithArgAndResult_CanSetException()
var success = scene.TrySetException(exception);

Assert.IsTrue(success);

// faulted タスクをawaitして例外を消費し、UniTaskの未観測例外ログを防止
try
{
await scene.ResultTcs.Task;
}
catch (InvalidOperationException)
{
// Expected
}
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
using UnityEngine.TestTools;
using Debug = UnityEngine.Debug;

namespace Game.Tests.MVP.ECS
Expand Down Expand Up @@ -47,9 +46,6 @@ public void OneTimeSetUp()
[SetUp]
public void SetUp()
{
// 他テストクラスの残留エラーログによる誤検出を防止
LogAssert.ignoreFailingMessages = true;

_logBuilder = new StringBuilder();
_testWorld = new World("PerfTestWorld");
_entityManager = _testWorld.EntityManager;
Expand All @@ -72,8 +68,6 @@ public void TearDown()
_testWorld.Dispose();
}

LogAssert.ignoreFailingMessages = false;

// ログ出力
if (_logBuilder != null && _logBuilder.Length > 0)
{
Expand All @@ -83,6 +77,7 @@ public void TearDown()
}
}


#region Helper Methods

private void CreateEnemyEntities(int count, float3 playerPosition)
Expand Down
Loading