Search Unity

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
     
  3. alior

    alior

    Joined:
    Sep 6, 2014
    Posts:
    25
    Same thing here.