using System.Text; using Schema; using UnityEngine; using VOID.Generic.Objects.Unit; namespace VOID.Generic.AI.Schema.Conditionals { [DarkIcon("Conditionals/d_IsNull")] [LightIcon("Conditionals/IsNull")] [Category(SchemaCategory.ThisUnit)] public class IsPatrolDefined : Conditional { public override bool Evaluate(object nodeMemory, SchemaAgent agent) { return (agent as UnitObjectSchemaAgent)?.unitAI.patrol.Count > 1; } public override GUIContent GetConditionalContent() { var sb = new StringBuilder(); if (invert) sb.Append("NOT "); sb.Append($"{nameof(UnitObjectSenses)} has at least two patrol points"); return new GUIContent(sb.ToString()); } } }