Beispiel #1
0
        void checkBowHaptics()
        {
            // If we aren't pulling back then skip the check
            // Only apply haptics on pull back
            if (DrawPercent < _lastDrawPercent)
            {
                return;
            }

            // Don't apply haptics if we just applied them recently
            if (Time.time - _lastDrawHapticTime < 0.11)
            {
                return;
            }

            if (drawDefs == null)
            {
                return;
            }

            DrawDefinition d = drawDefs.FirstOrDefault(x => x.DrawPercentage <= DrawPercent && x.DrawPercentage != _lastDrawHaptic);

            if (d != null && arrowGrabber != null)
            {
                input.VibrateController(d.HapticFrequency, d.HapticAmplitude, 0.1f, arrowGrabber.HandSide);
                _lastDrawHaptic     = d.DrawPercentage;
                _lastDrawHapticTime = Time.time;
            }
        }
Beispiel #2
0
        public void SlowTime()
        {
            if (!_slowingTime)
            {
                // Make sure we aren't running a routine
                if (resumeRoutine != null)
                {
                    StopCoroutine(resumeRoutine);
                }

                // Play Slow time clip
                audioSource.clip = SlowTimeClip;
                audioSource.Play();

                // Haptics
                input.VibrateController(0.1f, 0.2f, SpeedupTimeClip.length, ControllerHand.Left);

                Time.timeScale      = SlowTimeScale;
                Time.fixedDeltaTime = originalFixedDelta * Time.timeScale;

                _slowingTime = true;
            }
        }