Hi all!
In the Dialogue Manager -> Instantiate Prefabs -> Prefabs... Can you add new UI elements that have nothing to do with dialogues/quests, like pause menus? Additionally, If I add it there, is there a way to access it and try to, for example, activate the menu or deactivate it?
Thanks.
Regards,
Javier.
[Solved] Can you add new UI prefabs to the Dialogue Manager -> Instantiate Prefabs?
[Solved] Can you add new UI prefabs to the Dialogue Manager -> Instantiate Prefabs?
Last edited by Japtor on Thu Jul 05, 2018 3:59 am, edited 1 time in total.
Re: Can you add new UI prefabs to the Dialogue Manager -> Instantiate Prefabs?
Hi Javier,
Yes, you can add more prefabs to that Instantiate Prefabs component. They will be added as children to the Dialogue Manager's Canvas. You can also add more Instantiate Prefabs components if you want to instantiate them as children of a different canvas or GameObject.
The Dialogue System doesn't provide anything in specific to access them. Just treat them like any GameObject that's instantiated from a prefab. For example, you could make the prefab GameObject active and its child panel inactive. Add a script to the prefab GameObject that toggles the panel on and off when the player presses Escape:
Yes, you can add more prefabs to that Instantiate Prefabs component. They will be added as children to the Dialogue Manager's Canvas. You can also add more Instantiate Prefabs components if you want to instantiate them as children of a different canvas or GameObject.
The Dialogue System doesn't provide anything in specific to access them. Just treat them like any GameObject that's instantiated from a prefab. For example, you could make the prefab GameObject active and its child panel inactive. Add a script to the prefab GameObject that toggles the panel on and off when the player presses Escape:
Code: Select all
using UnityEngine;
public class PauseMenu : MonoBehaviour
{
public GameObject panel;
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
panel.SetActive(!panel.activeSelf);
Time.timeScale = panel.activeSelf ? 1 : 0;
}
}
}
Re: Can you add new UI prefabs to the Dialogue Manager -> Instantiate Prefabs?
Hi!
Thanks for the answer! It helped me a lot
Regards,
Javier.
Thanks for the answer! It helped me a lot
Regards,
Javier.