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

72  {
73  float current_value = 0f;
74 
75  switch (memberType)
76  {
77  case MemberType.FIELD:
78  {
79  current_value = (float)target.GetType().GetField(field).GetValue(target);
80  break;
81  }
82  case MemberType.PROPERTY:
83  {
84  current_value = (float)target.GetType().GetProperty(field).GetValue(target);
85  break;
86  }
87  }
88 
89  input.value = current_value;
90 
91 #if UNITY_EDITOR
92  if (old_value != current_value.ToString() && !Application.isPlaying)
93  {
94  EditorUtility.SetDirty(input);
95  old_value = current_value.ToString();
96  }
97 #endif
98  }