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

29 lines
748 B
C#
Raw Normal View History

2023-11-03 14:46:27 +08:00
using System.Collections.Generic;
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-03 14:46:27 +08:00
public bool Check(List<float> args)
2023-11-01 13:33:20 +08:00
{
2023-11-03 14:46:27 +08:00
var id = (int)args[0];
var star = (int)args[1];
2023-11-01 13:33:20 +08:00
var levelInfo = LevelManager.Instance.GetLevelInfoByID(id);
return levelInfo != null && levelInfo.StarCount >= star;
}
2024-04-15 17:59:58 +08:00
public string[] GetArgLocalizations(List<float> args)
{
int id = (int)args[0];
int star = (int)args[1];
return new string[2] { id.ToString(), star.ToString() };
}
2023-11-01 13:33:20 +08:00
}