Ejemplo n.º 1
0
        private bool IsSupportedSource(MRWSAInput.InteractionSource source)
        {
#if UNITY_5
            if (source.sourceKind == MRWSAInput.InteractionSourceKind.Hand
                ||
                source.sourceKind == MRWSAInput.InteractionSourceKind.Voice)
#else
            if (source.kind == MRWSAInput.InteractionSourceKind.Hand
                ||
                source.kind == MRWSAInput.InteractionSourceKind.Voice
                ||
                // Work around for Unity bug 986569
                // https://fogbugz.unity3d.com/default.asp?986569_ocqv0s170krpen7g
                source.kind == MRWSAInput.InteractionSourceKind.Other
                )
#endif
            {
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Gets the source data for the specified interaction source if it already exists, otherwise creates it.
        /// </summary>
        /// <param name="interactionSource">Interaction source for which data should be retrieved.</param>
        /// <returns>The source data requested.</returns>
        private SourceData GetOrAddSourceData(InteractionSource interactionSource)
        {
            SourceData sourceData;
            if (!sourceIdToData.TryGetValue(interactionSource.id, out sourceData))
            {
                sourceData = new SourceData(this, interactionSource.id);
                sourceIdToData.Add(sourceData.SourceId, sourceData);
                newSources.Add(sourceData.SourceId);
            }

            return sourceData;
        }