//RETURNS if logs already exist, otherwise reinstantiates them private void InstantiateLoggers(string participantId) { if (_playerLog && _experimentInfoLog) { return; } //to get one timestapm in order to synchronize loading of log files CreationTimestamp = DateTime.Now.ToString("HH-mm-ss-dd-MM-yyy"); _playerLog = gameObject.AddComponent <PlayerLog>(); _experimentInfoLog = gameObject.AddComponent <ExperimentInfoLog>(); if (participantId != null) { participantId = "NEO"; } _playerLog.Setup(CreationTimestamp, participantId); _experimentInfoLog.Setup(CreationTimestamp, participantId); }
public void CloseLogs() { StopLogging(); if (_experimentInfoLog) { _experimentInfoLog.Close(); Destroy(_experimentInfoLog); _experimentInfoLog = null; //because of timing issues when closing and opening in one method } if (!_playerLog) { return; } _playerLog.Close(); Destroy(_playerLog); _playerLog = null; }