Skip to content

Data Gathering Binding

eisclimber edited this page Apr 20, 2024 · 3 revisions

Data Gathering Binding

class in ExPresSXR.Experimentation.DataGathering

Description

A class to represent a binding of a value from some GameObject's Component to be used by DataGatherer. The values can be either return values of public functions or public members. Using reflections these values will automatically be read when data is required to be exported.

Members

Constructors

  • DataGatheringBinding(): Default Constructor. Sets the defaults, i.e. an empty binding.
  • DataGatheringBinding(Component targetComponent, string valueName, string exportColumnName = ""): Creates a DataGatheringBinding that is already bound to the member specified by the component and name. The later must be a pretty name (i.e. as displayed in the menu, including the annotation for methods). If the name is invalid, it will be bound only to the GameObject but no value will be selected.

Static Methods

  • bool IsTypeExportable(Type type): Returns true when the type is exportable (primitives Type, Vector2, Vector3, Quaternion).
  • bool IsValidMemberInfo(MemberInfo info): Checks if a MemberInfo is valid, does not required arguments and returns an exportable type.
  • Type GetMemberValueType(MemberInfo info): Returns the return type of a MemberInfo.

Editor Properties

  • GameObject _targetObject: A reference to the GameObject that contains the component (and member) of which a value should be bound.
  • Component _targetComponent: A reference to the Component that contains the member of which a value should be bound.
  • MemberInfo _targetMemberInfo: The System.Reflection.MemberInfo representing a binding to the selected value and is used to retrieve a value. Will be generated automatically via the editor.
  • string[] _memberNameList: A list of identifiers (full component name and member name) for each Component and possible member of the currently selected GameObject. Used internally for retrieving the MemberInfo.
  • string[] _prettyMemberNameList: Similar to _memberNameList but made more readable by shortening the Component's name and adding type and method hints to the members. Used for displaying via the editor.
  • int _memberIdx: The currently selected member. This determines which value from _memberNameList is selected and is handled internally.

Public Properties

  • string exportColumnName: The header value for the column storing values of this binding.
  • char headerSeparator: Separator used for the header, will be controlled by the DataGatherer controlling this binding. Default: CsvUtility.DEFAULT_COLUMN_SEPARATOR

Public Methods

  • bool ValidateBinding(): Checks if the current binding is valid, meaning the class, component and MemberInfo are valid.
  • void UpdateMemberList(): Updates the list of available members shown in the dropdown for the binding in the inspector.
  • string GetBindingValue(): Returns the value specified by the binding, creating and invoking the MemberInfo.
  • string GetBindingDescription(): Returns a description of the binding, listing all important values.
  • string GetBoundObjectDescription(): Returns a description of the bound object.
  • void SetClassDefaults(): Resets the values of the binding (for internal purposes).
  • bool IsBoundToMultiColumnValue(): Checks whether the current binding is bound to a multi-column member.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally