Instantly share code, notes, and snippets.

@tsubaki /Rebind.cs
Last active Dec 8, 2017

What would you like to do?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using System.Linq;
using UnityEngine.Timeline;
using UnityEngine.Assertions;
public class Rebind : MonoBehaviour
public void Play (Rotation rotation)
var director = GetComponent<PlayableDirector> ();
var track = ((TimelineAsset)director.playableAsset).GetOutputTracks ().First (c =>"Control Track"));
var clip = (ControlPlayableAsset)track.GetClips().First(c => c.displayName == "ControlPlayableAsset").asset;
var exposeName = clip.sourceGameObject.exposedName;
director.SetReferenceValue (exposeName, target.gameObject);
director.Play ();

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment