v10 全量评审:修复 TD-06 至 TD-12(InputReader 移除资产扫描回退 / EmergencySave 解除 LocalFileStorage 直接依赖 / AccessibilityManager 注册 IAccessibilityService / HUDController HP/SpringIcon SetActive 复用 / MovingPlatform 缓存 WaitForSeconds / RewardSO IRewardTarget 解耦 Quest←Player 依赖 / CrashReporter 频率限制崩溃日志)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using UnityEngine;
|
||||
using BaseGames.Player;
|
||||
using BaseGames.Core.Events;
|
||||
|
||||
namespace BaseGames.Quest
|
||||
@@ -20,20 +19,24 @@ namespace BaseGames.Quest
|
||||
|
||||
[Tooltip("是否解锁能力(AbilityType 无 None 值,用 bool 标识)")]
|
||||
public bool unlocksAbility; // ⚠️ AbilityType 无 None,用 bool 标识
|
||||
public AbilityType unlockedAbility; // 仅当 unlocksAbility == true 有效
|
||||
public uint unlockedAbilityFlag; // AbilityType 的 uint 位掩码值(仅当 unlocksAbility == true 有效)
|
||||
|
||||
[Header("物品发放事件")]
|
||||
[Tooltip("EVT_CollectiblePickup:向 QuestManager/EquipmentManager 广播 itemId")]
|
||||
[SerializeField] private StringEventChannelSO _onCollectiblePickup;
|
||||
|
||||
/// <summary>将奖励应用到游戏状态(由 QuestManager.CompleteQuest 调用)。</summary>
|
||||
public void Apply(PlayerStats player)
|
||||
/// <summary>
|
||||
/// 将奖励应用到游戏状态(由 QuestManager.CompleteQuest 调用)。
|
||||
/// 通过 <see cref="IRewardTarget"/> 接口操作,避免直接依赖 BaseGames.Player 程序集。
|
||||
/// </summary>
|
||||
public void Apply(IRewardTarget target)
|
||||
{
|
||||
if (player == null) return;
|
||||
if (target == null) return;
|
||||
|
||||
if (geo > 0) player.AddGeo(geo);
|
||||
if (soulBonus > 0) player.AddSoulPower(soulBonus);
|
||||
if (unlocksAbility) player.UnlockAbility(unlockedAbility);
|
||||
if (geo > 0) target.AddGeo(geo);
|
||||
if (soulBonus > 0) target.AddSoulPower(soulBonus);
|
||||
if (unlocksAbility && unlockedAbilityFlag != 0)
|
||||
target.UnlockAbilityFlag(unlockedAbilityFlag);
|
||||
|
||||
// 通过 EVT_CollectiblePickup 事件频道广播每个物品 ID
|
||||
if (itemIds != null && _onCollectiblePickup != null)
|
||||
|
||||
Reference in New Issue
Block a user