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

28 lines
791 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.Net;
using Framework.Condition;
/// <summary>
/// 是否拥有某个角色
/// </summary>
public class ConditionCharacter : ICondition
{
public EventManager.EventName SignalName => EventManager.EventName.GetNewCharacter;
2023-11-03 14:46:27 +08:00
public bool Check(List<float> args)
2023-11-01 13:33:20 +08:00
{
2024-10-11 16:51:50 +08:00
if (args.Count < 1)
2024-10-12 12:46:58 +08:00
throw new ConditionException($"{nameof(ConditionCharacter)}条件(是否拥有某个角色)需要1个参数当前只有{args.Count}个参数参数1角色id");
2023-11-01 13:33:20 +08:00
2024-10-12 12:46:58 +08:00
CharacterDataInfo character = CharacterDataInfoManager.Instance.GetCharacterInfo((uint)args[0]);
2024-10-11 16:51:50 +08:00
2023-11-01 13:33:20 +08:00
return character != null;
}
2024-04-15 17:59:58 +08:00
public string[] GetArgLocalizations(List<float> args)
{
return null;
}
2023-11-01 13:33:20 +08:00
}