neuecc / UniRx

Reactive Extensions for Unity
MIT License
7.1k stars 889 forks source link

Compile errors on Unity5.0.0.f4 #55

Closed joaomcarlos closed 9 years ago

joaomcarlos commented 9 years ago

Hello.

I got compile errors on Unity5.0.0.f4, in both examples as well in other places where onButtonClick is used.


Assets/UniRx/Scripts/UnityEngineBridge/UnityUIComponentExtensions.cs(35,27): error CS1061: Type Button' does not contain a definition foronClick' and no extension method onClick' of typeButton' could be found (are you missing a using directive or an assembly reference?)


I just imported the package, its same in the package from asset store and from github directly.

neuecc commented 9 years ago

Button is in UnityEngine.UI and Button has onClick.

https://bitbucket.org/Unity-Technologies/ui/src/fd5d3578da8c33883b7c56dd2b2f4d4bbc87095b/UnityEngine.UI/UI/Core/Button.cs?at=4.6#cl-24

Hmn..., What is your project's target platform?

joaomcarlos commented 9 years ago

Currently is set to MacOSX x86_64

neuecc commented 9 years ago

I think error message tell UnityEngine.UI.Button doesn't have onClick event. But of course Button has onClick.

Can you see Button's metadata at MonoDevelop(or XamarinStudio)?

2015-04-02 21_23_12-unityvs unirx - microsoft visual studio

Here is my metadata on Visual Studio(Windows)

movrajr commented 9 years ago

I cannot reproduce this issue.

But I have noticed some things:

joaomcarlos commented 9 years ago

After hours of searching, I actually found out that I had another class named Button, it was a class that was a Monobehavior that helped me with setting button names and labels from a single position, literary a public string that ran in editor to update the transform.name to "Button: "+btnName and label to btnName.

And somehow it was using that instead of UI.Button.

Sorry to waste your time and mine.

neuecc commented 9 years ago

I'm happy to hear that.

//

Thank you movajr, Yes, I use Unity 5 Pro... I'll check free edition and will test .unitypackage next update.

movrajr commented 9 years ago

Switching between Pro and Personal can be done by replacing the Unity_v5.x.ulf in C:\ProgramData\Unity. Running scenes created with licenseType:Pro in Unity Personal doesn't cause any errors.

Seems to be mainly a legal issue (or non-issue, it's confusing) when mixing licenses within a single company. See: http://forum.unity3d.com/threads/unity-heads-caveats-of-license-changes-need-clarity-title-changed-to-prove-its-a-serious-thread.310275/