Tanoda
TaktTimeHelper.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6public class TaktTimeHelper : MonoBehaviour
7{
8
9 public Text actionName;
10 public GameObject TaktTimeWindow;
11 public Text takt, spent;
13
14 //public void onTimeChanged(string value)
15 //{
16 // if (actionObject)
17 // {
18 // var currentUserValue = UserManager.instance.GetUserByName(SavedUser.instance.currentUser.Value.Username);
19 // var currentTrainingName = SavedUser.instance.levelName;
20 // List<UserManager.Training> currentTrainings = new List<UserManager.Training>();
21 // var allTraining = currentUserValue.trainings;
22 // foreach (var training in allTraining)
23 // {
24 // if (training.Name == currentTrainingName) currentTrainings.Add(training);
25
26 // }
27 // var lastTraining = currentTrainings[currentTrainings.Count - 1];
28 // for (int i = 0; i < lastTraining.Actions.Count; i++)
29 // {
30 // if (lastTraining.Actions[i].actionName == actionObject.name)
31 // {
32 // var action = lastTraining.Actions[i];
33 // lastTraining.Actions.RemoveAt(i);
34 // lastTraining.Actions.Add(new UserManager.VRAction(){timeSpent = action.timeSpent, timeRecognition = action.timeRecognition, actionType = action.actionType, penaltyTime = action.penaltyTime, actionName = action.actionName, taktTime = float.Parse(value)});
35
36 // }
37 // }
38 // actionObject.taktTime = float.Parse(value);
39
40 // UserManager.instance.UpdateUser(currentUserValue);
41 // }
42 //}
43
44 public void deleteAllRow()
45 {
46 var rows = transform.parent.GetComponentsInChildren<TaktTimeHelper>(true);
47 for (int i = 1; i < rows.Length; i++)
48 {
49 Destroy(rows[i].gameObject);
50 }
51 }
52}
GameObject TaktTimeWindow
ActionObject actionObject