VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
override void AVR.UI.Link.AVRUI_Link_Dropdown.updateOutput ( )
inlinevirtual

Method is run continously from OnGUI. This method should update the value displayed by the UI when the target value changes.

Implements AVR.UI.Link.AVRUI_Link.

Definition at line 86 of file AVRUI_Link_Dropdown.cs.

87  {
88  // Do nothing if the user is still typing the value
89  int current_value = 0;
90 
91  switch (memberType)
92  {
93  case MemberType.FIELD:
94  {
95  current_value = (int)target.GetType().GetField(field).GetValue(target);
96  break;
97  }
98  case MemberType.PROPERTY:
99  {
100  current_value = (int)target.GetType().GetProperty(field).GetValue(target);
101  break;
102  }
103  }
104 
105  input.value = current_value;
106 
107 #if UNITY_EDITOR
108  if (old_value != current_value.ToString() && !Application.isPlaying)
109  {
110  EditorUtility.SetDirty(input);
111  old_value = current_value.ToString();
112  }
113 #endif
114  }