Search Unity

Feedback Why are TimelineWindow and WindowState classes internal?

Discussion in 'Timeline' started by Ratslayer, Oct 5, 2020.

  1. Ratslayer

    Ratslayer

    Joined:
    Feb 6, 2014
    Posts:
    37
    I write a lot of editor tool code to work with Animation Window and Timeline Window and this is driving me nuts.
    What is the rationale behind hiding all the code behind an internal modifier? There is so much stuff there that just helps the game dev flow and is not unsafe in any way. I am so tired of having to use reflection for mundane stuff like toggling off Preview mode. At least TimelineEditor exposes some stuff, but it's way not enough.

    Any chance future versions will expose some of this stuff? Reflection is extremely unsafe when the package keeps getting updated.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    It's internal because it is (or sometimes was) expected to change, in particular, change in ways that may not support backwards compatible API. The latest versions of Timeline have new APIs added to access some of the pieces that allow users to interact in safe, backwards compatible ways (actions, track/clip/marker editors, new TimelineEditor accessors) but still let the team safely make future changes.

    If there are specific things you need access to, please feel free to post them. There may be a way without internal methods already, but letting us know the use cases does help guide us in what needs to be exposed.