Created
November 19, 2017 13:57
-
-
Save tarukosu/d0e66926513fa42aabe75f286ab36e49 to your computer and use it in GitHub Desktop.
ScalePlayableAsset.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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