Timeline Clip QOL Suggestion
Posted: Sat Oct 09, 2021 12:38 am
Preface - I am using Dialogue System v2.2.13, so I apologize if this change has already been made
--
Hey Tony! I've been doing a lot of stuff with Timeline recently, and today I wanted to create a custom Track for controlling a Conversation.
I found the existing "Conversation Track" and "Continue Conversation Track" and they were amazing references for what I wanted to set up.
As I was looking through their code, I noticed that for the Continue Conversation Track, you had to have the gameobject with the PlayableDirector selected in the Hierarchy for the PreviewUI (in editor mode) to determine the correct dialogue message to display.
The reasoning seemed to be the need to reference the PlayableDirector, in the function GetEditorContinueText on the ConversationContinueMixerBehaviour:
I believe all of this can be replaced with:
Which makes it so you don't have to have the gameobject with the PlayableDirector selected in the Hierarchy when you're previewing. Pretty handy!
--
Hey Tony! I've been doing a lot of stuff with Timeline recently, and today I wanted to create a custom Track for controlling a Conversation.
I found the existing "Conversation Track" and "Continue Conversation Track" and they were amazing references for what I wanted to set up.
As I was looking through their code, I noticed that for the Continue Conversation Track, you had to have the gameobject with the PlayableDirector selected in the Hierarchy for the PreviewUI (in editor mode) to determine the correct dialogue message to display.
The reasoning seemed to be the need to reference the PlayableDirector, in the function GetEditorContinueText on the ConversationContinueMixerBehaviour:
Code: Select all
var go = UnityEditor.Selection.activeGameObject;
if (go != null)
{
var director = go.GetComponent<PlayableDirector>();
if (director == null) director = GameObject.FindObjectOfType<PlayableDirector>();
if (director == null) Debug.Log("Select PlayableDirector GameObject to be able to preview bark clip text.");
if (director != null && director.playableAsset != null)
{ ...
Code: Select all
PlayableDirector director = playable.GetGraph().GetResolver() as PlayableDirector;
if (director != null && director.playableAsset != null) {
...