// Initializes everything void Start() { trackerInserted = false; trackedObj = GetComponent <SteamVR_TrackedObject>(); mText = screen.GetComponent <Text>(); modifiable = false; running = false; // Creates a stack containing all of the WSAP states and then shuffles the stack. states = new Stack <WSAPEnum>(); for (var WSAPState = WSAPEnum.Trial0; WSAPState != WSAPEnum.END; WSAPState = WSAPState.next()) { states.Push(WSAPState); } var rnd = new System.Random(); states = new Stack <WSAPEnum>(states.OrderBy(x => rnd.Next())); reactionTimer = System.Diagnostics.Stopwatch.StartNew(); // This is so only one session is created upon a WSAP scene. if (!createdSession) { DatabaseInserts.CreateSession(Constants.WSAP_SCENEID); createdSession = true; } data = new List <WSAPAnswerData>(); }
// Create a list of NPCStates, one for each audio source. Audio delays aren't implemented yet, standard of 1f for all. Every trigger plays on "Next". // Initialize the initial question and prompt states as well as the stateController. stateController is hardcoded. void Start() { reactionTimer = System.Diagnostics.Stopwatch.StartNew(); curAnimator = markNPC.GetComponent <Animator>(); NPCIndex = 0; NPCStates = new List <NPCState>(); foreach (var audio in audioSources) { NPCStates.Add(new NPCState(audio, "Next", 1f)); } questionState = BasicQuestionsEnum.Question0; promptState = BasicPromptEnum.Prompt0; // The sequence that the states will progress in. questionState and promptState will be changing too so this just controls whether a prompt or question will appear. stateIndex = 0; stateController = new List <string> { "Prompt", "Question", "Prompt", "Question", "Prompt", "Question", "Prompt", "Prompt", "Question", "Prompt", "Question", "Prompt", "Question" }; Debug.Log("NPCStates size: " + NPCStates.Count); running = true; countDownTimer = new System.Diagnostics.Stopwatch(); DatabaseInserts.CreateSession(Constants.BASIC_SCENEID); data = new List <BasicAnswerData>(); }
// Initializes everything. void Start() { SPINState = SPINEnum.Question0; DASSState = DASSEnum.Question0; DatabaseInserts.CreateSession(Constants.SURVEYS_SCENEID); reactionTimer = System.Diagnostics.Stopwatch.StartNew(); data = new List <SurveyAnswerData>(); }