12345678910111213141516171819202122232425262728293031323334353637383940 |
- using TMPro;
- using UnityEngine;
- using static API_GSXR_Module_InputSystem_KS;
- using static API_GSXR_Slam;
- using static ControllerInfoBase;
- public class VibrationTest : MonoBehaviour
- {
- public TMP_InputField input_Amplitude;
- public TMP_InputField input_Frequency;
- public TMP_InputField input_Time;
- public ControllerInfoBase controller;
- public void StartVibrate()
- {
- float amplitude = float.Parse(input_Amplitude.text);
- float frequency = float.Parse(input_Frequency.text);
- float time = float.Parse(input_Time.text);
- if (controller.is_Left)
- {
- GSXR_Set_ControllerVibrate(0, true, amplitude, frequency, time);
- }
- else
- {
- GSXR_Set_ControllerVibrate(1, true, amplitude, frequency, time);
- }
- }
- public void StopVibrate()
- {
- if (controller.is_Left)
- {
- GSXR_Set_ControllerVibrate(0, false, 0.5f, 0.5f, 0.5f);
- }
- else
- {
- GSXR_Set_ControllerVibrate(1, false, 0.5f, 0.5f, 0.5f);
- }
- }
- }
|