I'm still very much a newbie to NGUI (I started using it half way through release 2.7) and still relatively green with scripting in C#. But I have found the tutorials helpful and for the most part, I think I've got some very basic aspects of the EventDelegate figured out to do most of what I want it to do.
However, I cannot find any good deep tutorial on the pop up menu using EventDelegate. (Tutorial 11 is the only one which is not selectable on the tasharen website... it's grayed out)
I am trying to just send a simple custom command to another game object based on a list item selection in the pop up menu and I can't find anything describing the new way of doing that. The only way I am somewhat familiar with, is using OnSelectionChange and passing a string into the receiver based on the line item name. I got it to work just fine in 2.7.
Now in 3.0, in the inspector, when I have my popup menu selected, I can see my menu item names inside the UIPopup List widget. There is a white warning that says "This popup list has no label to update, so it will behave like a menu."
Menu Option 0
Menu Option 1
Menu Option 2
default, position, localized (I leave localized not checked).
Below that is the Appearance widget and below that is an "On Value Change" widget. Inside On Value Change is a window for Notify, which I assume, is meant for the receiver. So I plug my receiver into it (see code below that is on my receiver). It now gives me a pulldown for "Method" and inside the pulldown I see <Choose>. Clicking on the <choose> pulldown reveals no possible selections even though my receiver script is in fact on my receiver. I have never been able to see any methods in this pulldown. My receiver is an empty game object with this script on it.
I kept the script super simple. This is all I want to be able to do from the items in the pulldown menu:
using UnityEngine;
using System.Collections;
public class PulldownMenuReceiver : MonoBehaviour
{
void OnSelectionChange (string val)
{
switch (val)
{
case "Menu Option 0":
Debug.Log ("I hit 0");
break;
case "Menu Option 1":
Debug.Log ("I hit 1");
break;
case "Menu Option 2":
Debug.Log ("I hit 2");
break;
}
}
}
I get no errors. But I get no debug registering in the log either.
All I want to be able to do is customize the list names to each do a separate thing when they are clicked (touched).
What am I missing here?