- Home /
dropdown menu PopupList c# problem
Hi,
Note: I always code in UnityScript, so I am aware that this can be solved very easily.
I am trying to use this wiki scripts in order to do a dropdown menu.
I have the Popup.cs and the PopupListUsageExample.js script in my Assets/Scripts folder
So, I am attaching the PopupListUsageExample.js to a gameObject in my Hierarchy, but:
1.- When I try to atttach the Popup.cs to the same gameobject I get the following error: "Can't add script behaviour Popup. The script needs to derive from MonoBehaviour!"
2.- And if I try to run the Scene (without the Popup.cs attached) I get the foolowing error: "Assets/Scripts/SimulatorSelect.js(31,9):BCE0005: Unknown identifier: 'Popup'."
Any answer will be very helpful.
Thanks in advance.
Answer by DaveA · Apr 26, 2011 at 07:07 AM
I remember having to put popup.cs in the /Assets/Plugins folder
Thank you very much, without your help would be impossible since in the ussage it is said that you should put it in the Scripts folder...
Well, Eric5h5 is right, it should go in Assets/StandardAssets/Scripts, but I probably made the same mistake others here made, and moved it to Plugins as an act of desperation.
Answer by Eric5h5 · Apr 26, 2011 at 07:36 AM
You need to pay attention to the usage directions. This is what it actually says: "Put the Popup.cs script below in your Standard Assets/Scripts folder (if you don't have one, make one)." It clearly does not say to put it in your Assets folder. It will work if you read the directions and follow them. See the docs for more information.
And I said "I have the Popup.cs and the PopupListUsageExample.js script in my Assets/Scripts folder" so I carefully followed the instructions... (maybe I misunderstood...)
@Uzquiano: Sorry, but you're not carefully following directions. Again, Standard Assets, not Assets...that's a big difference....
Answer by warren- · Dec 16, 2014 at 09:35 PM
http://wiki.unity3d.com/index.php?title=PopupList
"Popup.cs" can go in either
"Assets/Standard Assets/Scripts/"
or
"Assets/Plugins/"
the javascript example must go in "Assets/"
It will also throw the: Unknown identifier: 'Popup' error if you are using the Updated and Multi-Instance support when using the wiki's provided javascript example.
The reason is because the updated version uses different parameters for the Popup call. The multi-instance version won't work for similar reasons, as well that its not static.
I don't have any code to support it, but that should clear up that issue.
Your answer
Follow this Question
Related Questions
Dropdown button... 0 Answers
Native Picker Wheel - iOS UI 0 Answers
GUI Popup problem…! 1 Answer
GenericMenu DropDown Direction 1 Answer
C# Editor GUI custom list type PopUp return string and not int 1 Answer