Пример #1
0
 public void Start()
 {
     mainGUID        = Guid.NewGuid().GetHashCode();
     buttonNeedsInit = true;
     InitButtons();
     myTimer = TimerFunctions.AddTimer();
     TimerFunctions.AddTimer();
 }
Пример #2
0
        public void MainWindow(int windowID)
        {
            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Start"))
            {
                TimerFunctions.StartTimer(myTimer);
            }
            if (GUILayout.Button("Lap"))
            {
                TimerFunctions.LapTimer(myTimer);
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Stop"))
            {
                TimerFunctions.StopTimer(myTimer);
            }
            if (GUILayout.Button("Reset"))
            {
                TimerFunctions.ResetTimer(myTimer);
            }
            GUILayout.EndHorizontal();
            Timer timer = timers[myTimer];

            GUILayout.Label("Current time: "
                            + timer.maintimer.Elapsed.Hours + ":" + timer.maintimer.Elapsed.Minutes + ":" + timer.maintimer.Elapsed.Seconds + "." + timer.maintimer.Elapsed.Milliseconds);
            scrollbar = GUILayout.BeginScrollView(scrollbar);
            for (int i = 0; i < timer.laptimes.Count; i++)
            {
                GUILayout.Label("Lap " + i + ": " + timer.laptimes[i]);
            }

            GUILayout.EndScrollView();
            GUILayout.Label("Final Time: " + timer.finaltime);
            GUILayout.EndVertical();
            GUI.DragWindow();
        }