お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close/axisName/ で識別される仮想軸の平滑化フィルタが適用されていない値を返します
値はキーボードとジョイスティックの入力によって-1から1の範囲になります。 入力がスムースになっていないので、キーボード入力はいつも -1, 0, 1のどれかになります。 これは全てのキーボード入力の平衡化フィルタを自前で処理したい場合に便利です。
function Update () { var speed : float = Input.GetAxisRaw("Horizontal") * Time.deltaTime; transform.Rotate (0, speed, 0); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Update() { float speed = Input.GetAxisRaw("Horizontal") * Time.deltaTime; transform.Rotate(0, speed, 0); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Update() as void: speed as float = (Input.GetAxisRaw('Horizontal') * Time.deltaTime) transform.Rotate(0, speed, 0)