更新说明
This commit is contained in:
@@ -170,6 +170,25 @@ SfxSystem manages: throttle (`ThrottleCount`), min interval (`MinInterval`), pri
|
||||
- `HapticSystem.Instance.Stop(uint? hapticId = null)` — stops current haptic playback
|
||||
- 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
|
||||
|
||||
@@ -72,6 +72,18 @@ AudioSystem.Instance.SetState(MyCustomEnum.SomeState); // 需先通过 StateGro
|
||||
- 游戏启动时的首次状态设置**必须放在 `Start` 内**,晚一点可以,早了容易出问题。
|
||||
- 若需在其他位置进行首次初始化,请注释掉 `AudioSystem.Start()` 中的相关代码。
|
||||
|
||||
### 开关
|
||||
|
||||
```csharp
|
||||
AudioSystem.Instance.SetMusicVolume(float tatgetVolume) //设置音乐音量 (-80~0)
|
||||
AudioSystem.Instance.SetSFXVolume(float tatgetVolume) //设置音效音量 (-80~0)
|
||||
|
||||
AudioSystem.Instance.SetMusicState(bool enable) // 启用/禁用音乐
|
||||
AudioSystem.Instance.SetSFXState(bool enable) // 启用/禁用音效
|
||||
|
||||
HapticSytem.Instance.EnableHaptic(bool enable) // 启用/禁用触感系统
|
||||
```
|
||||
|
||||
### Inspector 参数
|
||||
|
||||
| 字段 | 说明 |
|
||||
|
||||
Reference in New Issue
Block a user