Skip to content

Instantly share code, notes, and snippets.

View NEBR's full-sized avatar

Dmitry Kicheev NEBR

  • Russia
View GitHub Profile
@NEBR
NEBR / Vibration.cs
Last active August 29, 2015 14:20 — forked from aVolpe/Vibration.cs
using UnityEngine;
using System.Collections;
public static class Vibration
{
#if UNITY_ANDROID && !UNITY_EDITOR
public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator");