Question for my mobile game project 1
Re: Question for my mobile game project 1
Hi,
Thanks for posting the screenshot. It was very helpful.
For #1, assign the button's OnClick() event to the quest log window's Open() method (UnityUIQuestLogWindow.Open).
For #2, make sure your achievements panel has a SelectablePanel component. Then assign the button's OnClick() event to SelectablePanel.Open.
For #3, assign the button's OnClick() event to the Pause panel's SelectablePanel.Open.
Thanks for posting the screenshot. It was very helpful.
For #1, assign the button's OnClick() event to the quest log window's Open() method (UnityUIQuestLogWindow.Open).
For #2, make sure your achievements panel has a SelectablePanel component. Then assign the button's OnClick() event to SelectablePanel.Open.
For #3, assign the button's OnClick() event to the Pause panel's SelectablePanel.Open.
-
- Posts: 57
- Joined: Sun Feb 12, 2017 2:11 pm
Re: Question for my mobile game project 1
Thank you very much sir.
I got it already. Additional question, how would I set the HUD to be visible when it is in the gameplay?
Is there a documentation for SelectablePanel component?
I got it already. Additional question, how would I set the HUD to be visible when it is in the gameplay?
Is there a documentation for SelectablePanel component?
Re: Question for my mobile game project 1
If your HUD has a unique GameObject name (for example, "HUD"), you could add a script like this to all gameplay scenes:
ShowHUD.cs
ShowHUD.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class ShowHUD : MonoBehaviour {
void Start() {
Tools.GameObjectHardFind("HUD").SetActive(true);
}
void OnDestroy() {
Tools.GameObjectHardFind("HUD").SetActive(false);
}
}
-
- Posts: 57
- Joined: Sun Feb 12, 2017 2:11 pm
Re: Question for my mobile game project 1
Is there a way that I could just set that up into the UI?
Sir, is there a documentation for Selectable Object UI?
Sir, is there a documentation for Selectable Object UI?
Re: Question for my mobile game project 1
Hi,
No. I assume the UI is set to persist during scene changes. (In other words, the UI exists in the main menu scene, and when you change to the gameplay scene the UI is still there.) In this case, how will the UI know when to show or hide the HUD? There are always other ways, of course, but I think the script above is the easiest.davidsibya08 wrote:Is there a way that I could just set that up into the UI?
When do you mean by that? If you mean the Selector and Proximity Selector, then it's on this page.davidsibya08 wrote:Sir, is there a documentation for Selectable Object UI?
-
- Posts: 57
- Joined: Sun Feb 12, 2017 2:11 pm
Re: Question for my mobile game project 1
Ahh I get it. I will try it first.
- Attachments
-
- What is this?
- se.png (6.69 KiB) Viewed 1650 times
-
- Posts: 57
- Joined: Sun Feb 12, 2017 2:11 pm
Re: Question for my mobile game project 1
There is a problem with the pause button, I can already see the HUD during game play.
When I clicked the Pause Button, it shows the Pause panel but when I clicked the Pause Button again it only shows the Options Tint and then I have to press escape to see the Pause Panel.
When I clicked the Pause Button, it shows the Pause panel but when I clicked the Pause Button again it only shows the Options Tint and then I have to press escape to see the Pause Panel.
Re: Question for my mobile game project 1
It's just a matter of working through the logic of opening and closing the UI panels. There are a few ways you could do it. Here's one way:
1. Add another entry to the HUD button's OnClick() event. Use this entry to deactivate the HUD GameObject. (Assign HUD, and select GameObject.SetActive.)
2. Inspect the PausePanel. Add an entry to the OnOpen() event. Use this entry to reactivate the HUD GameObject.
1. Add another entry to the HUD button's OnClick() event. Use this entry to deactivate the HUD GameObject. (Assign HUD, and select GameObject.SetActive.)
2. Inspect the PausePanel. Add an entry to the OnOpen() event. Use this entry to reactivate the HUD GameObject.
-
- Posts: 57
- Joined: Sun Feb 12, 2017 2:11 pm
Re: Question for my mobile game project 1
Haha. Finally! Thank you sir. I'm so glad you're just out there for help.
Thank you sir Tony.
Thank you sir Tony.
Re: Question for my mobile game project 1
Glad to help!