-
-
Notifications
You must be signed in to change notification settings - Fork 2
Data Gathering Helpers
eisclimber edited this page Feb 11, 2024
·
1 revision
static class in ExPresSXR.Experimentation.DataGathering
A bunch of helper functions for working with the DataGatherer and Reflections in Unity and C#.
-
readonly Dictionary<Type, string> primitiveTypeKeywords
: A mapping of types to their name of supported types for exporting with the DataGatherer.
The supported types are:bool, byte, char, decimal, double, float, int, long, sbyte, short, string, uint, ulong, ushort, Vector2, Vector3
andQuaternion
-
string ExtractComponentNumber(string compFullName, out int compNumber)
: Separates the component number from the provided component name.
Returns the name without the number and returns the component number to the out parameter. -
bool IsComponentMatch(Component component, string requiredFullName)
: Checks if the component matches the fully qualified name. -
bool sIsGameObjectBinding(string classFullName)
: Checks if a name is bound to a GameObject (and not a Component). -
bool AreParametersValid(MethodInfo methodInfo)
: Check if the parameters of a method can be used with the DataGatherer. Either no parameters, only optional or all optional but the first being a character (for the separator). -
bool IsTypeExportable(Type type)
: Checks if the MemberInfo is valid for data gathering. The requirements are:- All: Must be an exportable type
- Methods: Should not be of type void nor have any parameters and have no special name (e.g. auto-generated setters).
- Property: Valid if can be read.
- Fields: No additional requirements.
-
Type GetMemberValueType(MemberInfo info)
: Returns the (return-)type of the MemberInfo. -
bool HasSeparatorType(MethodInfo methodInfo)
: Checks if a method has parameters, the first is mandatory and of type char while the rest are optional (Does not guarantee validity!). -
bool HasOptionalSeparatorType(MethodInfo methodInfo)
: Checks if a method has only parameters and the first is of type char (Does not guarantee validity!). -
object[] GetMethodParameterValues(MethodInfo methodInfo, char sep)
: Generates an array with the default values for all parameters but inserts the separator character if possible. -
string GetPrettifiedMemberName(MemberInfo info)
: Generates a pretty name for a member, adding the members (return)type. If the member is a method, brackets are added including the notion for the optional separator char.
-
string GAME_OBJECT_FULL_NAME = "Game Object"
: Full name of the GameObject class. Used to differentiate Components and GameObjects.
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