Hello! I tried reading through the NGUI documentation and past forum threads, but I can't seem to understand how to get UIPopupList to execute a function when a value is selected. I can show you what I have tried:
using UnityEngine;
using System.Collections;
public class ShamanBaseScript : MonoBehaviour {
public UIPopupList popUP;
void Update () {
if (popUP.value == "Add 1 Mana") {
transform.rotation = Quaternion.Euler (0, 0, -90);
}
}
All I'm trying to do is say: When you select the 'Add 1 Mana' option in the popup list turn the object -90 degrees. I feel as though there is something I'm missing. Past threads have spoken about OnSelectionChange(); and onChange but I have no idea how to implement these. I would really appreciate a simple example. Thank you!