1
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?

【Unityでとりあえず入れておけばいいモノを作りたい】シンプルなボタンを作った

Last updated at Posted at 2025-04-07

はじめに

自分の場合Unityでプロジェクトを作成してとりあえず入れておけばいいものは以下です
「UniRx」「UniTask」「DOTween」

シンプルなボタン

ということで"この3つが入っている前提"で且つとりあえず効率よく作業を進めたい際に入れておけばよいものを自分で作ろうと思いシンプルなボタン機能を作成しました。

機能

・各イベント(押された、離された、クリック、長押し)
・長押し判定時間はインスペクタで設定
・ボタンオブジェクトの範囲外まで指が移動したら長押しとクリックをキャンセル
・ボタンアニメーション

とりあえずこれだけあれば十分です。
Demo.gif

GitHubで公開

1
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
1
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?