In the docs I explain how you can derived from
MapNavNode when you need to create nodes that hold custom data but there is also another way and a way which you might want to use if you are working with bigger maps.
I found for example that a map of 128x128 tiles can result in scene files of over 2Mb and there is a small delay when you save. This is because of the
MapNavNode deriving from
This change will require that all your custom node data (properties/ fields) be defined in the
MapNavNode class since any class derived from it will fail to serialise its data.
For the first change, open the
MapNavNode.cs and change it from
public class MapNavNode : ScriptableObject
public class MapNavNode
If you derived any node class from MapNavNode you need to move the fields and properties into MapNavNode now and delete that script. It will fail.
You will see some errors in the
CreateGrid() functions of the various Map classes like
Go to those lines that throw errors and you should see they look like this
grid[idx] = ScriptableObject.CreateInstance<T>();
grid[idx] = (MapNavNode)ScriptableObject.CreateInstance(nodeType);
Simply change both cases to
grid[idx] = new MapNavNode();
That is all there is to it. You will now have smaller scenes and it should save faster when you save a scene in the editor.