Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Gizmos/Handles/OnSceneGUI to control values in PlayableBehaviour

Discussion in 'Timeline' started by sabojako, Feb 27, 2018.

  1. sabojako


    Jul 7, 2017

    I'm trying to control a PlayableBehaviour's public values from a OnSceneGUI delegate, in an Editor class.

    For reference, I'm starting from the Light Control Track example in the Default Playables package.

    I'm noticing that the Playable is re-generated automagically whenever I modify the values in the LightControlClip inspector (PlayableAsset) which updates the LightControlBehaviour "template" variable (PlayableBehaviour). In other words, LightControlClip.CreatePlayable() gets called. I can get the values to update from the OnSceneGUI() to the LightControlBehaviour.

    However, I struggle to understand how to tell the Playable system to update/dirty the Playable. What is the proper way of re-generating the Playable from an Editor class which inspect a PlayableAsset? Find the source PlayableDirector and RebuildGraph() ?