29 lines
748 B
C#
29 lines
748 B
C#
using System.Collections.Generic;
|
|
using Framework;
|
|
using Gameplay.Level;
|
|
using Framework.Condition;
|
|
|
|
/// <summary>
|
|
/// 关卡星级是否满足
|
|
/// </summary>
|
|
public class ConditionLevelStar : ICondition
|
|
{
|
|
public EventManager.EventName SignalName => EventManager.EventName.LevelInfoChanged;
|
|
|
|
public bool Check(List<float> args)
|
|
{
|
|
var id = (int)args[0];
|
|
var star = (int)args[1];
|
|
|
|
var levelInfo = LevelManager.Instance.GetLevelInfoByID(id);
|
|
return levelInfo != null && levelInfo.StarCount >= star;
|
|
}
|
|
|
|
public string[] GetArgLocalizations(List<float> args)
|
|
{
|
|
int id = (int)args[0];
|
|
int star = (int)args[1];
|
|
|
|
return new string[2] { id.ToString(), star.ToString() };
|
|
}
|
|
} |