IndieGame/client/Assets/Scripts/System/Condition/ConditionSystem.cs

39 lines
1.1 KiB
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00

using System.Collections;
using System.Collections.Generic;
using TableConfig;
using UnityEngine;
namespace Ether
{
public class ConditionSystem : Singleton<ConditionSystem>
{
public bool GetConditionState(int id)
{
ConditionTable conditionTable = TableProvider.Tables.TbCondition[id];
if (conditionTable == null)
{
return false;
}
switch (conditionTable.Type)
{
case ConditionType.ReceiveTask:
TaskState state = TaskSystem.Inst.GetTaskState(conditionTable.TaskId);
return state == TaskState.Received;
case ConditionType.SuccessTask:
TaskState taskState = TaskSystem.Inst.GetTaskState(conditionTable.TaskId);
return taskState == TaskState.Success;
case ConditionType.HaveProp:
//TODO:获取背包物品判断
break;
default:
break;
}
return true;
}
}
}