diff options
| author | Alee <Alee14498@gmail.com> | 2019-06-09 13:18:33 -0400 |
|---|---|---|
| committer | Alee <Alee14498@gmail.com> | 2019-06-09 13:18:33 -0400 |
| commit | 9ef63b49ccc6636d8c1bb5f1e04a2f22587d5487 (patch) | |
| tree | 208a2e51d7723694fd2b411583fe858e511c3b1a /Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/UpdateTextWithSliderValue.cs | |
| parent | 902b1f4e758d85fe5c30a316acf0366ed6bcb297 (diff) | |
| download | Unicity-9ef63b49ccc6636d8c1bb5f1e04a2f22587d5487.tar.gz Unicity-9ef63b49ccc6636d8c1bb5f1e04a2f22587d5487.tar.bz2 Unicity-9ef63b49ccc6636d8c1bb5f1e04a2f22587d5487.zip | |
Added Graphy
Diffstat (limited to 'Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/UpdateTextWithSliderValue.cs')
| -rw-r--r-- | Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/UpdateTextWithSliderValue.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/UpdateTextWithSliderValue.cs b/Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/UpdateTextWithSliderValue.cs new file mode 100644 index 0000000..3f2be53 --- /dev/null +++ b/Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/UpdateTextWithSliderValue.cs @@ -0,0 +1,62 @@ +/* --------------------------------------- + * Author: Martin Pane (martintayx@gmail.com) (@tayx94) + * Collaborators: Lars Aalbertsen (@Rockylars) + * Project: Graphy - Ultimate Stats Monitor + * Date: 05-Mar-18 + * Studio: Tayx + * + * This project is released under the MIT license. + * Attribution is not required, but it is always welcomed! + * -------------------------------------*/ + +using UnityEngine; +using UnityEngine.UI; + +using System.Collections; + +namespace Tayx.Graphy.CustomizationScene +{ + [RequireComponent(typeof(Text))] + public class UpdateTextWithSliderValue : MonoBehaviour + { + /* ----- TODO: ---------------------------- + * Check if we can seal this class. + * Add summaries to the variables. + * Add summaries to the functions. + * Check if we can remove "using System.Collections;". + * Check if we should add "private" to the Unity Callbacks. + * --------------------------------------*/ + + #region Variables -> Serialized Private + + [SerializeField] private Slider m_slider = null; + + #endregion + + #region Variables -> Private + + private Text m_text; + + #endregion + + #region Methods -> Unity Callbacks + + void Start() + { + m_text = GetComponent<Text>(); + + m_slider.onValueChanged.AddListener(UpdateText); + } + + #endregion + + #region Methods -> Private + + private void UpdateText(float value) + { + m_text.text = value.ToString(); + } + + #endregion + } +}
\ No newline at end of file |
