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