public override void Vibrate(float leftMotor, float rightMotor) { #if UNITY_XBOXONE GamepadPlugin.SetGamepadVibration( ControllerId, Mathf.Clamp01(leftMotor), Mathf.Clamp01(rightMotor), 0, 0 ); #endif }
void DoVibration() { #if UNITY_XBOXONE && !UNITY_EDITOR GamepadPlugin.SetGamepadVibration(XboxOneInput.GetControllerId(0), .5f, .5f, 0, 0); #endif #if UNITY_PS4 && !UNITY_EDITOR int val = 0; if (int.TryParse(LoginHandler.instance.UserID, out val)) { PS4Input.PadSetVibration(val, (int)Mathf.Clamp(127 * scale, 0, 255), (int)Mathf.Clamp(127 * scale, 0, 255)); } #endif }
void StopVibration() { #if UNITY_XBOXONE && !UNITY_EDITOR GamepadPlugin.SetGamepadVibration(XboxOneInput.GetControllerId(0), 0f, 0f, 0, 0); #endif #if UNITY_PS4 && !UNITY_EDITOR int val = 0; if (int.TryParse(LoginHandler.instance.UserID, out val)) { PS4Input.PadSetVibration(val, 0, 0); } #endif }
void OnPreRender() { if (shakeTime > 0) { shook = true; originalPosition = T.position; Vector3 newPosition = originalPosition; newPosition.x += xAdjustment * scale; newPosition.y += yAdjustment * scale; T.position = newPosition; } else { #if UNITY_XBOXONE && !UNITY_EDITOR GamepadPlugin.SetGamepadVibration(XboxOneInput.GetControllerId(0), 0, 0, 0, 0); #endif } }
public void Vibrate(float leftMotor, float rightMotor, float leftTrigger, float rightTrigger) { #if UNITY_XBOXONE GamepadPlugin.SetGamepadVibration(ControllerId, leftMotor, rightMotor, leftTrigger, rightTrigger); #endif }