多轮审查和修复
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using BaseGames.Core.Save;
|
||||
|
||||
namespace BaseGames.Progression
|
||||
{
|
||||
/// <summary>
|
||||
/// 由事件触发的成就条件(使用 World.Switches 中的布尔标志位)。
|
||||
/// 由代码(如剧情节点、NPC 交互)写入标志,AchievementManager 轮询检查。
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Achievement/Condition/EventTriggered", fileName = "COND_EventTriggered_")]
|
||||
public class EventTriggeredCondition : AchievementCondition
|
||||
{
|
||||
[Tooltip("World.Switches 中用于标记此事件发生的布尔 Key")]
|
||||
public string flagKey;
|
||||
|
||||
public override bool IsMet(SaveData save)
|
||||
{
|
||||
if (save?.World?.Switches == null || string.IsNullOrEmpty(flagKey)) return false;
|
||||
return save.World.Switches.TryGetValue(flagKey, out bool val) && val;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user