更新说明

This commit is contained in:
2026-06-04 19:10:50 +08:00
parent 88ff0d1534
commit 7f6d0d5317
2 changed files with 31 additions and 0 deletions
+19
View File
@@ -170,6 +170,25 @@ SfxSystem manages: throttle (`ThrottleCount`), min interval (`MinInterval`), pri
- `HapticSystem.Instance.Stop(uint? hapticId = null)` — stops current haptic playback - `HapticSystem.Instance.Stop(uint? hapticId = null)` — stops current haptic playback
- Supports four `HapticType`s: `Preset`, `Emphasis`, `Constant`, `Advance` (`.haptic` file) - Supports four `HapticType`s: `Preset`, `Emphasis`, `Constant`, `Advance` (`.haptic` file)
#### Device capability & fallback
`HapticController.Play()` (`Lofelt/.../HapticController.cs:350`) uses a three-tier decision chain:
1. **Advanced device** (`DeviceCapabilities.meetsAdvancedRequirements`) → full `.haptic` playback via `LofeltHaptics`
2. **Gamepad** (`GamepadRumbler.CanPlay()`) → gamepad rumble
3. **Basic OS support** (`DeviceCapabilities.isVersionSupported`) → **always falls back to a Preset**
4. None of above → silent no-op
**Advance (`.haptic` file) fallback is Preset-only** — it never degrades to Emphasis or Constant. The fallback Preset is configured via `HapticObject.FallbackPreset` in the data table.
| HapticType | Advanced | Android basic | iOS basic |
|------------|----------|---------------|-----------|
| **Advance** | Full `.haptic` | → Preset | → Preset |
| **Emphasis** | JSON clip | 50ms max-amplitude pulse | → amplitude-mapped Preset |
| **Constant** | JSON clip with modulation | max-amplitude for `duration` | → hardcoded `HeavyImpact` |
Emphasis and Constant have their own internal fallback chains (template-based JSON clips on advanced, raw motor patterns or Presets on basic), but these are independent direct-invoke paths — they are never used as fallback targets for Advance.
--- ---
## Interactive Music System ## Interactive Music System
+12
View File
@@ -72,6 +72,18 @@ AudioSystem.Instance.SetState(MyCustomEnum.SomeState); // 需先通过 StateGro
- 游戏启动时的首次状态设置**必须放在 `Start` 内**,晚一点可以,早了容易出问题。 - 游戏启动时的首次状态设置**必须放在 `Start` 内**,晚一点可以,早了容易出问题。
- 若需在其他位置进行首次初始化,请注释掉 `AudioSystem.Start()` 中的相关代码。 - 若需在其他位置进行首次初始化,请注释掉 `AudioSystem.Start()` 中的相关代码。
### 开关
```csharp
AudioSystem.Instance.SetMusicVolume(float tatgetVolume) //设置音乐音量 -800
AudioSystem.Instance.SetSFXVolume(float tatgetVolume) //设置音效音量 -800
AudioSystem.Instance.SetMusicState(bool enable) // 启用/禁用音乐
AudioSystem.Instance.SetSFXState(bool enable) // 启用/禁用音效
HapticSytem.Instance.EnableHaptic(bool enable) // 启用/禁用触感系统
```
### Inspector 参数 ### Inspector 参数
| 字段 | 说明 | | 字段 | 说明 |