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 IsUnitObjectSchema : Conditional { public override bool Evaluate(object nodeMemory, SchemaAgent agent) { return agent is UnitObjectSchemaAgent unitAgent && unitAgent.unit; } public override GUIContent GetConditionalContent() { var sb = new StringBuilder(); if (invert) sb.Append("NOT "); sb.Append($"If this is {nameof(UnitObject)}'s schema"); return new GUIContent(sb.ToString()); } } }