BD Pro bug – variables are bugged after namespace change

Deadcow

Member
I did some refactoring and changed the namespace of the type I use for variables. It was Gameplay.Abilities.TargetProvider and I changed it to Gameplay.AI.TargetProvider. Unfortunately after some time I noticed that it broke the variable references. I see the space reserved for them in the variable list as separate lines and able to drag and reorder the lines.
For some reason, revert of the namespace change did not helped to fix this issue and I had to revert Subtree asset changes.

1758106602713.png


Another issue I noticed is with changing of the base class is that the references of the variables was lost. I changed "TargetProvider : MonoBehaviour" to "TargetProvider : TargetProviderBase : MonoBehaviour" and all the vars of TargetProvider type in existing prefabs with Subtree asset was nulled.

I assume those issues are not easy to fix, but I guess you should know about them. Some conversion tool would be nice to have, or a way to reassign the variable type if it is not found in codebase 🤔
 
Interesting discovery in addition to the first issue.
I was able to "Change Type" of the variable (though it's a bit hard to click to get the context menu. it's, like, 1px in height 😁)
The variable reappeared, but it's name is messed up and when I reselect the object it is back to bugged

1758108201204.png
 
For namespace changes you should use the [MovedFrom("new.namespace")] attribute. This will ensure the new type is picked up correctly. With that said, the UI could be improved so it shows the unknown variable type and allow for you to change type.
 
Back
Top