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

77  {
78  // Do nothing if the user is still typing the value
79  if(input.isFocused) return;
80 
81  object current_value = null;
82 
83  switch (memberType)
84  {
85  case MemberType.FIELD:
86  {
87  current_value = target.GetType().GetField(field).GetValue(target);
88  break;
89  }
90  case MemberType.PROPERTY:
91  {
92  current_value = target.GetType().GetProperty(field).GetValue(target);
93  break;
94  }
95  }
96 
97  input.text = current_value.ToString();
98 
99 #if UNITY_EDITOR
100  if (old_value != current_value.ToString() && !Application.isPlaying)
101  {
102  EditorUtility.SetDirty(input);
103  old_value = current_value.ToString();
104  }
105 #endif
106  }