PlayerStats.cs 1.6 KB

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