Skip to content

feat: HeadphoneVolumeOverride#136

Open
3096 wants to merge 1 commit into
MuNET-OSS:mainfrom
3096:main
Open

feat: HeadphoneVolumeOverride#136
3096 wants to merge 1 commit into
MuNET-OSS:mainfrom
3096:main

Conversation

@3096

@3096 3096 commented Jun 22, 2026

Copy link
Copy Markdown

Summary by Sourcery

新功能:

  • 引入 HeadphoneVolumeOverride 配置部分,为每位玩家(1P 和 2P)提供固定耳机音量选项,包括可禁用音量覆盖并尊重用户自身设置的能力。
Original summary in English

Summary by Sourcery

New Features:

  • Introduce a HeadphoneVolumeOverride config section with per-player fixed headphone volume options for 1P and 2P, including the ability to disable overriding and honor user settings.

@sourcery-ai

sourcery-ai Bot commented Jun 22, 2026

Copy link
Copy Markdown

审阅者指南

引入了一个新的可配置模组 HeadphoneVolumeOverride,它在 CriAtomExPlayer.SetAisacControl 上使用 Harmony 前缀补丁,根据配置项对 1P/2P 耳机 AISAC 音量控制进行钳制和覆盖,支持为每一侧设置固定音量,或保留为用户设置。

HeadphoneVolumeOverride 在 SetAisacControl 上的 Harmony 前缀顺序图

sequenceDiagram
    participant GameAudioSystem
    participant CriAtomExPlayer
    participant HeadphoneVolumeOverride

    GameAudioSystem->>CriAtomExPlayer: SetAisacControl(controlId, value)
    activate CriAtomExPlayer
    CriAtomExPlayer->>HeadphoneVolumeOverride: PreSetAisacControl(controlId, ref value)
    activate HeadphoneVolumeOverride
    alt [controlId == 2 && p1 >= 0]
        HeadphoneVolumeOverride->>HeadphoneVolumeOverride: Mathf.Clamp(p1 / 20f, 0f, 1f)
        HeadphoneVolumeOverride-->>CriAtomExPlayer: 为 1P 覆盖 value
    else [controlId == 3 && p2 >= 0]
        HeadphoneVolumeOverride->>HeadphoneVolumeOverride: Mathf.Clamp(p2 / 20f, 0f, 1f)
        HeadphoneVolumeOverride-->>CriAtomExPlayer: 为 2P 覆盖 value
    else [其他 controlId 或已禁用]
        HeadphoneVolumeOverride-->>CriAtomExPlayer: value 不变(保留用户设置)
    end
    deactivate HeadphoneVolumeOverride
    CriAtomExPlayer-->>GameAudioSystem: SetAisacControl 完成
    deactivate CriAtomExPlayer
Loading

文件级变更

变更 详情 文件
新增 HeadphoneVolumeOverride 模组类,对耳机 AISAC 音量控制打补丁,可选地覆盖 1P 和 2P 的用户配置音量。
  • 在 AquaMai.Mods.GameSystem 下定义静态类 HeadphoneVolumeOverride,使用双语配置节元数据描述行为和取值范围。
  • 新增两个只读、由配置驱动的 float 项 p1 和 p2,分别用于 1P 和 2P 耳机音量覆盖,默认为 -1 表示不覆盖,并文档化有效范围 0–20。
  • CriAtomExPlayer.SetAisacControl(uint, float) 应用 HarmonyPrefix 补丁以拦截调用,检查 controlId 为 2(1P)和 3(2P)时,当对应的覆盖值为非负数,则用 Mathf.Clamp(override/20f, 0f, 1f) 替换 AISAC 值。
AquaMai.Mods/GameSystem/HeadphoneVolumeOverride.cs

提示和命令

