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

28 lines
821 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/UnlockLevelPass.cs
// 作者Xoen Xie
// 时间2023/08/21
// 描述:解锁条件 - 关卡是否通关
// 说明:
//
//////////////////////////////////////////////////////////////////////////
namespace Gameplay.Net
{
public class UnlockLevelPass : IUnlock
{
public uint Check(cfg.ActorCfg.DataUnlock cfgData)
{
uint id = UnlockManager.GetUnlockParam(cfgData, cfg.ActorCfg.UnlockParam.LevelID);
var isPassed = Actor.Instance.Level.IsLevelPassed(id);
if (!isPassed)
{
return (uint)NLDPB.OpResult.LevelNotPassed;
}
return (uint)NLDPB.OpResult.Ok;
}
}
}