Guest User

Untitled

a guest
Nov 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.Playables;
  3.  
  4. [System.Serializable]
  5. public class PositionPlayableAsset : PlayableAsset
  6. {
  7. public ExposedReference<GameObject> targetObject;
  8. public Vector3 startPosition;
  9. public Vector3 endPosition;
  10.  
  11. public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
  12. {
  13. var behaviour = new PositionPlayableBehaviour
  14. {
  15. targetObject = targetObject.Resolve(graph.GetResolver()),
  16. startPosition = startPosition,
  17. endPosition = endPosition
  18. };
  19. return ScriptPlayable<PositionPlayableBehaviour>.Create(graph, behaviour);
  20. }
  21. }
Add Comment
Please, Sign In to add comment