Beispiel #1
0
 void Update()
 {
     if (nav == null)
     {
         nav = FindObjectOfType <UnityEngine.Camera>().GetComponent <VtsNavigation>().Navigation;
         return;
     }
     if (map.GetMapconfigAvailable() && map.GetSearchable())
     {
         input.interactable = true;
         // the check method will update the results list if the data are already available
         if (task != null && task.Check())
         {
             dropDown.options.Clear();
             results.Clear();
             foreach (string sr in task.results)
             {
                 Item it = JsonUtility.FromJson <Item>(sr);
                 results.Add(it);
                 Dropdown.OptionData o = new Dropdown.OptionData(it.title);
                 dropDown.options.Add(o);
             }
             dropDown.value        = -1;
             dropDown.interactable = true;
             task = null;
         }
     }
 }
 void Update()
 {
     if (map.map.GetMapConfigAvailable() && map.map.GetSearchable())
     {
         input.interactable = true;
         // the check method will update the results list if the data are already available
         if (task != null && task.Check())
         {
             dropDown.options.Clear();
             results.Clear();
             foreach (string sr in task.results)
             {
                 Item it = JsonUtility.FromJson <Item>(sr);
                 results.Add(it);
                 Dropdown.OptionData o = new Dropdown.OptionData(it.displayName);
                 dropDown.options.Add(o);
             }
             dropDown.value        = -1;
             dropDown.interactable = true;
             task = null;
         }
     }
 }