与 Sourcery 交互

  • 触发新审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub Issue: 回复 Sourcery 的某条审查评论,请求从该评论创建 issue。也可以直接回复该审查评论 @sourcery-ai issue 来从中创建 issue。
  • 生成拉取请求标题: 在拉取请求标题任意位置写入 @sourcery-ai 即可随时生成标题。也可以在拉取请求中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。也可以在拉取请求中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,一次性标记解决所有 Sourcery 评论。如果你已经处理完所有评论且不希望继续看到它们,这会很有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,忽略所有现有的 Sourcery 审查。特别适用于你想从头开始新的审查时 —— 记得再评论 @sourcery-ai review 以触发新一轮审查!

自定义你的体验

访问你的 控制面板 以:

  • 启用或禁用 Sourcery 生成的拉取请求摘要、审阅者指南等审查功能。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查指令。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

Introduces a new configurable mod, HeadphoneVolumeOverride, that uses a Harmony prefix patch on CriAtomExPlayer.SetAisacControl to clamp and override the 1P/2P headphone AISAC volume controls based on config entries, allowing fixed per-side volumes or deferring to user settings.

Sequence diagram for HeadphoneVolumeOverride Harmony prefix on SetAisacControl

sequenceDiagram
    participant GameAudioSystem
    participant CriAtomExPlayer
    participant HeadphoneVolumeOverride

    GameAudioSystem->>CriAtomExPlayer: SetAisacControl(controlId, value)
    activate CriAtomExPlayer
    CriAtomExPlayer->>HeadphoneVolumeOverride: PreSetAisacControl(controlId, ref value)
    activate HeadphoneVolumeOverride
    alt [controlId == 2 && p1 >= 0]
        HeadphoneVolumeOverride->>HeadphoneVolumeOverride: Mathf.Clamp(p1 / 20f, 0f, 1f)
        HeadphoneVolumeOverride-->>CriAtomExPlayer: value overridden for 1P
    else [controlId == 3 && p2 >= 0]
        HeadphoneVolumeOverride->>HeadphoneVolumeOverride: Mathf.Clamp(p2 / 20f, 0f, 1f)
        HeadphoneVolumeOverride-->>CriAtomExPlayer: value overridden for 2P
    else [other controlId or disabled]
        HeadphoneVolumeOverride-->>CriAtomExPlayer: value unchanged (user setting)
    end
    deactivate HeadphoneVolumeOverride
    CriAtomExPlayer-->>GameAudioSystem: SetAisacControl completes
    deactivate CriAtomExPlayer
Loading

File-Level Changes

Change Details Files
Add HeadphoneVolumeOverride mod class that patches headphone AISAC volume controls to optionally override user-configured volumes for 1P and 2P.
  • Define HeadphoneVolumeOverride static class under AquaMai.Mods.GameSystem with bilingual configuration section metadata describing behavior and value ranges.
  • Introduce two readonly config-backed float entries p1 and p2 for 1P and 2P headphone volume overrides, defaulting to -1 to indicate no override and documenting valid range 0–20.
  • Apply a HarmonyPrefix patch to CriAtomExPlayer.SetAisacControl(uint, float) that intercepts calls, checks controlId 2 (1P) and 3 (2P), and when the corresponding override value is non-negative, replaces the AISAC value with Mathf.Clamp(override/20f, 0f, 1f).
AquaMai.Mods/GameSystem/HeadphoneVolumeOverride.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - 我发现了 1 个问题,并且给出了一些总体反馈:

  • 将 magic controlId 值 2 和 3 替换为具名常量或枚举(例如 Headphone1ControlId/Headphone2ControlId)会更加清晰和安全,这样可以更好地说明它们的含义并避免被意外误用。
  • 配置字段名 p1 和 p2 有点不直观;可以考虑将它们重命名为类似 p1HeadphoneVolumeOverride/p2HeadphoneVolumeOverride 的名称,以更好地对应配置描述并提升可读性。
面向 AI 代理的提示
请根据本次代码评审中的评论进行修改:

## 总体评论
- 将 magic controlId 值 2 和 3 替换为具名常量或枚举(例如 Headphone1ControlId/Headphone2ControlId)会更加清晰和安全,这样可以更好地说明它们的含义并避免被意外误用。
- 配置字段名 p1 和 p2 有点不直观;可以考虑将它们重命名为类似 p1HeadphoneVolumeOverride/p2HeadphoneVolumeOverride 的名称,以更好地对应配置描述并提升可读性。

