提取RVO 寻路

This commit is contained in:
PC-20230316NUNE\Administrator
2024-02-05 18:56:55 +08:00
parent 04043cc6fc
commit 16d943ab6b
208 changed files with 42246 additions and 37182 deletions

View File

@@ -69,7 +69,9 @@ namespace Pathfinding {
[HideInInspector]
public int graphIndex;
void Start () {
public override void OnSyncStart()
{
base.OnSyncStart();
if (AstarPath.active == null) throw new System.Exception("There is no AstarPath object in the scene");
// If one creates this component via a script then they may have already set the graph field.
@@ -84,9 +86,11 @@ namespace Pathfinding {
UpdateGraph();
}
/// <summary>Update is called once per frame</summary>
void Update () {
public override void OnSyncUpdate(int dt, JNFrameInfo frame, Object input)
{
base.OnSyncUpdate(dt, frame, input);
if (graph == null) return;
// Calculate where the graph center and the target position is in graph space