immersivecognition / unity-experiment-framework

UXF - Framework for creating human behaviour experiments in Unity
https://immersivecognition.github.io/unity-experiment-framework/
MIT License
214 stars 41 forks source link

added pause/resume to Tracker.cs #152

Closed martinmmueller closed 1 year ago

martinmmueller commented 1 year ago

Motivation for the Pull request

I wanted the option to pause and resume trackers without dumping the data that was already collected (StartRecording creates a new DataTable), so I quickly built in a Pause and a Resume function with an enum-based state to keep track of what the tracker is currently doing.

Maybe this could be useful to others as well, so I thought I'd put the edit up here.

Some notes:

jackbrookes commented 1 year ago

Looks good other than minor tweaks

martinmmueller commented 1 year ago

Hey, thanks for the fast reply! I implemented the changes as you requested, but I changed the calls to the recording field in checks (e.g. in Update()) to calls to the Recording Property (which now wraps the the state check as you suggested) instead of making the explicit check every time. I think it should be more readable this way.