Exemplo n.º 1
0
        public void Awake()
        {
            // Begin in absolute mode and cache the wearable controller.
            _wearableControl = WearableControl.Instance;
            _wearableControl.DeviceConnected += OnDeviceConnected;

            _mode             = RotationReference.Absolute;
            _inverseReference = Quaternion.identity;

            // add the necessary AudioSources:
            audioRight        = AddAudio(right, false, true, 1);
            audioFreeze       = AddAudio(freezeAudioClips[0], false, true, 1);
            audioIntro        = AddAudio(intro, false, true, 1);
            audioFeedback     = AddAudio(danceHarderAudioClips[0], false, true, 1);
            audioDone         = AddAudio(done, false, true, 1);
            audioInstructions = AddAudio(spin, false, true, 1);


            audioIntro.Play();

            songPlayer = GetComponent <AudioSource>();
            songPlayer.Play();
            songPlayer.volume  = .3f;
            audioFreeze.volume = 1;
            RandomTime();
            RandomSpinTime();
        }
Exemplo n.º 2
0
        private void Awake()
        {
            // Begin in absolute mode and cache the wearable controller.
            _wearableControl = WearableControl.Instance;
            _wearableControl.DeviceConnected += OnDeviceConnected;

            _mode             = RotationReference.Absolute;
            _inverseReference = Quaternion.identity;
        }
Exemplo n.º 3
0
        private void Awake()
        {
            _mode             = RotationReference.Absolute;
            _inverseReference = Quaternion.identity;
            _requirement      = null;
            _wearableControl  = WearableControl.Instance;

            CheckAndResolveRequirement();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Set the reference to the device's current orientation.
        /// </summary>
        public void SetRelativeReference()
        {
            _mode = RotationReference.Relative;

            if (_wearableControl.ConnectedDevice != null)
            {
                _inverseReference = Quaternion.Inverse(
                    _rotationSource == RotationSensorSource.NineDof ?
                    _wearableControl.LastSensorFrame.rotationNineDof :
                    _wearableControl.LastSensorFrame.rotationSixDof);
            }
        }
Exemplo n.º 5
0
        private void Awake()
        {
            // Begin in absolute mode and cache the wearable controller.
            _wearableControl = WearableControl.Instance;
            _wearableControl.DeviceConnected += OnDeviceConnected;

            hurt = false;

            _mode             = RotationReference.Absolute;
            _inverseReference = Quaternion.identity;
            // Get audiosources
            audioSources = new AudioSource[] { left, right, jump, back, duck };
        }
Exemplo n.º 6
0
        private void Awake()
        {
            // Begin in absolute mode and cache the wearable controller.
            _wearableControl  = WearableControl.Instance;
            _mode             = RotationReference.Absolute;
            _inverseReference = Quaternion.identity;

            // Establish a requirement for the rotation sensor
            WearableRequirement requirement = GetComponent <WearableRequirement>();

            if (requirement == null)
            {
                requirement = gameObject.AddComponent <WearableRequirement>();
            }
            requirement.EnableSensor(SensorId.Rotation);
            requirement.SetSensorUpdateInterval(SensorUpdateInterval.EightyMs);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Set the <see cref="Quaternion"/> <paramref name="rotation"/> as a reference when matching the rotation.
 /// </summary>
 /// <param name="rotation"></param>
 public void SetRelativeReference(Quaternion rotation)
 {
     _mode             = RotationReference.Relative;
     _inverseReference = Quaternion.Inverse(rotation);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Set rotation to always use the rotation from the latest <see cref="SensorFrame"/> when matching the
 /// rotation.
 /// </summary>
 public void SetAbsoluteReference()
 {
     _mode = RotationReference.Absolute;
 }