Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active December 10, 2018 14:25
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/fdd0b54b32c03fe231e91cc0d28fc97f to your computer and use it in GitHub Desktop.
Save tsubaki/fdd0b54b32c03fe231e91cc0d28fc97f to your computer and use it in GitHub Desktop.
using System.ComponentModel;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
// テキスト情報を送信するマーカー
[System.Serializable, DisplayName("テキストのマーカー")]
public class TextMarker : Marker, INotification
{
public string message;
public PropertyName id
{
get
{
return new PropertyName("method");
}
}
}
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.UI;
// テキスト情報を受信するマーカー
public class TextMerkerReceiver : MonoBehaviour, INotificationReceiver
{
Text label;
private void Awake()
{
label = GetComponent<Text>();
}
public void OnNotify(Playable origin, INotification notification, object context)
{
var element = notification as TextMarker;
if (element == null)
return;
label.text = element.message;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment