Search Issue Tracker
By Design
Votes
0
Found in [Package]
1.0.0-preview.14
Issue ID
1334063
Regression
No
UXML files does not trigger OnOpenAssetAttribute callback
Reproduction steps:
1. Open attached project "Test_UXMLOnOpen.zip"
2. In Project window, open (double-click) any UXML file located in UI Builder folder's subfolders
3. Open the same file again
Expected result: The OnOpenAssetAttribute is triggered both times
Actual result: The OnOpenAssetAttribute is only triggered after the second time
Reproducible with: 1.0.0-preview.14 (2019.4.25f1, 2020.3.8f1, 2021.1.6f1)
Could not test with: 2018.4.34f1 (UI Builder package unavailable), 2021.2.0a16 (UI Builder errors)
Note:
In 2021.1.6f1, the callback isn't triggered despite the UXML file already having been opened
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Changing "PreWarm" parameters on VFX Graph leads to significant performance drops and freeze
- Player display resolution changes to the native resolution of the monitor when Player becomes unresponsive
- [Quest] Game View is no longer rendered in the HMD if it's hidden in the Editor when using Meta Link
- Unity auto-generates code it can't compile when classes are renamed
- Terrain's "Grass Tint" Color picker has Alpha 0 by default
Resolution Note:
The OnOpenAsset callback is not called because the UI Builder defines a callback with callbackOrder 0 to be able to open UXML files. The callback is consumed here and it will not call the callbacks with a higher callbackOrder. We do not intend to modify this behavior since we want the UI Builder to have the highest priority for those files.
However, it is possible to define a OnOpenAsset callback using a negative callbackOrder index. This allows users to define their own callbacks without interfering with the callbacks already defined by Unity (like the UI Builder callback). The documentation states you can use only positive numbers for this index but in reality you can use negative numbers too. The documentation will be updated shortly.