Last active
December 10, 2018 14:25
-
-
Save tsubaki/fdd0b54b32c03fe231e91cc0d28fc97f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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