一,我们先添加一个sprite,选择sprite,右键选择attach,添加box collider, 然后右键选择attach,添加popup list script ,我们给popup list 的options 添加文字,这就是下拉框的值,得到如下图结果:

NGUI的下拉框的使用(popup list script)

default是当运行时默认选中的值:

NGUI的下拉框的使用(popup list script)

二,我们给sprite添加一个label,并设置下面属性:

 NGUI的下拉框的使用(popup list script)

我们就可以得到当选择下拉框时,值改变,会在当前绑定的label对象显示,效果如下:

NGUI的下拉框的使用(popup list script)

 

相关文章:

  • 2022-01-29
  • 2021-11-23
  • 2021-05-09
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-02
  • 2021-08-05
  • 2022-12-23
  • 2021-04-14
  • 2021-07-26
  • 2021-06-18
  • 2022-12-23
相关资源
相似解决方案