Example #1
0
        public void TriggerHaptics(HapticsStrength hapticsStrength, HapticsType hapticsType)
        {
            if (Sdk == null || saberPeripheral == null)
            {
                return;
            }

            int   strength = 0;
            float duration = 0.0f;

            switch (hapticsStrength)
            {
            case HapticsStrength.Light:
                strength = 30;
                break;

            case HapticsStrength.Medium:
                strength = 60;
                break;

            case HapticsStrength.Strong:
                strength = 100;
                break;
            }

            switch (hapticsType)
            {
            case HapticsType.Pulse:
                duration = 0.2f;
                break;

            case HapticsType.Vibrate:
                duration = 0.4f;
                break;
            }

            if (saberPeripheral != null)
            {
                saberPeripheral.Vibrate(strength, duration);
            }
        }
 public EventParameter(HapticsType id, float value)
 {
     ParameterID    = id.ToString();
     ParameterValue = value;
 }