TimeChunk.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ObjectScripts;
  5. using CSVReader;
  6. using System.Globalization;
  7. namespace UIScripts
  8. {
  9. public class TimeChunk : MonoBehaviour
  10. {
  11. ///<summary>
  12. /// Inputfield for timeinterval
  13. ///</summary>
  14. [SerializeField] UnityEngine.UI.InputField ChunkStartInputField;
  15. ///<summary>
  16. /// Inputfield for timeinterval
  17. ///</summary>
  18. [SerializeField] UnityEngine.UI.InputField ChunkEndInputField;
  19. ///<summary>
  20. /// Manager to control
  21. ///</summary>
  22. [SerializeField] AbstractManager ManagerObject;
  23. ///<summary>
  24. /// On StartInputfield edited
  25. ///</summary>
  26. public void ChunkStartInputFieldEndEdit()
  27. {
  28. double startValue = double.Parse(ChunkStartInputField.text, NumberStyles.Float);
  29. this.ManagerObject.SetChunkStarttimestamp(startValue);
  30. }
  31. ///<summary>
  32. /// On EndInputField edited
  33. ///</summary>
  34. public void ChunkEndInputFieldEndEdit()
  35. {
  36. double endValue = double.Parse(ChunkEndInputField.text, NumberStyles.Float);
  37. this.ManagerObject.SetChunkEndtimestamp(endValue);
  38. }
  39. }
  40. }