IndieGame/client/Assets/Scripts/ThridParty/NodeCanvasExtension/ConditionTask/CheckDialogueState.cs

53 lines
1.2 KiB
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
using Sirenix.OdinInspector;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ether
{
[Category("✫ 扩展条件")]
public class CheckDialogueState : ConditionTask
{
[LabelText("条件Id")]
public List<int> conditionList = new List<int>();
protected override string info
{
get
{
string str = "检查条件({0})是否符合";
string joinStr = string.Join(",", conditionList);
if (string.IsNullOrEmpty(joinStr))
{
joinStr = "无";
}
str = string.Format(str, joinStr);
return str;
}
}
protected override bool OnCheck()
{
bool state = true;
foreach (int condition in conditionList)
{
if (!ConditionSystem.Inst.GetConditionState(condition))
{
state = false;
break;
}
}
return state;
}
}
}