LoginSignup
1
0

More than 1 year has passed since last update.

Unityのonclick.addlistenerではまった場合の対処法

Last updated at Posted at 2021-07-08

スクリプトで以下のような処理を実装しようとしたところ、onclick.addlistenerではまった。

やりたいこと(実施したい処理)

  • ボタンprefabをinstantiate
  • onclick.addlistenerを設定

発生した課題

「ArgumentException: method arguments are incompatible」が常時発生

原因

ボタンprefabのonclickに最初から不要なaddlistenerが設定されていた(以下のような状況で、一見未設定にみえたが、実は未設定のlistenerが存在している状態だった)
image.png

対応

Removeして以下のような状態にしたら解決
image.png

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