Fix navmesh update on some spline editing operations
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEditor.Actions;
|
||||
using FlaxEditor.SceneGraph.Actors;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
@@ -40,6 +41,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
spline.SetTangentsLinear();
|
||||
if (enableUndo)
|
||||
Presenter.Undo.AddAction(new EditSplineAction(spline, before));
|
||||
SplineNode.OnSplineEdited(spline);
|
||||
Editor.Instance.Scene.MarkSceneEdited(spline.Scene);
|
||||
}
|
||||
}
|
||||
@@ -56,6 +58,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
spline.SetTangentsSmooth();
|
||||
if (enableUndo)
|
||||
Presenter.Undo.AddAction(new EditSplineAction(spline, before));
|
||||
SplineNode.OnSplineEdited(spline);
|
||||
Editor.Instance.Scene.MarkSceneEdited(spline.Scene);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace FlaxEditor.SceneGraph.Actors
|
||||
Editor.Instance.SceneEditing.Spawn(actor, Actor);
|
||||
}
|
||||
|
||||
private static void OnSplineEdited(Spline spline)
|
||||
internal static void OnSplineEdited(Spline spline)
|
||||
{
|
||||
var collider = spline.GetChild<SplineCollider>();
|
||||
if (collider && collider.Scene && collider.IsActiveInHierarchy && collider.HasStaticFlag(StaticFlags.Navigation) && !Editor.IsPlayMode)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using FlaxEditor.Modules;
|
||||
using FlaxEditor.SceneGraph.Actors;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace FlaxEditor.Actions
|
||||
@@ -45,6 +46,7 @@ namespace FlaxEditor.Actions
|
||||
if (spline == null)
|
||||
return;
|
||||
spline.SplineKeyframes = _after;
|
||||
SplineNode.OnSplineEdited(spline);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -54,6 +56,7 @@ namespace FlaxEditor.Actions
|
||||
if (spline == null)
|
||||
return;
|
||||
spline.SplineKeyframes = _before;
|
||||
SplineNode.OnSplineEdited(spline);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user