Hi everyone!
I’m currently developing basic waypoint navigation in unity. I want to use editor to manage waypoints connections, positions, etc…
I create Waypoint in this way:
[CustomEditor( typeof(Waypoint) )]
public class WaypointEditor : Editor
{
[MenuItem("GameObject/Create Waypoint")]
public static void CreateWaypoint()
{
GameObject obj = new GameObject();
obj.AddComponent("Waypoint");
obj.name = "Waypoint " + (PatchFinder.getID());
// set position...
}
}
I want to be able to delete waypoints using EditorView tools (rightclick->delete or “del” key) or by Inspector button. I have to override some delete/destroy method to clear waypoints connections and remove waypoint from PathFinder list. I’ve tried OnDestroy() but it works only in GamePlay mode.
Thanks