Repository navigation
Use class database MonoBehaviour header for TypeTreeGenerator nodes - #403
Open
1915rising wants to merge 1 commit into
Open
1915rising wants to merge 1 commit into
1915rising wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #388.
When a MonoBehaviour has no typetree and
env.typetree_generatoris set, the node returned by TypeTreeGeneratorAPI uses a fixed header that puts the align flag onm_GameObject,m_Scriptandm_Name, instead of only afterm_Enabledas Unity and the class database do.m_Scriptis therefore read 3 bytes early (the issue's example reads PathID0x4455667788000000instead of0x1122334455667788) and is written back changed on save.This replaces the generated node's fields up to and including
m_Namewith the class-database header ingenerate_monobehaviour_node, leaving the generated script fields untouched. If either node has nom_Namefield, the generated node is returned unchanged.Tests: new
tests/test_monobehaviour_node.py(2 tests) reproduces the issue's read/save round-trip — both fail on unpatched code and pass with the fix. Full suite: 44 passed / 4 failed before, 46 passed / 4 failed after; the 4 failures are pre-existing Git-LFS sample-data failures, identical before and after.AI-assisted; the fix was reproduced and tested locally before submission.