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

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