Skip to content
Closed
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
73 changes: 73 additions & 0 deletions .github/workflows/octopus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Octopus Review

on:
pull_request:
types:
- opened
- synchronize
- reopened

permissions:
contents: read
pull-requests: write

jobs:
review:
runs-on: ubuntu-latest

steps:
- name: Run Octopus Review
uses: octopusreview/action@v1
with:
# Public Repoなら不要
# Private Repoの場合のみ設定
octopus-api-key: ${{ secrets.OCTOPUS_API_KEY }}

# 日本語レビュー
review-language: "ja"

# Unity/C#向けチューニング
extra-instructions: |
**必ず日本語のみでレビューしてください。英語は使わないでください。**
You MUST respond in Japanese only. Do not use English.


レビューは簡潔にしてください。
重大な問題を優先してください。

以下を重点的に確認:
- NullReferenceException の可能性
- GC Alloc
- Update/LateUpdate/FixedUpdate内の重い処理
- LINQ多用
- foreach boxing
- async/await の例外処理
- async void
- UniTaskの誤用
- IDisposable/NativeArray の Dispose漏れ
- Addressables誤用
- Unity main thread問題
- ScriptableObject誤用
- イベント購読解除漏れ
- メモリリーク
- パフォーマンス問題
- マルチスレッド問題
- URP互換性
- Shader負荷

以下は指摘しない:
- 命名スタイル
- コメント不足
- 個人の好みレベルの設計
- 過剰なリファクタ提案
- 小さなコードスタイル
- var使用有無
- 改行位置
- インデント
- using順
- trivialな最適化

Unity特有の問題を優先してください。

明確な問題のみ指摘してください。
推測ベースの指摘は避けてください。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Workflow file missing newline at end of file

The YAML file is missing a trailing newline (\ No newline at end of file). While harmless, POSIX-compliant text files should end with a newline, and some YAML linters will warn about this.

Suggested change
推測ベースの指摘は避けてください
Unity特有の問題を優先してください
明確な問題のみ指摘してください。
推測ベースの指摘は避けてください。
AI Fix Prompt
Fix the following Nit (Style) issue in `.github/workflows/octopus.yaml` at line 73:

Problem: The YAML file is missing a trailing newline (`\ No newline at end of file`). While harmless, POSIX-compliant text files should end with a newline, and some YAML linters will warn about this.

Suggested fix:
            Unity特有の問題を優先してください。

            明確な問題のみ指摘してください。
            推測ベースの指摘は避けてください。

9 changes: 3 additions & 6 deletions Assets/Runtime/Scripts/Log/ErrorIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,19 @@ protected override void Awake()

protected override void OnEnable()
{
if (SDSettings.Instance.IsShowErrorIndicator)
{
Application.logMessageReceived += OnLogMessageReceived;
}

Application.logMessageReceivedThreaded += OnLogMessageReceived;
Clear();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Unconditional subscription when ErrorIndicator is disabled by settings

The old code only subscribed to logMessageReceived when IsShowErrorIndicator was true, avoiding any overhead when the feature is disabled. The new code always subscribes to logMessageReceivedThreaded, and only guards inside the callback. While the overhead per call is small, this now means every log message (including from high-frequency systems) invokes the callback and SDSettings lookup even when the indicator is permanently disabled. Consider retaining the subscription guard, or at minimum caching IsShowErrorIndicator at subscribe time.

Suggested change
Clear();
protected override void OnEnable()
{
// Still subscribe unconditionally if you want runtime toggling,
// but cache the setting to avoid per-call SDSettings lookup:
// _isIndicatorEnabled = SDSettings.Instance.IsShowErrorIndicator;
Application.logMessageReceivedThreaded += OnLogMessageReceived;
Clear();
}
AI Fix Prompt
Fix the following Medium (Performance) issue in `Assets/Runtime/Scripts/Log/ErrorIndicator.cs` at line 23:

Problem: The old code only subscribed to `logMessageReceived` when `IsShowErrorIndicator` was true, avoiding any overhead when the feature is disabled. The new code always subscribes to `logMessageReceivedThreaded`, and only guards inside the callback. While the overhead per call is small, this now means every log message (including from high-frequency systems) invokes the callback and SDSettings lookup even when the indicator is permanently disabled. Consider retaining the subscription guard, or at minimum caching `IsShowErrorIndicator` at subscribe time.

Suggested fix:
protected override void OnEnable()
{
    // Still subscribe unconditionally if you want runtime toggling,
    // but cache the setting to avoid per-call SDSettings lookup:
    // _isIndicatorEnabled = SDSettings.Instance.IsShowErrorIndicator;
    Application.logMessageReceivedThreaded += OnLogMessageReceived;
    Clear();
}

}

protected override void OnDisable()
{
Application.logMessageReceived -= OnLogMessageReceived;
Application.logMessageReceivedThreaded -= OnLogMessageReceived;
Clear();
}

private void OnLogMessageReceived(string condition, string stackTrace, LogType type)
{
if (!SDSettings.Instance.IsShowErrorIndicator) return;
if (type is not (LogType.Error or LogType.Exception or LogType.Assert) || _isBlinking) return;
HasError = true;
StopAllCoroutines();
Expand Down
7 changes: 4 additions & 3 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@
}
},
"jp.co.cyberagent.instant-replay": {
"version": "file:C:/Users/kurob/Desktop/Unity/ScreenRecord/Packages/InstantReplay/Packages/jp.co.cyberagent.instant-replay",
"version": "https://github.com/CyberAgentGameEntertainment/InstantReplay.git?path=/Packages/jp.co.cyberagent.instant-replay",
"depth": 0,
"source": "local",
"dependencies": {}
"source": "git",
"dependencies": {},
"hash": "e9c51149ddf586c2da5672d8795c68f68925d2b1"
},
"jp.co.cyberagent.instant-replay.dependencies": {
"version": "https://github.com/CyberAgentGameEntertainment/InstantReplay.git?path=/Packages/jp.co.cyberagent.instant-replay.dependencies",
Expand Down
Loading