Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Best way to continuously update EditorWindow VisualElements

Discussion in 'UI Toolkit' started by NamelessPerson, Jun 5, 2020.

  1. NamelessPerson

    NamelessPerson

    Joined:
    Apr 17, 2017
    Posts:
    26
    I would like to tie the opacity of a VisualElement that is inside an EditorWindow to a data field in a scene. So that as the value changes in game, the style of the element changes in the editor window.

    To my understanding VisualElements don't have an Update/OnGUI equivalent so what is the recommended approach? My current thought is to create an event in the main EditorWindow that gets fired every frame and have any element that needs to continuously update its style to listen in on that event.

    Suggestions?