0
0

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 3 years have passed since last update.

Unity入門 03 スワイプの距離

Posted at

やったこと

Unityの教科書 Unity2019完全対応版 2D&3Dスマートフォンゲーム入門講座の4章。

スワイプの長さ(距離)判定

  • スワイプの開始はGetMouseButtonDownで求まる
  • スワイプの終了はGetMouseButtonUpで求まる
  • タッチした位置はInput.mousePositionで求まる
  • 終了位置から開始位置を引いた距離がスワイプの長さ

音を鳴らす

  • コンポーネントにアタッチする
  • GetComponent().Play();

終わりに

音をつけられるようになると俄然ゲームっぽくなってきた。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?