using UnityEngine; public class LeaveTheQueue : PrimitiveTask { // ================== TASK ACTION ================== public override void Execute(HTNPlanner planner) { Customer customer = planner.Agent as Customer; PaymentArea paymentArea = planner.WorldState.Get<PaymentArea>("PaymentArea"); if (customer != null && paymentArea != null) { paymentArea.LeaveQueue(customer); hasRun = true; } else { Debug.LogError("The Agent is not a Customer!"); } } }