Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ScalePlayableAsset.cs
using UnityEngine;
using UnityEngine.Playables;
[System.Serializable]
public class ScalePlayableAsset : PlayableAsset
{
public ExposedReference<GameObject> targetObject;
public Vector3 startScale;
public Vector3 endScale;
public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
{
var behaviour = new ScalePlayableBehaviour
{
targetObject = targetObject.Resolve(graph.GetResolver()),
startScale = startScale,
endScale = endScale
};
return ScriptPlayable<ScalePlayableBehaviour>.Create(graph, behaviour);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment