用户工具

站点工具


侧边栏

script:unityengine:classes:handheld:handheld.vibrate

Handheld.Vibrate 震动

JavaScript ⇒ public static function Vibrate(): void;
C# ⇒ public static void Vibrate();

Description 描述

Triggers device vibration.

触发器震动。

JavaScript:

#pragma strict
function OnGUI() {
	if (GUI.Button(new Rect(0, 10, 100, 32), "Vibrate!"))
		Handheld.Vibrate();
}

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void OnGUI() {
        if (GUI.Button(new Rect(0, 10, 100, 32), "Vibrate!"))
            Handheld.Vibrate();
    }
}

handheld

script/unityengine/classes/handheld/handheld.vibrate.txt · 最后更改: 2016/08/02 05:30 (外部编辑)