revival/game/Assets/PathCreator/Examples/Scripts/PathSceneTool.cs

32 lines
663 B
C#
Raw Normal View History

2021-03-12 15:33:05 +01: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();
}
}