NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Condition/Conditions/ConditionLevelStar.cs

20 lines
526 B
C#
Raw Normal View History

2023-11-01 13:33:20 +08:00
using Framework;
using Gameplay.Level;
using Framework.Condition;
/// <summary>
/// 关卡星级是否满足
/// </summary>
public class ConditionLevelStar : ICondition
{
public EventManager.EventName SignalName => EventManager.EventName.LevelInfoChanged;
2023-11-01 15:03:24 +08:00
public bool Check(cfg.DataCondition cfgData)
2023-11-01 13:33:20 +08:00
{
var id = cfgData.Param1;
var star = cfgData.Param2;
var levelInfo = LevelManager.Instance.GetLevelInfoByID(id);
return levelInfo != null && levelInfo.StarCount >= star;
}
}