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

28 lines
791 B
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.Collections.Generic;
using Framework;
using Gameplay.Net;
using Framework.Condition;
/// <summary>
/// 是否拥有某个角色
/// </summary>
public class ConditionCharacter : ICondition
{
public EventManager.EventName SignalName => EventManager.EventName.GetNewCharacter;
public bool Check(List<float> args)
{
if (args.Count < 1)
throw new ConditionException($"{nameof(ConditionCharacter)}条件(是否拥有某个角色)需要1个参数当前只有{args.Count}个参数参数1角色id");
CharacterDataInfo character = CharacterDataInfoManager.Instance.GetCharacterInfo((uint)args[0]);
return character != null;
}
public string[] GetArgLocalizations(List<float> args)
{
return null;
}
}