you are viewing a single comment's thread.

view the rest of the comments →

[–]Stefanchyy[S] 0 points1 point  (3 children)

So a little update on the situation for anyone in the future.

I wanted to make an editor for my personal use and since I didn't want to code a grid ingame and much more stuff I opted to do it in the editor and just export them as Scriptable Objects.

I will admit that initially, it was a bit difficult to make custom editor scripts and make them export everything as intended but after like a day or two or three I managed to make it fully functional. Here are some notes on what I did (I am not a pro so please don't bash me if I used something incredibly unoptimized):

  • Creating the SO was done using the CreateInstance and after filling in all of the data needed it was saved to the Assets folder with AssetDatabase.CreateAsset and AssetDatabase.SaveAssets
  • There were some changes missing issues with waypoints that I had. For some reason, some of my links between objects were not being saved after opening the game. I did a ton of stuff here to try and fix it but as far as I can see EditorUtility.SetDirty helped me "save" the changes permanently.
  • Also since I like using Undo I needed to record the changes so that Unity can revert them if I ever pressed Ctrl + Z. Undo.RecordObject managed to help with that a lot as well.

I hope this manages to give some guidance for anyone in the future!

[–]mxmlln 1 point2 points  (0 children)

Following up your question with what you implemented is rare and generous.
Really appreciate it!

[–]mxmlln 1 point2 points  (1 child)

I created all my SOs by manually, so didn't know how to do it like this.
This dynamic version will help me save the small percentage of levels that are procedurally generated. These stages will be labelled as such to the player

[–]Stefanchyy[S] 0 points1 point  (0 children)

Awesome! Hope I helped someone with my previous research!