rabidus-test/Assets/PathCreator/Examples/Scripts/PathSceneTool.cs

32 lines
663 B
C#
Raw Normal View History

2023-07-24 16:38:13 +03:00
using UnityEngine;
namespace PathCreation.Examples
{
[ExecuteInEditMode]
public abstract class PathSceneTool : MonoBehaviour
{
public event System.Action onDestroyed;
public PathCreator pathCreator;
public bool autoUpdate = true;
protected VertexPath path {
get {
return pathCreator.path;
}
}
public void TriggerUpdate() {
PathUpdated();
}
protected virtual void OnDestroy() {
if (onDestroyed != null) {
onDestroyed();
}
}
protected abstract void PathUpdated();
}
}