示例#1
0
 void SetRumble(IDualMotorRumble newMotor)
 {
     if (rumbleMotor != newMotor)
     {
         rumbleMotor?.ResetHaptics();
         rumbleMotor = newMotor;
         rumbleMotor?.ResetHaptics();
     }
 }
示例#2
0
    private IEnumerator RumbleRoutine(IDualMotorRumble rumble, float lowFreq, float highFreq, float duration)
    {
        float rumbleStartTime = Time.time;

        while (rumbleStartTime + duration > Time.time)
        {
            rumble.SetMotorSpeeds(lowFreq, highFreq);
            yield return(null);
        }

        rumble.ResetHaptics();
    }