PlayerStats.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. public float rotationPolarX;
  15. public float rotationPolarY;
  16. public float rotationPolarZ;
  17. // Start is called before the first frame update
  18. void Start()
  19. {
  20. collisionCounter = 0;
  21. coinCounter = 0;
  22. hasFinished = -1;
  23. hasFinishedSlalom1 = -1;
  24. hasFinishedSlalom2 = -1;
  25. participantId = "";
  26. rotationPolarX = 0f;
  27. rotationPolarY = 0f;
  28. rotationPolarZ = 0f;
  29. }
  30. // Update is called once per frame
  31. void Update()
  32. {
  33. }
  34. public void SetCondition(Study.SteeringMode selection)
  35. {
  36. switch (selection)
  37. {
  38. case Study.SteeringMode.frontWheel:
  39. condition = "frontWheel";
  40. break;
  41. case Study.SteeringMode.Leaning:
  42. condition = "Leaning";
  43. break;
  44. case Study.SteeringMode.HMD:
  45. condition = "HMD";
  46. break;
  47. }
  48. }
  49. public void SetWaypointPassed(WaypointType type)
  50. {
  51. switch (type)
  52. {
  53. case WaypointType.slalom1:
  54. hasFinishedSlalom1 = 1;
  55. break;
  56. case WaypointType.slalom2:
  57. hasFinishedSlalom2 = 1;
  58. break;
  59. case WaypointType.finish:
  60. hasFinished = 1;
  61. break;
  62. }
  63. }
  64. public void SetParticipantID(string id)
  65. {
  66. participantId = id;
  67. }
  68. public void IncreaseCollisionCounter()
  69. {
  70. collisionCounter += 1;
  71. }
  72. public void IncreaseCoinCounter()
  73. {
  74. coinCounter += 1;
  75. }
  76. }