При разработке кастомного редактора с помощью UI Toolkit мне понадобилась отследить, когда я делаю какие-то изменения в ассетах (меняю баланс в SO), чтобы перерисовать UI. Оказалось, в Unity есть подходящее событие:
ObjectChangeEvents.changesPublished
Event that is raised once per frame if any undoable changes have been recorded.
All undoable changes to any loaded object are recorded in a stream of events and published once per frame. Subscribe to this event to react to any of these changes. The changes appear in the stream in the order that they were applied. Note that the stream passed to your callback is a temporary object owned by the engine. Do not Dispose it and make a copy if you intend to retain it for longer than the duration of your callback.
#ui #тайные_знания