示例#1
0
        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);
        }
示例#2
0
        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();
        }