Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question PrepareFrame and ProcessFrame methods not invoked for PlayableBehaviour with generic params?

Discussion in 'Animation' started by senox13, Apr 20, 2023.

  1. senox13

    senox13

    Joined:
    Oct 10, 2013
    Posts:
    4
    I can't find anything explicitly acknowledging this in the playables docs, but it seems that PlayableBehaviour-derived types do not behave as expected with generic parameters. Simply taking the last example from this page and adding a generic parameter to the playable's definition causes PrepareFrame and ProcessFrame to be ignored and the playable graph inspector to display the name improperly. Is this as intended? Is there a broadly accepted workaround for this?
     
  2. senox13

    senox13

    Joined:
    Oct 10, 2013
    Posts:
    4
    After checking the limited source code that Unity makes available and finding absolutely nothing helpful, I just bit the bullet and worked around the limitation using a simple pair of proxy classes, one with a generic param and one without, both nested in my PlayableBehaviour subclass. I've saved my code to a gist as an example for anyone who runs into this same issue in the future, though I'd still love to know if there's a cleaner way to go about this.

    https://gist.github.com/senox13/8f29c9969e66620694ff2cc02b0b30a1