-
-
Notifications
You must be signed in to change notification settings - Fork 2
Quiz Utility
eisclimber edited this page Feb 11, 2024
·
2 revisions
static class in ExPresSXR.Interaction.ButtonQuiz
Helper class for the button quiz.
-
int[] GenerateIdentityArray(int length)
: Generates an array with size equallength
where every element holds its index, i.e. [0, 1, 2, ..., length] -
int[] Shuffle(int[] array)
: Returns a shuffled copy of the given array. Uses a Fisher-Yates-Shuffle. -
int GetNumAnswersForQuestion(ButtonQuizConfig config, ButtonQuizQuestion question)
: Returns the number of answers for a question. -
int[] GetAnswerPermutation(ButtonQuizConfig config, ButtonQuizQuestion question)
: Get a permutation of the valid answers of a question. Indices of unused answer indices will be set to -1. -
T[] PermuteArray<T>(T[] array, int[] permutation)
: Permutes an array using the given permutation as indices. Both arrays must be of same length.
Entries in the permutation array < 0 will be ignored and null/default entries will be added. -
string MakeStreamingAssetsVideoPath(string filePath)
: Converts a relative path to a StreamingAssets-Path whilst ensuring the path refers to an.mp4
or.mov
video file. -
string GameObjectArrayToNameString(GameObject[] objects, char sep = ',')
: Converts a GameObject to a array representation using the GameObjects name or an empty string. -
bool[] ExtractButtonPressStates(QuizButton[] buttons)
: Converts an array of QuizButtons to a bool array representing their pressed states. Null-Buttons are considered not pressed. -
int FirstIndexTrue(bool[] pressedStates)
: Extracts the first index where an entry is true. Returns -1 if none is true. -
AllEntriesTrue(bool[] values)
: Checks if all values are true. -
bool ArrayMatch(bool[] a, bool[] b)
: Checks if bth arrays are equal regarding their elements. Can be used to check if a question was answered completely right or wrong. -
float SelectedButtonMaxTriggerTime(QuizButton[] buttons)
: Returns the maximum trigger time of pressed QuizButtons. If none is pressed or the array is empty, returns -1.0f.
Autor: Luca 'eisclimber' Dreiling; License: MIT
- Getting Started
- Development and Contribution
- Misc
- Experimentation
- Data Gatherering
- Eye Tracking
- ExPresS XR Rig
- Interaction
- Base Button
- Button Quiz
- Collision Hand Rumbler
- Collision Sound Emitter
- Exit Game Interactable (Script Deprecated)
- Interactables
- Haptic Impulse Trigger
- Socket Interactors
- Inverse Kinematics
- Localization
- Minigames
- Coin Scale
- Coin Throw
- Sword Cleaning
- Misc
- Movement
- Presentation
- UI