Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: SeanP on December 03, 2014, 02:08:38 PM

Title: Unity UI addon error[SOLVED]
Post by: SeanP on December 03, 2014, 02:08:38 PM
I just imported the uGui addon from here https://hutonggames.fogbugz.com/default.asp?W1192

and get this after the scripts compile.

Code: [Select]
Assets/PlayMaker uGui/Proxies/PlayMakerUGuiComponentProxy.cs(257,57): error CS1061: Type `Button' does not contain a definition for `onClick' and no extension method `onClick' of type `Button' could be found (are you missing a using directive or an assembly reference?)
Title: Re: Unity UI addon error
Post by: Lane on December 03, 2014, 02:12:23 PM
Are you using 4.6.0f3?
Title: Re: Unity UI addon error
Post by: SeanP on December 03, 2014, 02:23:55 PM
5.0b15 actually.
Title: Re: Unity UI addon error
Post by: jeanfabre on December 03, 2014, 03:19:49 PM
Hi,

 Yes, the 5 cycle will implement 4.6 UI version in time, currently it's out of synch. It's really an issue with maintenance. So Currently, I think it's important that we support what's considered final version, which is the current 4.6.

I am doing more videos tomorrow morning on uGui, I'll see if I can comply with the latest 5 version.

 Bye,

 Jean
Title: Re: Unity UI addon error
Post by: Vecna on January 07, 2015, 04:00:12 AM
I'm getting the same error with 4.6.1f1, any workaround for this?
Title: Re: Unity UI addon error
Post by: jeanfabre on January 07, 2015, 07:14:45 AM
Hi,

 That's odd. I tested on a fresh project using unity 4.6.1f1, playmaker 1.7.7f6 and the package from the wiki and all is well. I don't get this error when working with buttons.

 Can you paste the exact error you have on your project? maybe it's slightly different?

Are triple sure that you are on Unity 4.6? Sean was on Unity 5 when he had this error.


 Bye,

 Jean
Title: Re: Unity UI addon error
Post by: Vecna on January 07, 2015, 07:59:24 AM
Hi Thanks much for your help! I was on 4.6.0 last night and got 2 errors so I updated to 4.6.1f1

Here is my exact error. Maybe I must reiport the package from the wiki?

Code: [Select]
Assets/PlayMaker uGui/Proxies/PlayMakerUGuiComponentProxy.cs(257,57): error CS1061: Type `Button' does not contain a definition for `onClick' and no extension method `onClick' of type `Button' could be found (are you missing a using directive or an assembly reference?)
Title: Re: Unity UI addon error
Post by: Vecna on January 07, 2015, 08:57:14 AM
Weird when I open a new project and import the package from the wiki it works.

How can I fix it on my current project?
Title: Re: Unity UI addon error
Post by: jeanfabre on January 07, 2015, 09:28:30 AM
Hi,

 Delete the whole "PlayMaker uGui" folder, that should do it.

 Bye,

 Jean
Title: Re: Unity UI addon error
Post by: Vecna on January 07, 2015, 10:23:34 AM
Quote
Delete the whole "PlayMaker uGui" folder

Didn't work  :-[
Title: Re: Unity UI addon error
Post by: Vecna on January 07, 2015, 11:06:39 AM
I deleted the Playmaker uGUI and Playtmaer utils folder.

I also deleted my Library folder with no luck.
Title: Re: Unity UI addon error
Post by: Alex Chouls on January 07, 2015, 11:41:36 AM
Maybe you have a class in your project that defines "Button" in the global namespace. What other middleware are you using in the project?
Title: Re: Unity UI addon error
Post by: Vecna on January 07, 2015, 01:15:38 PM
Only Control Freak and Rain and I have imported them in a new project with playmaker gui proxy and no errors. Could it be a model?

How can I test what causes the problem?
Title: Re: Unity UI addon error
Post by: Lane on January 07, 2015, 01:20:08 PM
If its a script causing it, try searching in the project hierarchy for "Button" and see if there are multiple scripts named that. It could be the Standard UI example package from UT or something. With a name that generic, it could be any of a lot of different packages. This happened with Mecanim when everyone named their controller "Locomotion"....
Title: Re: Unity UI addon error
Post by: Vecna on January 08, 2015, 02:22:25 AM
Got it working. It was a particle package that had a button script.

Thank you so much for all your help.
Title: Re: Unity UI addon error[SOLVED]
Post by: SteveB on January 08, 2015, 10:24:41 AM
I'm getting this exact same issue but with 'AI for Mecanim' (and the uGUI addon for Playmaker); several button capture scripts have identical names for example, such as GetButton.cs...

...so with namespace conflicts like this what is the safest solution?

The error is:

Assets/PlayMaker uGui/Proxies/PlayMakerUGuiComponentProxy.cs(257,57): error CS1061: Type `Button' does not contain a definition for `onClick' and no extension method `onClick' of type `Button' could be found (are you missing a using directive or an assembly reference?)

Thanks guys

EDIT:

Also yes, deleting /Playmaker uGUI fixes the issue, I want to be able to use Playmaker uGUI so...

Title: Re: Unity UI addon error[SOLVED]
Post by: jeanfabre on January 12, 2015, 01:58:20 AM
Hi,

 yeah, let me address this. You have a good case here.

Can you import the package attached, it's just this script with a different way to get to the Unity UI, and I think it will make this kind of conflict less likely.

 If that works, I'll spread this change on the github rep.

 Bye,

 Jean
Title: Re: Unity UI addon error[SOLVED]
Post by: SteveB on January 12, 2015, 08:16:58 AM
That appears to have done it, or at the very least I receive no errors now. :D

Good job yet again Jean!

-Steven