Page 1 of 1

Quest Machine UI isn't showing up

Posted: Mon Nov 05, 2018 1:35 am
by chairiko
Hello, I added the Quest Machine prefab to my scene, I am also using Invector's item manager, in which the UI for that shows up. I was wondering if this has anything to do with the Quest Machine UI not showing up at all.

Re: Quest Machine UI isn't showing up

Posted: Mon Nov 05, 2018 8:46 am
by Tony Li
Hi,

Here's an example scene:

QM_InvectorShooterUIExample_2018-11-05.unitypackage

You can press (J) to toggle the quest journal. If you bump into the NPC (capsule), it will show the dialogue UI.

To set this up, I used these steps:

1. I added the Quest Machine prefab to the scene.

2. I added the small script below to the Quest Machine GameObject. It has one method: SetTimeScale. I configured the Quest Dialogue UI's and Quest Journal UI's OnOpen() event to SetTimeScale 0, and OnClose() to SetTimeScale 1.

3. Created a new GameObject named PLAYER QUEST JOURNAL, and added a Quest Journal component. This is because the Quest Journal should be part of the scene, but Invector can treat the player GameObject as an Instance, meaning it can come from another scene.

4. Added TEST CANVAS with a button to toggle the Quest Journal. Added a UI Button Key Trigger to add (J) as a hotkey.

5. Added a test NPC. It offers the carrot quest, but I didn't bother to add carrots to the scene.

SetTimeScale.cs

Code: Select all

using UnityEngine;

public class ControlTimeScale : MonoBehaviour
{
    public void SetTimeScale(float timeScale)
    {
        Time.timeScale = timeScale;
        Cursor.visible = Mathf.Approximately(0, timeScale);
        Cursor.lockState = Mathf.Approximately(0, timeScale) ? CursorLockMode.None : CursorLockMode.Locked;
    }
}

Re: Quest Machine UI isn't showing up

Posted: Mon Nov 05, 2018 12:47 pm
by chairiko
Thank you very much for the quick response. Will this make it so hat the mouse isn't showing unless Dialogue comes up? Because when I use Invector Shooter I want it so that the cursor doesn't show up until the Quest Manager UI pops up.

Re: Quest Machine UI isn't showing up

Posted: Mon Nov 05, 2018 12:49 pm
by Tony Li
Yes, that's correct.