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

29 lines
955 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/UnlockLevelStar.cs
// 作者Xoen Xie
// 时间2023/08/21
// 描述:解锁条件 - 关卡获得星数量
// 说明:
//
//////////////////////////////////////////////////////////////////////////
namespace Gameplay.Net
{
public class UnlockLevelStar : IUnlock
{
public uint Check(cfg.ActorCfg.DataUnlock cfgData)
{
uint id = UnlockManager.GetUnlockParam(cfgData, cfg.ActorCfg.UnlockParam.LevelID);
uint star = UnlockManager.GetUnlockParam(cfgData, cfg.ActorCfg.UnlockParam.LevelStar);
var info = Actor.Instance.Level.GetLevelInfo(id);
if (info == null || info.star < star)
{
return (uint)NLDPB.OpResult.LevelStarInvalid;
}
return (uint)NLDPB.OpResult.Ok;
}
}
}