4
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.

uGUIのInputFieldで編集できない入力フォームを作る

Posted at

検証環境

Unity2018.2.1f1

解説

sふぁsfさdふぁs.png

InputFieldコンポーネントの設定を変更することで実現可能です。

プロパティ 説明
Interactable UI要素を選択する機能の有効/無効を切り替える。デフォルトで有効。
ReadOnly 読み取り専用の有効/無効を切り替える。デフォルトで無効。

挙動

上から、

  • Interactable = true && ReadOnly = false
  • Interactable = false&& ReadOnly = false
  • Interactable = true && ReadOnly = true

fasdfas.gif

Interactableがfalseだと選択自体が出来なくて、ReadOnlyがtrueだと選択は出来るけど変更が加えられない挙動をします。

用途に応じて使い分けるとよいかと思います。参考にしてみてください。

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