Open leohilbert opened 5 months ago
always execute it directly after a Level-, Project- or TilesetDefinition-Json is parsed
I haven't looked into the commit yet, but reading this, I'm concerned that this might create some additional performance overhead 😬 Though it's probably quite fine compared to other stuff
I also needed to add the AssetPath of the parsed Json, because I need it :|
I might look into making a new field to LDtkPreprocessor so it has an asset import context just like the postprocessor; that way we can avoid an additional parameter
I have a question: Could we have this merge request target a brand-new branch in your fork so I can test it out (and potentially make some minor tweaks) before merging?
I'm new to pull requests, I'm not 100% sure how to test something that is targeting the master branch without actually merging it in. Maybe there is an easier way for me to approach this, let me know 😅
Hi, thanks so much for looking into this! I don't know how often the Project/Tileset Def Jsons are parsed, but I don't think this one reflection call will take a lot of time. Doesn't hurt to check though of course!
I also never worked with pullrequests from an external fork into the main repository.
Normally its always just a branch within the same repo 😅 I think the easiest approach would be to add my repo as an additional origin in your (local) git project.
Via cli that would be git remote add leo https://github.com/leohilbert/LDtkToUnity.git
i think. In a Git GUI you can also just click "add remote" somewhere. If you are using the Github CLI there is also this command to "Checkout with GitHub CLI", but I don't know what it does haha gh pr checkout 55
Now you have your own origin and my origin (called leo) and can just checkout my master branch without switching the git project. Alternatively you can just clone my repo separately, but then everything is duplicated and you need to set up and additional Unity project etc etc.
I have Allow edits by maintainers
enabled, so I think you are allowed to commit and push on my branch as you please :)
Cool, I'll give these a try when I get around to it, thanks for helping 👍
Hi! Based on our conversation in discord, I spent some time adding a TilesetDefinition PreProcessor and integrating it into my project, to finally replace my custom PreProcessor that I needed to patch in after every update.
While integrating I noticed that the PreProcessors for Level & Project were not always invoked after reading the JSON. This resulted in my adjustments not being executed everywhere (e.g. in the JsonEditorCache). I think the easiest and safest bet is to just always execute it directly after a Level-, Project- or TilesetDefinition-Json is parsed. I also needed to add the AssetPath of the parsed Json, because I need it :|
Let me know what you think :)