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

27 lines
833 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.

//////////////////////////////////////////////////////////////////////////
//
// 文件Assets/Code/Scripts/Gameplay/Net/Actor/Unlock/UnlockCharacter.cs
// 作者Xoen Xie
// 时间2023/08/21
// 描述:解锁条件 - 是否拥有某个角色
// 说明:
//
//////////////////////////////////////////////////////////////////////////
namespace Gameplay.Net
{
public class UnlockCharacter : IUnlock
{
public uint Check(cfg.ActorCfg.DataUnlock cfgData)
{
uint id = UnlockManager.GetUnlockParam(cfgData, cfg.ActorCfg.UnlockParam.CharacterID);
var character = Actor.Instance.Character.GetCharacter(id);
if(character == null) {
return (uint)NLDPB.OpResult.CharacterNotExist;
}
return (uint)NLDPB.OpResult.Ok;
}
}
}