Files
zeling_v2/Assets/_Game/Scripts/Progression/AchievementCondition.cs

19 lines
730 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
using BaseGames.Core.Save;
namespace BaseGames.Progression
{
/// <summary>
/// 成就触发条件基类(架构 16_SupportingModules §2.3)。
/// 每个子类对应一种具体触发逻辑,由 AchievementManager 驱动轮询或事件检查。
/// </summary>
public abstract class AchievementCondition : ScriptableObject
{
/// <summary>检查条件是否在当前存档数据中已满足。</summary>
public abstract bool IsMet(SaveData save);
/// <summary>获取当前进度0-1用于成就 UI 进度条显示。返回 -1 表示不支持进度。</summary>
public virtual float GetProgress(SaveData save) => IsMet(save) ? 1f : 0f;
}
}