I've got an odd situation that I hope you can help me sort out. I've been fiddling with it for days but had no luck.
Here's what I'm trying to do:
A conversation plays as normal. After this conversation ends, The game takes the player to a Navigational map, which operates in 2d Worldspace. The player scrolls the camera left/right across the map and they can click on different buttons to take them to different locations (the "locations" are just different backgrounds being activated). In these locations, new conversations will start.
Here's what I have tried to make this work:
I set up a test in a fresh project just to remove any extra variables from all the stuff in my main project that might be messing with this. It didn't work in my main project either, so I assume I'm just missing some step I need to do.
In the new project I have just Dialogue System and the VN Framework. I'm testing this using the VN framework's demo scenes.
After the demo "Start Conversation" plays, I have sequencer commands on the last node set to activate my Worldspace UI which contains the buttons the player will use to navigate, Activate the Map image, as well as enable a component on the main camera that lets the player use the left/right arrow keys to slide the camera back and forth.
In order to make my Worldspace UI clickable, I've had to deactivate the regular Dialogue UI Canvas as well. I tried making this work with both UI canvases active, but had no luck.
In my Worldspace UI, I have a button that starts a new conversation on click. I am using this Switch Conversation script on the button to end the current conversation (demo Start Conversation) and start up a new one.
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
using UnityEngine.UI;
public class ChangeConversationButton : MonoBehaviour
{
[ConversationPopup]
public string newConversation;
public Transform actor;
public Transform conversant;
public void Start()
{
GetComponent<UnityEngine.UI.Button>().onClick.AddListener(ChangeConversation);
}
public void ChangeConversation()
{
DialogueManager.StopConversation();
DialogueManager.StartConversation(newConversation, actor, conversant);
}
}
The script appears to work, as I notice in the Dialogue window that the node has changed to the Start node of the new conversation.
I am also reactivating the Dialogue UI's canvas and deactivating the Worldspace Canvas at the start of the new conversation.
Watching the hierarchy while in play mode shows that everything is being activated/deactivated as intended.
However, nothing is showing on screen. The Dialogue UI canvas is activated, but I am not seeing the subtitle panels appearing, so I can't interact with the current conversation.
I'm a bit lost on what I should do to fix this, or if i am even handling the situation in the correct manner.
Thanks for your time!