Function GridGraphRules.AddMainThreadPass
AddMainThreadPass
(GridGraphRule.Pass pass, System.Action<Context> action)
Adds a pass callback that runs in the main thread.
Public
void AddMainThreadPass (
pass | ||
System.Action<Context> | action |
Adds a pass callback that runs in the main thread.
The callback may access and modify any data in the context. You do not need to schedule jobs in order to access the data.
Warning
Not all data in the Context is valid for every pass. For example you cannot access node connections in the BeforeConnections pass since they haven't been calculated yet.
This is a bit slower than AddJobSystemPass since parallelism and the burst compiler cannot be used. But if you need to use non-thread-safe APIs or data then this is a good choice.
This method should only be called from rules in their Register method.