/// <summary>
 /// Reset all of the variables that are included in the HandDataManager.
 /// </summary>
 public static void Reset()
 {
     OnNewCustomStreamHandData = null;
     deviceIDToPlayerIndex     = new Dictionary <UInt64, int>();
     playerData        = new List <PlayerData>();
     initialised       = false;
     currentStreamType = DataStreamType.None;
 }
        /// <summary>
        /// Switch the stream type to another stream type.
        /// </summary>
        /// <param name="streamType">The new stream type that will be used.</param>
        public static void SwitchStreamType(DataStreamType streamType)
        {
            if (currentStreamType == streamType)
            {
                Log("Can not switch stream the stream type to " + streamType + " since the current stream type is already " + currentStreamType);
                return;
            }

            Apollo apollo = Apollo.GetInstance(UsePinchFilter);

            Log("The stream type is going to be switched to " + streamType);

            switch (streamType)
            {
            case DataStreamType.Apollo:
                // Subscribe to the Apollo stream
                apollo.RegisterDataListener(NewJointData);
                apollo.RegisterDataListener(NewRawData);

                // Unsubscribe from the custom stream
                OnNewCustomStreamHandData -= NewCustomData;
                break;

            case DataStreamType.Custom:
                // Subscribe to the custom stream
                OnNewCustomStreamHandData += NewCustomData;

                // Unsubscribe to the Apollo stream
                apollo.UnRegisterDataListener(NewJointData);
                apollo.UnRegisterDataListener(NewRawData);
                break;

            default:
                Log(streamType + " is not implemented as stream type");
                break;
            }
        }