[SOLVED] help with cinema Director

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

[SOLVED] help with cinema Director

Post by alfonso »

Hi, when a dialogue is showed in a cutscene i need to pause the cutscene until this finished, the problem is how can i know when the dialogue is finished to continue the cutscene?

i will like to put on OnConversationEnd method of AbstractDialogueUI something like let me know if a cutscene is playing and if this true call play method of that cutscene, the problem is how to access to that active cutscene??


Thanks for the help :)
Last edited by alfonso on Mon Jul 27, 2015 6:32 am, edited 1 time in total.
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Re: help with cinema Director

Post by Tony Li »

Hi,

Add a small script to the Dialogue Manager GameObject that has the OnConversationStart and OnConversationEnd script methods, something like:

Code: Select all

public class PauseCutscenesDuringConversations : MonoBehaviour {

    private List<Cutscene> pausedCutscenes = new List<Cutscene>();
    
    public void OnConversationStart(Transform actor) {
        // Pause all active cutscenes:
        pausedCutscenes.Clear();
        foreach (var cutscene in FindObjectsOfType<>) {
            if (cutscene.IsPlaying) { //<-- Need to double-check this property name.
                cutscene.Pause();
                pausedCutscenes.Add(cutscene);
            }
        }
    }
    
    public void OnConversationEnd(Transform actor) {
        // Resume paused cutscenes:
        pausedCutscenes.ForEach(cutscene => cutscene.Play());
    }
} 
I'm out of the office right now, and I don't remember the exact property name to determine if a cutscene is playing. The code above should get you started.
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Re: help with cinema Director

Post by alfonso »

Thank Tony its works soo good :)
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Re: [SOLVED] help with cinema Director

Post by Tony Li »

Glad I could help! :-)
Post Reply