VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
override void AVR.UI.Link.AVRUI_Link_TMPDropdown.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 85 of file AVRUI_Link_TMPDropdown.cs.

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