Skip to content

feat: 新增 ModelSoundStopTrigger 组件用于停止音效播放#19

Merged
BAKAOLC merged 1 commit into
mainfrom
develop
Nov 22, 2025
Merged

feat: 新增 ModelSoundStopTrigger 组件用于停止音效播放#19
BAKAOLC merged 1 commit into
mainfrom
develop

Conversation

@BAKAOLC
Copy link
Copy Markdown
Collaborator

@BAKAOLC BAKAOLC commented Nov 22, 2025

功能说明

  • 新增 ModelSoundStopTrigger 组件,支持在动画状态机中停止音效播放
    • 支持停止指定事件名称的音效
    • 支持停止所有正在播放的音效
    • 支持使用内置事件名称(如 idle)或自定义触发器事件名称
    • 支持在状态进入或退出时触发停止操作
    • 提供 Unity 编辑器自定义界面,包含条件显示、警告提示和帮助信息

相关文件

  • DuckovCustomModel.Core/MonoBehaviours/Animators/ModelSoundStopTrigger.cs
  • DuckovCustomModel/MonoBehaviours/ModelHandler.cs
  • DuckovCustomModel-SDK/Editor/Components/ModelSoundStopTriggerEditor.cs

版本更新

  • 版本号更新至 v1.8.9

- 新增 `ModelSoundStopTrigger` 组件,支持在动画状态机中停止音效播放
- 支持通过指定事件名称停止音效或停止所有正在播放的音效
- 提供 Unity 编辑器自定义界面,包含条件显示和警告提示
- 更新文档以反映新功能和使用说明
- 更新版本号至 v1.8.9
Copilot AI review requested due to automatic review settings November 22, 2025 11:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new ModelSoundStopTrigger component to provide sound stopping capabilities in animation state machines, complementing the existing ModelSoundTrigger component. The implementation refactors the event naming system to consistently use the CustomModelSoundTrigger:{eventName} format for custom triggers while allowing built-in event names (like idle) to be used directly.

Key Changes

  • New ModelSoundStopTrigger component with flexible stopping options (all sounds vs. specific events, built-in vs. custom event names, enter vs. exit timing)
  • Refactored event name handling in ModelSoundTrigger to explicitly construct the prefixed format
  • Integrated the new trigger into ModelHandler with proper event subscription/unsubscription

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
DuckovCustomModel.Core/MonoBehaviours/Animators/ModelSoundStopTrigger.cs New component implementing sound stop functionality with support for multiple stop modes and event name formats
DuckovCustomModel.Core/MonoBehaviours/Animators/ModelSoundTrigger.cs Refactored event name construction to explicitly build the CustomModelSoundTrigger:{eventName} format
DuckovCustomModel/MonoBehaviours/ModelHandler.cs Added event subscription/unsubscription and handler for the new stop trigger
DuckovCustomModel/Constant.cs Version bump to 1.8.9
README.md, README_EN.md Documentation for the new component with usage examples and notes
CHANGELOG.md, CHANGELOG_EN.md Release notes for v1.8.9 describing the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread DuckovCustomModel/MonoBehaviours/ModelHandler.cs
@BAKAOLC BAKAOLC merged commit 80b4c76 into main Nov 22, 2025
7 checks passed
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.

2 participants