Exemplo n.º 1
0
 /// <summary>
 /// On input field value changed
 /// </summary>
 /// <param name="currText">New text</param>
 void OnValueChanged(string currText)
 {
     text = currText;
     if (text == "")
     {
         SelectedOption = null;
         if (arrow == null)
         {
             isPanelActive = false;
             panel.gameObject.SetActive(isPanelActive);
         }
         else
         {
             RedrawPanel();
         }
     }
     else
     {
         isPanelActive = true;
         panel.gameObject.SetActive(isPanelActive);
         if (OnOpenPanel != null)
         {
             OnOpenPanel(this);
         }
         RedrawPanel();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// What happens when an item in the list is selected
        /// </summary>
        /// <param name="item"></param>
        void OnItemClicked(string item)
        {
            SelectedOption = AvailableOptions.Find(s => s.Name == item);
            OnSelectionChanged.Invoke(item);
            if (!resetAfterSelect)
            {
                text           = item;
                mainInput.text = item;
            }
            else
            {
                text = mainInput.text = "";
            }

            isPanelActive = false;
            panel.gameObject.SetActive(false);
        }