playMaker

Author Topic: Dragging NGUI Label or Button to GameObject fields[SOLVED]  (Read 4567 times)

MrAdventure

  • Playmaker Newbie
  • *
  • Posts: 24
Dragging NGUI Label or Button to GameObject fields[SOLVED]
« on: December 24, 2013, 03:33:21 PM »
Hello,

I am trying to make a stacked inventory button with a text label that gets decremented with use.

First, when setting up, I can't find the file UIEventsToPlayMakerFSM, mentioned repeatedly in the forums. Is this an old one, replaced by NGUIEventForwarder?

I placed NGUIEventForwarder on my button, and dragged the FSM running on another game object onto the field in NGUIEventForwarder.

I had read that I should be able to drag my button, labels, etc, onto actions and variables on my FSM. Doing this in the variable pane does nothing. Doing it onto a GameObject slot in an action brings up a context menu with Get Property, Set Property, Send Message, and Cancel. I can't ever drop the object into a field directly.

Thanks for any advice. Happy Holidays!

Victor
« Last Edit: February 17, 2014, 10:58:26 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Dragging NGUI Label or Button to GameObject fields
« Reply #1 on: December 26, 2013, 02:28:11 AM »
Hi,

 Use this package:

https://hutonggames.fogbugz.com/default.asp?W1111

 Instructions on event listening are on that wiki page as well. Come back to this thread if you have trouble still.

bye,

 Jean

MrAdventure

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Dragging NGUI Label or Button to GameObject fields
« Reply #2 on: December 26, 2013, 03:39:38 PM »
Hi Jean,

Thanks so much for responding. I will start working on this shortly, but for the purpose of clarity please answer the following:

I now have a Playmaker NGUI folder and a Playmaker NGUI Scripts folder. Should I be keeping both of these?

If so, should I also have both Playmaker NGUI Delegates and NGUI Playmaker Proxy in the scene? Does it matter where they are (root is ok?)

It appears that NGuiEventsToPlaymakerFsmEvents and NGuiEventForwarder both go on the NGUI button that will activate other GameObjects, is this correct? If not, am I still using both, and does one go somewhere else?

Thanks for the help!

Victor

MrAdventure

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Dragging NGUI Label or Button to GameObject fields
« Reply #3 on: December 26, 2013, 05:27:08 PM »
Hi Jean,

My above questions are still in my mind, but I wanted to update you with my current status.

I got the "green" connection on my button, and it seems to be connected to my FSM.

I am still unsure how to drag labels to the FSM. Specifically, I am trying to drag a Label over to an NGUI Update Label Text action. It still only gives me the Get Property and Set Property context menu. The field won't accept my Label.

Thanks again,

Victor

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Dragging NGUI Label or Button to GameObject fields
« Reply #4 on: December 30, 2013, 07:45:07 AM »
Hi,

"NguiUpdateLabelText" action works by itself and its game object property, that's where you define what game object it targets.

 dragging a ngui label component will prompt you with a "Get/Set property" wizard, but MAKE SURE you drag the component, not the gameobject, else it will target the gameobject itself and not the ngui label.


Bye,

 Jean

MrAdventure

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Dragging NGUI Label or Button to GameObject fields
« Reply #5 on: January 16, 2014, 12:01:15 PM »
Hi Jean,

I've been trying this for days, and just can't get it to work.

First, I have the purchased Playmaker NGUI Scripts asset from the store, as well as the package you said to install.

I don't get how the right click menu works. To work with a label, is the Property GUIText -> text?

But here's the weirdest part. I set up a new scene, but with the same Hierarchy. I dropped in NGUI Playmaker Proxy from your asset, and Playmaker NGUI Delegates from the asset store asset. I set everything up the same. Now, when I drag the label over to the action NGUI Label Set Text, it goes in the slot just fine! Back in my other scene, doing the same thing always pops up the context menu, even when I just want to use these other actions.

How can I use this without the context menu preventing me from accessing these other actions?

Thanks,

Victor

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Dragging NGUI Label or Button to GameObject fields
« Reply #6 on: January 30, 2014, 06:25:24 AM »
Hi,

 Are you sure you are using the latest ngui and latest playmaker bridge? can you double check that?

bye,

 Jean

MrAdventure

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Dragging NGUI Label or Button to GameObject fields
« Reply #7 on: February 14, 2014, 02:28:02 PM »
Hi Jean,

Sorry I didn't see this. I was using the latest, but by the point you posted I had already dropped NGUI and am now using Daikon Forge. They have a ton of Playmaker actions already made, and I'm finding it a lot more intuitive with Playmaker.

Thanks,

Victor