## 单独评论

### 评论 1
<location path="AquaMai.Mods/GameSystem/HeadphoneVolumeOverride.cs" line_range="30-34" />
<code_context>
+    [HarmonyPatch(typeof(CriAtomExPlayer), "SetAisacControl", [typeof(uint), typeof(float)])]
+    public static void PreSetAisacControl(uint controlId, ref float value)
+    {
+        if (controlId == 2 && p1 >= 0f)
+        {
+            value = Mathf.Clamp(p1 / 20f, 0f, 1f);
+        }
+        else if (controlId == 3 && p2 >= 0f)
+        {
+            value = Mathf.Clamp(p2 / 20f, 0f, 1f);
</code_context>
<issue_to_address>
**suggestion:** 考虑将魔法 AISAC 控制 ID 替换为具名常量或枚举。

直接使用像 `2``3` 这样的原始数值会掩盖它们的含义,并且让理解依赖于外部上下文。通过定义具名常量(例如 `const uint Headphone1ControlId = 2;`)或枚举,可以更清晰地表达意图,并帮助防止在其他地方错误地复用或修改这些 ID。

建议实现方式:

```csharp
    [ConfigEntry(
        name: "2P 音量覆盖",
        en: "2P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
        zh: "2P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
    private static readonly float p2 = -1f;

    private const uint Headphone1AisacControlId = 2;
    private const uint Headphone2AisacControlId = 3;

    [HarmonyPrefix]

```

```csharp
    public static void PreSetAisacControl(uint controlId, ref float value)
    {
        if (controlId == Headphone1AisacControlId && p1 >= 0f)
        {
            value = Mathf.Clamp(p1 / 20f, 0f, 1f);
        }
        else if (controlId == Headphone2AisacControlId && p2 >= 0f)
        {
            value = Mathf.Clamp(p2 / 20f, 0f, 1f);
        }
    }

```
</issue_to_address>

Sourcery 对开源项目免费使用——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据这些反馈来改进评审质量。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • The magic controlId values 2 and 3 would be clearer and safer if replaced with named constants or an enum (e.g., Headphone1ControlId/Headphone2ControlId) to document their meaning and avoid accidental misuse.
  • The config field names p1 and p2 are a bit opaque; consider renaming them to something like p1HeadphoneVolumeOverride/p2HeadphoneVolumeOverride to better match the config descriptions and improve readability.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The magic controlId values 2 and 3 would be clearer and safer if replaced with named constants or an enum (e.g., Headphone1ControlId/Headphone2ControlId) to document their meaning and avoid accidental misuse.
- The config field names p1 and p2 are a bit opaque; consider renaming them to something like p1HeadphoneVolumeOverride/p2HeadphoneVolumeOverride to better match the config descriptions and improve readability.

## Individual Comments

### Comment 1
<location path="AquaMai.Mods/GameSystem/HeadphoneVolumeOverride.cs" line_range="30-34" />
<code_context>
+    [HarmonyPatch(typeof(CriAtomExPlayer), "SetAisacControl", [typeof(uint), typeof(float)])]
+    public static void PreSetAisacControl(uint controlId, ref float value)
+    {
+        if (controlId == 2 && p1 >= 0f)
+        {
+            value = Mathf.Clamp(p1 / 20f, 0f, 1f);
+        }
+        else if (controlId == 3 && p2 >= 0f)
+        {
+            value = Mathf.Clamp(p2 / 20f, 0f, 1f);
</code_context>
<issue_to_address>
**suggestion:** Consider replacing magic AISAC control IDs with named constants or an enum.

Using raw values like `2` and `3` obscures their meaning and couples understanding to external context. Defining named constants (e.g., `const uint Headphone1ControlId = 2;`) or an enum will clarify intent and help prevent incorrect reuse or modification of these IDs elsewhere.

Suggested implementation:

```csharp
    [ConfigEntry(
        name: "2P 音量覆盖",
        en: "2P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
        zh: "2P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
    private static readonly float p2 = -1f;

    private const uint Headphone1AisacControlId = 2;
    private const uint Headphone2AisacControlId = 3;

    [HarmonyPrefix]

```

```csharp
    public static void PreSetAisacControl(uint controlId, ref float value)
    {
        if (controlId == Headphone1AisacControlId && p1 >= 0f)
        {
            value = Mathf.Clamp(p1 / 20f, 0f, 1f);
        }
        else if (controlId == Headphone2AisacControlId && p2 >= 0f)
        {
            value = Mathf.Clamp(p2 / 20f, 0f, 1f);
        }
    }

```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +30 to +34
if (controlId == 2 && p1 >= 0f)
{
value = Mathf.Clamp(p1 / 20f, 0f, 1f);
}
else if (controlId == 3 && p2 >= 0f)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: 考虑将魔法 AISAC 控制 ID 替换为具名常量或枚举。

直接使用像 23 这样的原始数值会掩盖它们的含义,并且让理解依赖于外部上下文。通过定义具名常量(例如 const uint Headphone1ControlId = 2;)或枚举,可以更清晰地表达意图,并帮助防止在其他地方错误地复用或修改这些 ID。

建议实现方式:

    [ConfigEntry(
        name: "2P 音量覆盖",
        en: "2P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
        zh: "2P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
    private static readonly float p2 = -1f;

    private const uint Headphone1AisacControlId = 2;
    private const uint Headphone2AisacControlId = 3;

    [HarmonyPrefix]
    public static void PreSetAisacControl(uint controlId, ref float value)
    {
        if (controlId == Headphone1AisacControlId && p1 >= 0f)
        {
            value = Mathf.Clamp(p1 / 20f, 0f, 1f);
        }
        else if (controlId == Headphone2AisacControlId && p2 >= 0f)
        {
            value = Mathf.Clamp(p2 / 20f, 0f, 1f);
        }
    }
Original comment in English

suggestion: Consider replacing magic AISAC control IDs with named constants or an enum.

Using raw values like 2 and 3 obscures their meaning and couples understanding to external context. Defining named constants (e.g., const uint Headphone1ControlId = 2;) or an enum will clarify intent and help prevent incorrect reuse or modification of these IDs elsewhere.

Suggested implementation:

    [ConfigEntry(
        name: "2P 音量覆盖",
        en: "2P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
        zh: "2P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
    private static readonly float p2 = -1f;

    private const uint Headphone1AisacControlId = 2;
    private const uint Headphone2AisacControlId = 3;

    [HarmonyPrefix]
    public static void PreSetAisacControl(uint controlId, ref float value)
    {
        if (controlId == Headphone1AisacControlId && p1 >= 0f)
        {
            value = Mathf.Clamp(p1 / 20f, 0f, 1f);
        }
        else if (controlId == Headphone2AisacControlId && p2 >= 0f)
        {
            value = Mathf.Clamp(p2 / 20f, 0f, 1f);
        }
    }

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the HeadphoneVolumeOverride class, which uses Harmony patches to override 1P and 2P headphone volumes to fixed values. The review feedback correctly points out that the config fields p1 and p2 should not be marked as readonly because they need to be modified by the config loader at runtime, and static readonly primitive fields can be inlined by the JIT compiler.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

name: "1P 音量覆盖",
en: "1P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
zh: "1P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
private static readonly float p1 = -1f;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since this field is intended to be modified by the config loader at runtime, it should not be marked as readonly. In some .NET runtimes or under certain JIT optimization levels, static readonly fields of primitive types can be inlined as constants by the JIT compiler, which would prevent any runtime config updates from taking effect. Removing readonly ensures correctness and avoids potential JIT inlining issues.

    private static float p1 = -1f;

name: "2P 音量覆盖",
en: "2P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
zh: "2P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
private static readonly float p2 = -1f;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since this field is intended to be modified by the config loader at runtime, it should not be marked as readonly. In some .NET runtimes or under certain JIT optimization levels, static readonly fields of primitive types can be inlined as constants by the JIT compiler, which would prevent any runtime config updates from taking effect. Removing readonly ensures correctness and avoids potential JIT inlining issues.

    private static float p2 = -1f;

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="AquaMai.Mods/GameSystem/HeadphoneVolumeOverride.cs">

<violation number="1" location="AquaMai.Mods/GameSystem/HeadphoneVolumeOverride.cs:30">
P3: Replace magic AISAC control IDs `2` and `3` with named constants (e.g., `const uint Headphone1AisacControlId = 2;`) to clarify their meaning and prevent accidental misuse.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

[HarmonyPatch(typeof(CriAtomExPlayer), "SetAisacControl", [typeof(uint), typeof(float)])]
public static void PreSetAisacControl(uint controlId, ref float value)
{
if (controlId == 2 && p1 >= 0f)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Replace magic AISAC control IDs 2 and 3 with named constants (e.g., const uint Headphone1AisacControlId = 2;) to clarify their meaning and prevent accidental misuse.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At AquaMai.Mods/GameSystem/HeadphoneVolumeOverride.cs, line 30:

<comment>Replace magic AISAC control IDs `2` and `3` with named constants (e.g., `const uint Headphone1AisacControlId = 2;`) to clarify their meaning and prevent accidental misuse.</comment>

<file context>
@@ -0,0 +1,39 @@
+    [HarmonyPatch(typeof(CriAtomExPlayer), "SetAisacControl", [typeof(uint), typeof(float)])]
+    public static void PreSetAisacControl(uint controlId, ref float value)
+    {
+        if (controlId == 2 && p1 >= 0f)
+        {
+            value = Mathf.Clamp(p1 / 20f, 0f, 1f);
</file context>

@3096

3096 commented Jun 22, 2026

Copy link
Copy Markdown
Author

要理ai吗

要的话我可以改成

using HarmonyLib;

using AquaMai.Config.Attributes;
using UnityEngine;

namespace AquaMai.Mods.GameSystem;

[ConfigSection(
    name: "耳机音量覆盖",
    en: "Override 1P/2P headphone volume to a fixed value, ignoring the user's in-game setting. Set to -1 to disable (use user setting). Range: 0–20.",
    zh: "将 1P/2P 耳机音量强制覆盖为固定值,忽略用户的游戏内设置。设为 -1 则禁用(使用用户设置)。范围:0–20。")]
public static class HeadphoneVolumeOverride
{
    [ConfigEntry(
        name: "1P 音量覆盖",
        en: "1P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
        zh: "1P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
    private static readonly float p1HeadphoneVolumeOverride = -1f;

    [ConfigEntry(
        name: "2P 音量覆盖",
        en: "2P headphone volume override. -1 = use user setting, 0–20 = fixed volume (20 is max).",
        zh: "2P 耳机音量覆盖值。-1 = 使用用户设置,0–20 = 固定音量(20 为最大值)。")]
    private static readonly float p2HeadphoneVolumeOverride = -1f;

    private const uint P1HeadphoneAisacControlId = 2;
    private const uint P2HeadphoneAisacControlId = 3;

    [HarmonyPrefix]
    [HarmonyPatch(typeof(CriAtomExPlayer), "SetAisacControl", [typeof(uint), typeof(float)])]
    public static void PreSetAisacControl(uint controlId, ref float value)
    {
        if (controlId == P1HeadphoneAisacControlId && p1HeadphoneVolumeOverride >= 0f)
        {
            value = Mathf.Clamp(p1HeadphoneVolumeOverride / 20f, 0f, 1f);
        }
        else if (controlId == P2HeadphoneAisacControlId && p2HeadphoneVolumeOverride >= 0f)
        {
            value = Mathf.Clamp(p2HeadphoneVolumeOverride / 20f, 0f, 1f);
        }
    }
}

不过我是照着已有的HeadphoneVolumeMultiply写的。已有的代码也没有这么做

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant