Question for my mobile game project 1

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question for my mobile game project 1

Post by Tony Li »

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.
davidsibya08
Posts: 57
Joined: Sun Feb 12, 2017 2:11 pm

Re: Question for my mobile game project 1

Post by davidsibya08 »

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?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question for my mobile game project 1

Post by Tony Li »

If your HUD has a unique GameObject name (for example, "HUD"), you could add a script like this to all gameplay scenes:

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);
    }
}
davidsibya08
Posts: 57
Joined: Sun Feb 12, 2017 2:11 pm

Re: Question for my mobile game project 1

Post by davidsibya08 »

Is there a way that I could just set that up into the UI?

Sir, is there a documentation for Selectable Object UI?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question for my mobile game project 1

Post by Tony Li »

Hi,
davidsibya08 wrote:Is there a way that I could just set that up into the UI?
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:Sir, is there a documentation for Selectable Object UI?
When do you mean by that? If you mean the Selector and Proximity Selector, then it's on this page.
davidsibya08
Posts: 57
Joined: Sun Feb 12, 2017 2:11 pm

Re: Question for my mobile game project 1

Post by davidsibya08 »

Ahh I get it. I will try it first.
Attachments
What is this?
What is this?
se.png (6.69 KiB) Viewed 1644 times
davidsibya08
Posts: 57
Joined: Sun Feb 12, 2017 2:11 pm

Re: Question for my mobile game project 1

Post by davidsibya08 »

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.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question for my mobile game project 1

Post by Tony Li »

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.
davidsibya08
Posts: 57
Joined: Sun Feb 12, 2017 2:11 pm

Re: Question for my mobile game project 1

Post by davidsibya08 »

Haha. Finally! Thank you sir. :) I'm so glad you're just out there for help.

Thank you sir Tony. :D :D
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question for my mobile game project 1

Post by Tony Li »

Glad to help!
Post Reply