Skip to content

Instantly share code, notes, and snippets.

View RikTheGuy's full-sized avatar
🎯
Focusing

Rik Roy RikTheGuy

🎯
Focusing
  • Netorix Solutions
View GitHub Profile
@munkbusiness
munkbusiness / Vibration.cs
Last active November 24, 2023 00:42
Vibration for Unity3d with Android native Call that supports both the new vibrationEffectClass and the old simple vibrate, with fallback to Handlheld.Vibrate().
using UnityEngine;
using System.Collections;
public class Vibration : MonoBehaviour {
public static AndroidJavaClass unityPlayer;
public static AndroidJavaObject vibrator;
public static AndroidJavaObject currentActivity;
public static AndroidJavaClass vibrationEffectClass;
public static int defaultAmplitude;