Instantly share code, notes, and snippets.

Embed
What would you like to do?
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