Page 1 of 1

[SOLVED] help with cinema Director

Posted: Thu Jul 23, 2015 6:30 am
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 :)

Re: help with cinema Director

Posted: Thu Jul 23, 2015 11:51 am
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.

Re: help with cinema Director

Posted: Mon Jul 27, 2015 6:32 am
by alfonso
Thank Tony its works soo good :)

Re: [SOLVED] help with cinema Director

Posted: Mon Jul 27, 2015 8:49 am
by Tony Li
Glad I could help! :-)