Page 1 of 1

Canvas reference?

Posted: Thu Jan 10, 2019 7:31 am
by Japtor
Hi,

Simple question.

Does the Dialogue Manager have a variable with a reference to its canvas? I will like to change its values through "play mode". I have been searching for it in the documentation, but I am not really sure if I found the correct answer.

Thanks! :)

Re: Canvas reference?

Posted: Thu Jan 10, 2019 8:42 am
by Tony Li
Hi,

No, it doesn't. This is because the Dialogue Manager doesn't always require a canvas. If you're using NGUI or legacy Unity GUI, they don't use Canvas. And it's also possible for the Dialogue Manager to point to a dialogue UI in a canvas that's not a child of the Dialogue Manager.

However, if your Dialogue Manager has one Instantiate Prefabs component, you can find use it to get the canvas:

Code: Select all

Canvas canvas = DialogueManager.instance.GetComponent<InstantiatePrefabs>().parent.GetComponent<Canvas>();

Re: Canvas reference?

Posted: Thu Jan 10, 2019 10:02 am
by Japtor
Hi,

All right!

Thanks for the answer. :)