VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
AVRUI_TMPInputField_PlusMinus.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using UnityEngine.UI;
5 
6 namespace AVR.UI.Utils {
7  /// <summary>
8  /// Inputfield that the value of which can be increased/decreased by function call. The value of the inputfield ought to be numerical.
9  /// </summary>
10  [AVR.Core.Attributes.DocumentationUrl("class_a_v_r_1_1_u_i_1_1_utils_1_1_a_v_r_u_i___input_field___plus_minus.html")]
11  public class AVRUI_TMPInputField_PlusMinus : AVR.Core.AVR_Behaviour
12  {
13  public float increase_amount = 0.1f;
14  public float decrease_amount = 0.1f;
15 
16  private TMPro.TMP_InputField input;
17 
18  void Awake() {
19  input = GetComponent<TMPro.TMP_InputField>();
20  }
21 
22  public void increase_value() {
23  input.text = (float.Parse(input.text) + increase_amount).ToString();
24  }
25 
26  public void decrease_value() {
27  input.text = (float.Parse(input.text) - decrease_amount).ToString();
28  }
29  }
30 }
Sets the documentation html file inside of Packages/com.avr.core/Documentation/html of a given class...
Inputfield that the value of which can be increased/decreased by function call. The value of the inpu...