예제 #1
0
 void OnListItemUnselected(ComboBox.ComboItem unselectedItem)
 {
     if (selectedHost == (HostData)unselectedItem.value)
     {
         selectedHost = null;
     }
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     cb = new ComboBox();
     style = new GUIStyle();
     foreach(Transform child in this.transform) {
         ComboBox.ComboItem childItem = new ComboBox.ComboItem(child.name, child);
         childItem.OnMarkedAction += SelectItem;
         childItem.OnUnMarkedAction += DeselectItem;
         cb.AddItem(childItem);
     }
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     cb    = new ComboBox();
     style = new GUIStyle();
     foreach (Transform child in this.transform)
     {
         ComboBox.ComboItem childItem = new ComboBox.ComboItem(child.name, child);
         childItem.OnMarkedAction   += SelectItem;
         childItem.OnUnMarkedAction += DeselectItem;
         cb.AddItem(childItem);
     }
 }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     //Check for an updated list, and refresh the items in the list when we have one.
     if (hostsUpdated)
     {
         hostsUpdated = false;
         hostList.Clear();
         foreach (HostData hostdata in hosts)
         {
             ComboBox.ComboItem item = hostList.AddItem(hostdata.gameName, hostdata, OnListItemSelected, OnListItemUnselected);
             //Maintain our selected host, even through a wipe and refresh
             //Would want to implement a more robust comparison between selectedHost and hostdata
             if (selectedHost != null && hostdata.gameName == selectedHost.gameName && hostdata.ip[0].Equals(selectedHost.ip[0]))
             {
                 item.Mark();
                 selectedHost = hostdata;
             }
         }
     }
 }
예제 #5
0
파일: Raycaster.cs 프로젝트: paulate/tadcad
 void OnLayerUnselected(ComboBox.ComboItem item)
 {
     layerMask = layerMask & ~(1 << (int)item.value);
 }
예제 #6
0
 void OnListItemSelected(ComboBox.ComboItem selectedItem)
 {
     selectedHost = (HostData)selectedItem.value;
 }
예제 #7
0
 void DeselectItem(ComboBox.ComboItem item)
 {
     //Move the item down so we can see it's not selected
     ((Transform)item.value).Translate(0, -1, 0);
 }
예제 #8
0
 void SelectItem(ComboBox.ComboItem item)
 {
     //Move the item up so we can see it's selected
     ((Transform)item.value).Translate(0, 1, 0);
 }