I’m experimenting with the Playables in the beta, and I’ve run up into a little nuisance. If I create a PlayableGraph, I’ll get a warning about it not being disposed when I leave play mode.
Simple reproduction is to put this in an empty scene, enter and exit play mode:
public class TestScript : MonoBehaviour
{
// Use this for initialization
private void Start()
{
var graph = PlayableGraph.Create();
}
}
Is there a Dispose method I’ve missed somewhere? PlayableGraph doesn’t have one, and I can’t find anything in the API. The only thing I find googling is some threads about “Playable” not being disposed due to a bug in 5.4, so that’s probably unrelated.
Yes, it’s intended. Playables are intended to be much lighter weight than UnityObjects, and thus they are not serializable. Destroying them in OnDestroy, OnDisable, OnApplicationQuit, etc… is the way to go (depending on the usage).