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

30 lines
672 B
C#

using System.Collections.Generic;
using Framework;
using Gameplay.Level;
using Framework.Condition;
/// <summary>
/// 关卡是否通关
/// </summary>
public class ConditionLevelPass : ICondition
{
public EventManager.EventName SignalName => EventManager.EventName.LevelInfoChanged;
public bool Check(List<float> args)
{
int id = (int)args[0];
if (!LevelManager.Instance.TryGetLevelInfoByID(id, out LevelInfo levelInfo))
return false;
return levelInfo.IsPass;
}
public string[] GetArgLocalizations(List<float> args)
{
int id = (int)args[0];
return new string[1] { id.ToString() };
}
}