aboutsummaryrefslogtreecommitdiff
path: root/Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/ForceSliderToPowerOf2.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@gmail.com>2019-11-03 18:31:04 -0500
committerAndrew Lee <alee14498@gmail.com>2019-11-03 18:31:04 -0500
commite8dd5d4fd406e6e6b710cbe85309f6870bccc37a (patch)
treedb0e99cfdbefb1625d66d07631f43565ae8ff41f /Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/ForceSliderToPowerOf2.cs
parent20b14c9a89821e6592bf25bed9329a5abe20495c (diff)
downloadUnicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.tar.gz
Unicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.tar.bz2
Unicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.zip
Remove everything
Diffstat (limited to 'Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/ForceSliderToPowerOf2.cs')
-rw-r--r--Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/ForceSliderToPowerOf2.cs85
1 files changed, 0 insertions, 85 deletions
diff --git a/Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/ForceSliderToPowerOf2.cs b/Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/ForceSliderToPowerOf2.cs
deleted file mode 100644
index 55de574..0000000
--- a/Assets/Packages/Tayx/Graphy - Ultimate Stats Monitor/Scene/Customization Scripts/ForceSliderToPowerOf2.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ---------------------------------------
- * 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
-{
- public class ForceSliderToPowerOf2 : 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 could make the "m_powerOf2Values" constant.
- * 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 int[] m_powerOf2Values =
- {
- 128,
- 256,
- 512,
- 1024,
- 2048,
- 4096,
- 8192
- };
-
- private Text m_text;
-
- #endregion
-
- #region Methods -> Unity Callbacks
-
- void Start()
- {
- m_slider.onValueChanged.AddListener(UpdateValue);
- }
-
- #endregion
-
- #region Methods -> Private
-
- private void UpdateValue(float value)
- {
- int closestSpectrumIndex = 0;
- int minDistanceToSpectrumValue = 100000;
-
- //TODO: Put the int cast outside of the loop.
- for (int i = 0; i < m_powerOf2Values.Length; i++)
- {
- int newDistance = Mathf.Abs((int)value - m_powerOf2Values[i]);
- if (newDistance < minDistanceToSpectrumValue)
- {
- minDistanceToSpectrumValue = newDistance;
- closestSpectrumIndex = i;
- }
- }
-
- m_slider.value = m_powerOf2Values[closestSpectrumIndex];
- }
-
- #endregion
- }
-} \ No newline at end of file