Skip to content

Instantly share code, notes, and snippets.

Avatar

Rik Roy RikTheGuy

  • Netorix Solutions
View GitHub Profile
@munkbusiness
munkbusiness / Vibration.cs
Last active May 20, 2021
Vibration for Unity3d with Android native Call that supports both the new vibrationEffectClass and the old simple vibrate, with fallback to Handlheld.Vibrate().
View Vibration.cs
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;