0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

unity > mouseのスクロールを取得 > float val = Input.GetAxis ("Mouse ScrollWheel"); > ">0.0f":up / "<0.0f":down / "=0.0":do nothing

Last updated at Posted at 2015-08-13
動作確認
Unity 5.1.1-f1 on Mac OS X 10.8.5

マウスウィールの使用を感知したい。

	void OnGUI() {
		float val = Input.GetAxis ("Mouse ScrollWheel");
		if (val > 0.0f) {
			Debug.Log ("up");
		} else if (val < 0.0f) {
			Debug.Log ("down");
		} else {
			// do nothing
		}
	}

val==0.0fの時はScroll Wheelを使用していない時に対応するようだ。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?