From 0bfeadfc1e5435c07d32772a184b4b8101116108 Mon Sep 17 00:00:00 2001 From: HalfLobsterMan <766439226@qq.com> Date: Sat, 18 Dec 2021 15:42:38 +0800 Subject: [PATCH] update --- Runtime/Scripts/GOAPGraph.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Runtime/Scripts/GOAPGraph.cs b/Runtime/Scripts/GOAPGraph.cs index 231ff17..e7c912f 100644 --- a/Runtime/Scripts/GOAPGraph.cs +++ b/Runtime/Scripts/GOAPGraph.cs @@ -38,10 +38,12 @@ public override void Initialize(IGraphOwner _graphOwner) if (node.Value is GOAPAction action) AvailableActions.Add(action); } - AvailableActions.QuickSort((a, center) => + AvailableActions.QuickSort((a, b) => { - if (a.Position.y > center.Position.y) + if (a.Position.y > b.Position.y) return 1; + if (a.Position.y == b.Position.y) + return 0; return -1; }); foreach (var action in AvailableActions)