playMaker

Author Topic: uGUI Actions  (Read 43966 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: uGUI Actions (WIP)
« Reply #30 on: January 11, 2015, 10:18:41 PM »
cool.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: uGUI Actions (WIP)
« Reply #31 on: January 12, 2015, 02:53:37 AM »
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 or download it below:

uGuiSetGraphicColor

 Bye,

 Jean

uGui Set Text
uGui Set Image Color
Also at my repository https://github.com/sebastiao3d
Can you add a every frame option to uGui Set Image Color?

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: uGUI Actions (WIP)
« Reply #32 on: June 26, 2015, 01:31:54 PM »
Created this action that sets the EventSystem's current selected object.

Any crits on the way I made it are most welcome!


inyourbus

  • Playmaker Newbie
  • *
  • Posts: 43
  • In Your Legends
    • In Your Legends
Re: uGUI Actions (WIP)
« Reply #33 on: June 27, 2015, 12:45:58 PM »
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.
One step at a time..

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: uGUI Actions (WIP)
« Reply #34 on: June 27, 2015, 01:08:10 PM »
Hi,

 Thanks for this. I'll put it on the ecosystem, as well as part of the wiki package for Unity UI.

 Bye,

 Jean

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: uGUI Actions (WIP)
« Reply #35 on: June 28, 2015, 04:55:04 PM »
awesome!

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: uGUI Actions (WIP)
« Reply #36 on: June 29, 2015, 12:38:55 PM »
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?

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: uGUI Actions (WIP)
« Reply #37 on: June 29, 2015, 01:27:09 PM »
try this version!

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: uGUI Actions (WIP)
« Reply #38 on: June 29, 2015, 02:00:27 PM »
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. :-/

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: uGUI Actions (WIP)
« Reply #39 on: June 29, 2015, 02:43:45 PM »
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

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: uGUI Actions (WIP)
« Reply #40 on: June 29, 2015, 02:47:35 PM »
I will test again more deeply as I get home/tomorrow and let you know if I found the issue.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: uGUI Actions (WIP)
« Reply #41 on: June 30, 2015, 07:39:36 AM »
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?

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: uGUI Actions (WIP)
« Reply #42 on: June 30, 2015, 08:14:29 AM »
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

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: uGUI Actions (WIP)
« Reply #43 on: June 30, 2015, 09:42:21 AM »
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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: uGUI Actions (WIP)
« Reply #44 on: June 30, 2015, 10:59:35 AM »
on the 1st version there was no Finish();

i added it here, could you try if it still looses focus?

Code: [Select]
// (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);
}

}
}