Beispiel #1
0
        public void PollDevices()
        {
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
            // Check for a new shirt command
            if (HasNewCommand(DeviceType.Shirt))
            {
                var command = PopCommand(DeviceType.Shirt);
                var handler = ReceivedShirtStatus;
                if (handler != null)
                {
                    handler(command);
                }
                if (command == InputCommands.DeviceConnected)
                {
                    ShirtStatus = StreamingStatus.Connected;
                }
                else if (command == InputCommands.DeviceDisconnected)
                {
                    ShirtStatus = StreamingStatus.Disconnected;
                }
            }
            // Check for a new pants command
            if (HasNewCommand(DeviceType.Pants))
            {
                var command = PopCommand(DeviceType.Pants);
                var handler = ReceivedPantsStatus;
                if (handler != null)
                {
                    handler(command);
                }
                if (command == InputCommands.DeviceConnected)
                {
                    PantsStatus = StreamingStatus.Connected;
                }
                else if (command == InputCommands.DeviceDisconnected)
                {
                    PantsStatus = StreamingStatus.Disconnected;
                }
            }

            if (ShirtStatus == StreamingStatus.Connected)
            {
                //LoadRotations(DeviceType.Shirt, ShirtRotations);
                RPY.LoadRotations(DeviceType.Shirt, ShirtRPY);
            }
            if (PantsStatus == StreamingStatus.Connected)
            {
                //LoadRotations(DeviceType.Pants, PantsRotations);
                RPY.LoadRotations(DeviceType.Pants, PantsRPY);
            }
#endif
        }
Beispiel #2
0
 protected void OnStatusChanged(StreamingStatus status)
 {
     StatusChanged.Raise(this, new StreamingStatusEventArgs {
         Status = status
     });
 }