SubjectManager.cs 543 B

1234567891011121314151617181920
  1. using System;
  2. using UnityEngine;
  3. namespace Study
  4. {
  5. public class SubjectManager : MonoBehaviour
  6. {
  7. public string subjectIdentifier;
  8. private void OnEnable()
  9. {
  10. if (string.IsNullOrEmpty(subjectIdentifier))
  11. throw new Exception("You have to specify a subject for the experiment!");
  12. var bikePlayer = GameObject.Find("bike");
  13. var playerStats = bikePlayer.GetComponent<PlayerStats>();
  14. playerStats.SetParticipantID(subjectIdentifier);
  15. }
  16. }
  17. }