-
Notifications
You must be signed in to change notification settings - Fork 2
Data Acquisition
The Data Acquisition Unity package provides a tool which finds all fields and value-returning-methods in any monobehaviour-derived script and saves their values at a specified frequency to the specified tab separated text file.
The SaveData script may be attached to any object in the scene. However, due to the nature Unity's drag and drop features, it is usually best to attach SaveData to the object with the most scripts you want to save data from.
With SaveData attached you will be ready to select the script and then fields and/or value-returning-methods you wish to save.
First you need to add a reference to the script you wish to collect data from. This is done by dragging and dropping the script into the Script/Instance: field.
Upon adding the script reference, SaveData will populate a drop-down menu with all the fields and value-returning-methods it finds in the script. Simply select the values, by name, that you wish to save. Use the add/remove field buttons to select more/fewer fields.
The SaveData script will automatically generate headers in the tab separated file it creates. Saving starts when the editor enters play-mode and will automatically finish when play-mode is exited. A blank line will be added between saving sessions if SaveData finds an existing file with the same name and path as the specified one.
The SaveData script invokes the .ToString() method to convert the field/method instance value to a string for saving. If you have your own data structures that you wish to save be sure to override the ToString method to ensure adequate saving.
Note: Arrays and lists are not currently supported by this script, they will be added in a future update when the developer has more free time