-
Notifications
You must be signed in to change notification settings - Fork 48
FileIOManager
Component which manages File I/O in a seperate thread to avoid hitches.
debug
: Enable to print debug messages to the console.
onWriteFile
: Event(s) to trigger when we write a file. Not performed in amin thread so cannot include most Unity actions.
executeOnMainThreadQueue
: Queue of actions which gets emptied on each frame in the main thread.
doNothing
: An action which does nothing. Useful if a method requires an Action
None
UXF.FileIOManager.Begin()
Starts the FileIOManager Worker thread.
Parameters
None
UXF.FileIOManager.ManageInWorker(System.Action)
Adds a new command to a queue which is executed in a separate worker thread when it is available. Warning: The Unity Engine API is not thread safe, so do not attempt to put any Unity commands here.
Parameters
action
:
UXF.FileIOManager.CopyFile(string, string)
Copy file from one place to another.
Parameters
sourceFileName
:
destFileName
:
UXF.FileIOManager.ReadJSON(string, System.Action<System.Collections.Generic.Dictionary<string, object>>)
Reads a JSON file from a path then calls a given action with the deserialzed object as the first argument
Parameters
fpath
:
callback
:
UXF.FileIOManager.WriteJson(object, UXF.WriteFileInfo)
Serializes an object using MiniJSON and writes to a given path
Parameters
destFileName
:
serializableObject
:
UXF.FileIOManager.WriteTrials(System.Collections.Generic.List<OrderedResultDict>, string[], UXF.WriteFileInfo)
Writes trial data (List of OrderedResultsDict) to file at fpath
Parameters
dataDict
:
headers
:
fpath
:
UXF.FileIOManager.WriteCSV(string[], System.Collections.Generic.IList<string[]>, UXF.WriteFileInfo)
Writes a list of string arrays with a given header to a file at given path.
Parameters
header
: Row of headers
data
:
fpath
:
UXF.FileIOManager.ReadCSV(string, System.Action<System.Data.DataTable>)
Read a CSV file from path, then runs an action that takes a DataTable as an argument. This code assumes the file is on disk, and the first row of the file has the names of the columns on it. Returns null if not found
Parameters
fpath
:
callback
:
UXF.FileIOManager.WriteCSV(System.Data.DataTable, UXF.WriteFileInfo)
Writes a DataTable to file to a path.
Parameters
data
:
fpath
:
UXF.FileIOManager.ManageInMain()
Handles any actions which are enqueued to run on Unity's main thread.
Parameters
None
UXF.FileIOManager.End()
Aborts the FileIOManager's thread and joins the thread to the calling thread.
Parameters
None
Note: This file was automatically generated
๐ง Core topics
- ๐ Background
- โจ UXF 2.0
- โ๏ธ Compatibility
- ๐ถ๏ธ Oculus Quest Setup
- ๐ญ Concepts
- ๐ ๏ธ Get started
- ๐ Examples
- ๐ฅ๏ธ Built-in UI
- ๐ Session generation
- โฐ Events
- ๐ Data collection
- โ๏ธ Collect custom data
- ๐ Custom Data Handler
- ๐ Remote Data Collection
- ๐๏ธ WebGL DynamoDB setup
- ๐ Processing DynamoDB CSVs
- ๐ซ HTTP Post Setup
- ๐ง Settings system
- ๐๐ฝ Tracker system
- ๐ Logging system
โ ๏ธ Common issues- ๐ผ๏ธ Multi-scene experiments
- ๐บ Videos
- ๐จโ๐ Full written tutorial
- ๐ฆ Asset links
- ๐จโ๐ซ Unity tutorial links
- ๐ Useful code snippets
- ๐ก Programming ideas
- ๐งฎ Example R processing