Page 1 of 1
Position Selector
Posted: Sun Sep 25, 2016 8:20 pm
by ricjonsu098
Hello, how can I position the selector text? Aside from on top of target and on top of screen, how can I make it like let's say middle left?
Also how can I use the Unity UI Selector Prefab? Like the Runic Unity UI Selector Panel. I can't seem to find a tutorial or an instruction on how to use it.
Re: Position Selector
Posted: Mon Sep 26, 2016 9:29 am
by Tony Li
Hi,
The documentation on the Unity UI Selector components is a bit thin. I'll add more details in the next version.
A good example to follow is the scene Examples > Unity UI Examples > Generic UI Example Scene. Here's how I set it up:
1. The Dialogue Manager has a Unity UI Canvas. If your Dialogue Manager's doesn't have a Canvas, add one. I added a Generic Unity UI Selector Panel to the Canvas. (This prefab is in Prefabs > Unity UI Prefabs > Generic). You could add a Runic Unity UI Selector Panel instead if you prefer. At this point you could customize its position and appearance.
2. On the player (that is, the GameObject with the Selector/ProximitySelector), I added a Unity UI Selector Display. You can leave its fields unassigned. Since the Unity UI Selector Panel (in step #1 above) has a Unity UI Selector Elements component, the Unity UI Selector Display will automatically find all the correct UI elements.
3. Untick the Proximity Selector's Use Default GUI checkbox.
Re: Position Selector
Posted: Mon Sep 26, 2016 9:43 am
by ricjonsu098
Worked like a charm. Thanks!
I just have a little problem. The default gui of the selector is not disabled, how to disable it? (Please don't mind the color of the text in Unity UI selector, I will fix that)
I figured that maybe I can just make it so that the message position will be at the top, but what I want to completely disable it.
Re: Position Selector
Posted: Mon Sep 26, 2016 10:28 am
by Tony Li
Remove the Selector Follow Target script. This script works with the default GUI, so it re-enables the Use Default GUI checkbox under the hood.
Using Unity UI, if you want to position a specific usable's selector UI, add a Usable Unity UI to it. (See Sergeant Graves in the Generic example scene.)
Re: Position Selector
Posted: Mon Sep 26, 2016 10:33 am
by ricjonsu098
Oh my mistake. Thanks!
Oh btw, may I just add for future readers?
If you guys plan to use this one, remember to remove the 'Show' and 'Hide' in Animation Transition field in Unity UI Selector Display component in your player, I don't know in other cases, but in my case, there will be a warning in the console that says "Parameter 'Show' does not exist." and "Parameter 'Hide' does not exist." causing a malfunction in the system, which is, once Unity UI Selector is displayed (in my case the Runic Unity UI Selector Panel), it will not hide. So remove these 2 parameters to fix.
Cheers!
EDIT: Seems like you also have to remove Show and Hide in the Unity UI Selector Display component in your Unity UI Selector Prefab. I don't know why, maybe a bug?
Re: Position Selector
Posted: Mon Sep 26, 2016 11:01 am
by Tony Li
Thanks for pointing that out! I'll fix it one way or the other -- get rid of the Show/Hide, or actually add animations (maybe a quick fade in/out).