Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active April 26, 2017 12:55
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 tsubaki/c48df410b0ad90b7cc94822c6a38725e to your computer and use it in GitHub Desktop.
Save tsubaki/c48df410b0ad90b7cc94822c6a38725e to your computer and use it in GitHub Desktop.
resolverによる解決
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
[System.Serializable]
public class TextUpdateAsset : PlayableAsset
{
public override PlayableHandle CreatePlayable (PlayableGraph graph, GameObject go)
{
var handle = graph.CreateScriptPlayable<TextUpdatePlayable> ();
bool result;
handle.GetObject<TextUpdatePlayable> ().text = (UnityEngine.UI.Text)graph.resolver.GetReferenceValue ("title", out result);
return handle;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.UI;
public class SetResolve : MonoBehaviour
{
[SerializeField] PlayableDirector playableDirector;
[SerializeField] Text label;
void Start ()
{
playableDirector.SetReferenceValue ("title", label);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment