Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: Lane on September 24, 2014, 11:18:33 AM
-
I'm playing around with uGUI in 4.6b17 and creating relevant actions. Post requests and I'll see what I can do.
[EDIT]
Please check Ecosystem or the Wiki for the latest UI Actions. Most of the stuff in this thread was made during the 4.6 UI beta and is Legacy.
-
uGUI button event.
Really simple right now, just sends an event when a button is clicked. Be sure you use Next Frame Event for loops.
[EDIT]
UPDATED button action: http://hutonggames.com/playmakerforum/index.php?topic=8987.msg43021#msg43021
Fixes a couple of bugs. Leaving the old one here for reference as it's a different action name to avoid breaking things on update.
-
uGUI Set Slider Properties
For setting the properties of a slider.
-
uGUI Get Slider Properties
For grabbing the properties of a slider. There was a nifty value for getting a Normalized Value as well! How convenient =)
-
uGUI Toggle Event
Fire an event based on the status of a Toggle, or store its value.
-
Very good work Lane!
Will this actions replace the old UI system or with come as a package?
Cheers
Seb
-
This is all new stuff, we'll compile it into a package eventually. The Legacy GUI system is still in Unity and accessible. All of the Unity GUI is done in it, so it isn't going away.
-
very useful and thanks for making
-
uGUI Component Enabled Flag
This is still sort of experimental. Not precisely sure how to go about enabling/disabling gui components yet or what the best approach is for this sort of action.
You can target the GameObject with the components on it and...:
- Choose from a dropdown list of what you want to enable/disable.
- Target a specific component.
- Leave both of those options blank and enable/disable ALL normal uGUI components on the object
Typically it seems like each gameobject will only contain one or maybe two component types, such as Button and Image, so I'm assuming you'll want to turn them all off if you are using this sort of thing and figured it would be fastest if all of the default options set it so that you could just put the action on and choose the Enabled/Disabled flag you want.
There is no issue with turning off the wrong button since its impossible to have more than one per game object, making the "all on/off" idea make the most practical sense to me.
If you need to turn off children, you'll probably be better off with Activate GameObject which turns the whole object and its children off. This is intended to target specific gameobjects or components and leave the children intentionally undisturbed.
If you want an alternative you can use Enable Behaviour, which is basically a fancy version of the Specific Component slot on this action.
The types of components you can currently affect:
Button, Text, Image, RawImage, Slider, Scrollbar, Toggle & InputField
Let me know how it goes.
-
Hi Lane! Thank you so much for these, much appreciated!
Got any more in works?
-
Jean is working on some very cool stuff for the more advanced portions of uGUI and I have some revisions to make to these for gc and such but I haven't had time to do much with them lately.
Do you have any specific needs for actions here?
-
First of all thanks for these! I've also been in the process of checking out the new uGUI and these actions will help save some time.
Since you're taking requests I think a Set uGUI text action is something that would be awesome.
-
Get/Set Text
http://hutonggames.com/playmakerforum/index.php?topic=8318.msg39933#msg39933
-
Thanks for pointing me in the right direction! Did not find it through search :-[
-
Yeah the search function is clunky. I have best results using the actual button and search screen rather than the search field in the top right of the page header.
-
These are a great help :D thanks!
How about actions to set/get sprites used by the ugui image component?
-
These are a great help :D thanks!
How about actions to set/get sprites used by the ugui image component?
I'll look into those this week.
-
hi,
Is it possible to create an action or transition for on mouse over?
and Does it will deffinitive version for the new UI
Thanks ^^
-
Yes.
-
"Yes" to what? :-[
-
Is it possible to create an action or transition for on mouse over?
Yes, either Jean's new event system will handle it or we'll make an action for it.
-
Hi,
Currently, I ported the UI component event themselves, not the Actual EventSystem ( confusing I know). So mouse over, dragging and similar is still something I have to digg and find a solution to bring to PlayMaker. Hopefully I'll find a solution soon.
The current proxy will be released with PlayMaker 1.8 and Unity 4.6 when it's out of beta. Too much mess on the new UI api to release anything to the public, as things break badly between releases, thing sare definitly not yet settled.
Bye,
Jean
-
Hi,
i created a action to exchange the tint normal color of a button.
It would be cool to make this action generic so it can be used to set highlight and clicked color as well. Maybe in an update...
-
Set image sprite and fill actions...
-
set text color
-
Hi,
Thanks for your contribution, it's indeed welcomed!
Maybe you want to contribute directly on the ecosystem? If you do let me know, I'll give you access so you can upload your work directly.
Bye,
Jean
-
i send you a pm
-
uGui Set Text
uGui Set Image Color
Also at my repository https://github.com/sebastiao3d (https://github.com/sebastiao3d)
-
There is a bug in the UIGUI action for the button. I tried to explain it in this link. It seems to remember old clicks and after 3 clicks or so will fire an old click.
http://hutonggames.com/playmakerforum/index.php?topic=8987.0
-
uGui Set Text
uGui Set Image Color
Also at my repository https://github.com/sebastiao3d (https://github.com/sebastiao3d)
Can you add a every frame option to uGui Set Image Color?
-
cool.
-
Hi,
Done, I actually created a more generic action affecting ALL UI component, so you can set the color of anything.
You can get it on the Ecosystem Browser (https://hutonggames.fogbugz.com/default.asp?W1181)or download it below:
uGuiSetGraphicColor (https://github.com/jeanfabre/PlayMaker--Unity--UI/raw/f8ad5768acd638531e4a2f15b4d0a4e17de89a19/Assets/PlayMaker%20Custom%20Actions/uGui/uGuiSetGraphicColor.cs)
Bye,
Jean
uGui Set Text
uGui Set Image Color
Also at my repository https://github.com/sebastiao3d (https://github.com/sebastiao3d)
Can you add a every frame option to uGui Set Image Color?
-
Created this action that sets the EventSystem's current selected object.
Any crits on the way I made it are most welcome!
-
Created this action that sets the EventSystem's current selected object.
Any crits on the way I made it are most welcome!
Works great. 10/10 would recommend.
-
Hi,
Thanks for this. I'll put it on the ecosystem, as well as part of the wiki package for Unity UI.
Bye,
Jean
-
awesome!
-
Hey terri,
I tried the action you posted and yes it does set the focus while the state is active but how would I switch to another Button using the uGUi default navigation system from there? Since when I leave the state the Button becomes "unselected" again.
What I'm trying to achive is that I got several "Screens" within one GUI and therefore I want to set the focus on a default button each time I open one of those Screens using Mouse, Keyboard or Controller.
Maybe I doing it wrong?
-
try this version!
-
hey terri,
thanks for your fast reply - but nope - the default navigation only work as I click any button at least once using the mouse, which is unsuitable if ppl are playing with a controller. All so the focus only stays active while I stay in the state your action is in. :-/
-
hey terri,
thanks for your fast reply - but nope - the default navigation only work as I click any button at least once using the mouse, which is unsuitable if ppl are playing with a controller. All so the focus only stays active while I stay in the state your action is in. :-/
weird, with the first version the button did seem to lose focus when you left the state but for me while testing with this new version it remained active
it never works/worked without clicking first? if so I think it's something else that is wrong, here I never have to use the mouse at all
-
I will test again more deeply as I get home/tomorrow and let you know if I found the issue.
-
Hi,
that is strange that your first version looses focus can you confirm that it is really doing so?
if so, would it be useful to have an option (bool) to stay or not stay focus when leaving the state?
-
Hi,
that is strange that your first version looses focus can you confirm that it is really doing so?
if so, would it be useful to have an option (bool) to stay or not stay focus when leaving the state?
seems that it does, I'm not yet familiar with how the eventsystem works though
yeah a bool would be best
-
hey terri,
thanks for your fast reply - but nope - the default navigation only work as I click any button at least once using the mouse, which is unsuitable if ppl are playing with a controller. All so the focus only stays active while I stay in the state your action is in. :-/
weird, with the first version the button did seem to lose focus when you left the state but for me while testing with this new version it remained active
it never works/worked without clicking first? if so I think it's something else that is wrong, here I never have to use the mouse at all
Hey terri,
sorry for the late reply - it works now in that way that I can instantly use the navigation with keyboard or controller - but on the off hand as an minor issue the "focused" button does not highlight showing it is preselected.
/peter
-
on the 1st version there was no Finish();
i added it here, could you try if it still looses focus?
// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
/*--- __ECO__ __ACTION__ ---*/
using UnityEngine;
using UnityEngine.EventSystems;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("uGui")]
[Tooltip("Sets the EventSystem's currently select GameObject.")]
public class uGuiSetSelectedGameObject : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmGameObject gameObject;
public override void Reset()
{
gameObject = null;
}
public override void OnEnter()
{
DoSetSelectedGameObject();
Finish();
}
void DoSetSelectedGameObject()
{
EventSystem.current.SetSelectedGameObject (gameObject.Value);
}
}
}
-
in my tests the last version highlights the selected button properly, doesn't lose focus when you change states and doesn't require mouse click to activate key navigation
other than the losing focus on state change, everything else should be handled by the eventsystem, I don't think it has to do with the action but with how it is set up
-
in my tests the last version highlights the selected button properly, doesn't lose focus when you change states and doesn't require mouse click to activate key navigation
other than the losing focus on state change, everything else should be handled by the eventsystem, I don't think it has to do with the action but with how it is set up
Might be the case ;-)
As a counterpart with some help from a friend I added a GetSelectedGameObject Action to my project - maybe someone might find it usefull. It has an option for "every frame" and all so to fire an event if the object has changed.
-
Hi,
thanks, I have added (https://twitter.com/JeanAtPlayMaker/status/636890762555322368) it to the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181).
Bye,
Jean
-
I'm going to go ahead and lock this thread since its quite old now and we have all of the proper UI solutions on Ecosystem/Wiki. The attachments will stay for reference or if someone prefers/needs them for any reason.
Check Ecosystem or the Wiki for the latest actions to work with Unity UI.
If you have new UI actions to share, please make a fresh thread for it. :)