PlayerStats.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using Study;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class PlayerStats : MonoBehaviour
  6. {
  7. public int collisionCounter;
  8. public int coinCounter;
  9. public string condition;
  10. public int hasFinished;
  11. public int hasFinishedSlalom1;
  12. public int hasFinishedSlalom2;
  13. public string participantId;
  14. // Start is called before the first frame update
  15. void Start()
  16. {
  17. collisionCounter = 0;
  18. coinCounter = 0;
  19. hasFinished = -1;
  20. hasFinishedSlalom1 = -1;
  21. hasFinishedSlalom2 = -1;
  22. participantId = "";
  23. }
  24. // Update is called once per frame
  25. void Update()
  26. {
  27. }
  28. public void SetCondition(Study.SteeringMode selection)
  29. {
  30. switch (selection)
  31. {
  32. case Study.SteeringMode.frontWheel:
  33. condition = "frontWheel";
  34. break;
  35. case Study.SteeringMode.Leaning:
  36. condition = "Leaning";
  37. break;
  38. case Study.SteeringMode.HMD:
  39. condition = "HMD";
  40. break;
  41. }
  42. }
  43. public void SetWaypointPassed(WaypointType type)
  44. {
  45. switch (type)
  46. {
  47. case WaypointType.slalom1:
  48. hasFinishedSlalom1 = 1;
  49. break;
  50. case WaypointType.slalom2:
  51. hasFinishedSlalom2 = 1;
  52. break;
  53. case WaypointType.finish:
  54. hasFinished = 1;
  55. break;
  56. }
  57. }
  58. public void SetParticipantID(string id)
  59. {
  60. participantId = id;
  61. }
  62. public void IncreaseCollisionCounter()
  63. {
  64. collisionCounter += 1;
  65. }
  66. public void IncreaseCoinCounter()
  67. {
  68. coinCounter += 1;
  69. }
  70. }