20 lines
562 B
C#
20 lines
562 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
|
|
public class SubtitleClip : PlayableAsset
|
|
{
|
|
[TextArea(3/*min lines*/, 10/*max lines*/)]
|
|
public string subtitleText;
|
|
|
|
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
|
{
|
|
var playable = ScriptPlayable<SubtitleBehaviour>.Create(graph);
|
|
|
|
SubtitleBehaviour subtitleBehaviour = playable.GetBehaviour();
|
|
subtitleBehaviour.subtitleText = subtitleText;
|
|
return playable;
|
|
}
|
|
}
|