protected virtual DataRow GetNewDataRow(TUIO.TuioContainer tuioContainer) { DataRow newRow = _recordTable.NewRow(); newRow ["id"] = (BUFFER_LENGTH * _bufferIterations) + _bufferIndex; newRow ["applicationTime"] = UnityEngine.Time.time; newRow ["trackRecordId"] = tuioContainer.SessionID; newRow ["position"] = new UnityEngine.Vector2(tuioContainer.Position.X, tuioContainer.Position.Y); return(newRow); }
private void StoreContainer(TUIO.TuioContainer tuioContainer) { if (_currentSecond != (int)(UnityEngine.Time.time * _recordsPerPlayerPerSecond)) { _currentSecond = (int)(UnityEngine.Time.time * _recordsPerPlayerPerSecond); _recordedPlayersInCurrentSecond.Clear(); } else { if (_recordedPlayersInCurrentSecond.Contains(tuioContainer.SessionID)) { return; } } _recordedPlayersInCurrentSecond.Add(tuioContainer.SessionID); DataRow newRow = GetNewDataRow(tuioContainer); _dataRowBuffer[_bufferIndex] = newRow; _bufferIndex++; CheckBufferSize(); }