Skip to content

Commit

Permalink
Fix to remove unnecessary dependency in READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
nowsprinting committed Oct 25, 2024
1 parent 40655a7 commit e43a1e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,16 @@ In both cases, the key should be prefixed with `-` and specified as `-LIFESPAN_S
### 3. Run in Play Mode test

Autopilot works within your test code using the async method `Launcher.LaunchAutopilotAsync(string)`.
Specify the `AutopilotSettings` file path as the argument.
Specify the `AutopilotSettings` file path via the argument.

```
[Test]
[LoadScene("Assets/MyGame/Scenes/TitleScene.unity")]
public async Task LaunchAutopilotInTest()
{
// Load the first scene
await SceneManager.LoadSceneAsync(0);
// Launch autopilot
await Launcher.LaunchAutopilotAsync("Assets/Path/To/AutopilotSettings.asset");
}
```
Expand All @@ -234,10 +237,7 @@ public async Task LaunchAutopilotInTest()
> When running tests on a player, any necessary configuration files must be placed in the `Resources` folder to be included in the player build. It can use `IPrebuildSetup` and `IPostBuildCleanup` to insert processing into the test player build.
> [!NOTE]
> `LoadScene` attribute is defined in [Test Helper](https://github.com/nowsprinting/test-helper) package. This attribute loads the scene before starting the test.
> [!NOTE]
> If an error is detected while running, it will be output to `LogError` and the test will fail. You can suppress this by using `LogAssert.ignoreFailingMessages` assuming that you will use Anjin for error handling.
> The test will fail if the test-runner detects a `LogException` or `LogError` output. You can suppress this by using `LogAssert.ignoreFailingMessages` assuming that you will use Anjin for error handling.


Expand Down
10 changes: 5 additions & 5 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,12 @@ $(UNITY) \

```
[Test]
[LoadScene("Assets/MyGame/Scenes/TitleScene.unity")]
public async Task LaunchAutopilotInTest()
{
// 最初のSceneをロード
await SceneManager.LoadSceneAsync(0);
// オートパイロットを起動
await Launcher.LaunchAutopilotAsync("Assets/Path/To/AutopilotSettings.asset");
}
```
Expand All @@ -236,10 +239,7 @@ public async Task LaunchAutopilotInTest()
> テストをプレイヤーで実行するときは、必要な設定ファイルを `Resources` フォルダに置き、ビルドに含まれるようにしてください。テストのプレイヤービルドに処理を挟むには `IPrebuildSetup` および `IPostBuildCleanup` が利用できます。
> [!NOTE]
> `LoadScene` 属性は [Test Helper](https://github.com/nowsprinting/test-helper) パッケージに含まれています。テスト開始前にSceneのロードを行ないます。
> [!NOTE]
> テスト実行中にエラーを検知すると `LogError` が出力されるため、そのテストは失敗と判定されます。エラーハンドリングをAnjinで行なう前提で `LogAssert.ignoreFailingMessages` で抑止してもいいでしょう。
> テストランナーに `LogException` または `LogError` 出力を検知されると、そのテストは失敗と判定されます。エラーハンドリングをAnjinで行なう前提で `LogAssert.ignoreFailingMessages` で抑止してもいいでしょう。


Expand Down

0 comments on commit e43a1e8

Please sign in to comment.