Skip to content

Instantly share code, notes, and snippets.

@tarukosu
Created November 19, 2017 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarukosu/d0e66926513fa42aabe75f286ab36e49 to your computer and use it in GitHub Desktop.
Save tarukosu/d0e66926513fa42aabe75f286ab36e49 to your computer and use it in GitHub Desktop.
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