From 8722a9920c1f6119bf6e769cba270e63097f8e25 Mon Sep 17 00:00:00 2001
From: chai <215380520@qq.com>
Date: Thu, 23 May 2024 10:08:29 +0800
Subject: + astar project
---
.../Utilities/BatchedEvents.cs | 243 +++++++++++++++++++++
1 file changed, 243 insertions(+)
create mode 100644 Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Utilities/BatchedEvents.cs
(limited to 'Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Utilities/BatchedEvents.cs')
diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Utilities/BatchedEvents.cs b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Utilities/BatchedEvents.cs
new file mode 100644
index 0000000..f8a0a7e
--- /dev/null
+++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Utilities/BatchedEvents.cs
@@ -0,0 +1,243 @@
+using Unity.Mathematics;
+using UnityEngine;
+using UnityEngine.Jobs;
+using UnityEngine.Profiling;
+
+namespace Pathfinding.Util {
+ /// Helper for batching updates to many objects efficiently
+ [HelpURL("https://arongranberg.com/astar/documentation/stable/batchedevents.html")]
+ public class BatchedEvents : VersionedMonoBehaviour {
+ const int ArchetypeOffset = 22;
+ const int ArchetypeMask = 0xFF << ArchetypeOffset;
+
+ static Archetype[] data = new Archetype[0];
+ static BatchedEvents instance;
+ static int isIteratingOverTypeIndex = -1;
+ static bool isIterating = false;
+
+ [System.Flags]
+ public enum Event {
+ Update = 1 << 0,
+ LateUpdate = 1 << 1,
+ FixedUpdate = 1 << 2,
+ Custom = 1 << 3,
+ None = 0,
+ };
+
+
+ struct Archetype {
+ public object[] objects;
+ public int objectCount;
+ public System.Type type;
+ public TransformAccessArray transforms;
+ public int variant;
+ public int archetypeIndex;
+ public Event events;
+ public System.Action