【酷熊科技】工作积累 ----------- Unity3D button 回调事件
2016-10-11 16:16
309 查看
通过 UIButton.current.name 获取当前点击的按钮的名字
1 public void OnClickBtnBuy() 2 { 3 int costRmb = 0; 4 int itemId = 0; 5 int actPaymentId = 50; // 这个是固定写死的,前后端商量好的, 6 switch (UIButton.current.name) 7 { 8 case "btnBuyLeft": 9 { 10 costRmb = this.listDailyRechargeItem[0].rmb_cost; 11 itemId = this.listDailyRechargeItem[0].id; 12 } 13 break; 14 15 case "btnBuyRight": 16 { 17 costRmb = this.listDailyRechargeItem[1].rmb_cost; 18 itemId = this.listDailyRechargeItem[1].id; 19 } 20 break; 21 }
相关文章推荐
- 【酷熊科技】工作积累 ----------- Unity3D 读取 图片
- 【酷熊科技】工作积累 ----------- Unity3D的基本界面介绍
- 【酷熊科技】工作积累 ----------- C#自动添加using引用命名空间
- 【酷熊科技】工作积累 ----------- Unity3D / c 语言 使用 Stringbuilder 引用头文件 using System.Text
- 【酷熊科技】工作积累 ----------- Unity 3D中的 SetActive() 与 OnEnable()、OnDisable()要注意的
- 【酷熊科技】工作积累 ----------- 内存优化之GC.MarkDependencies
- 【酷熊科技】工作积累 ----------- 在unity3d里怎样隐藏物体
- 【酷熊科技】工作积累 ----------- 动画播放 直接写代码控制的
- 【酷熊科技】工作积累 ----------- Unity3D grid 显示问题
- 【酷熊科技】工作积累 ----------- unity 动态设置 Animator组件的Controller
- 【酷熊科技】工作积累 ----------- android 6.0 权限问题
- 【酷熊科技】工作积累 ----------- 随机数 (带权重的随机数)
- 【酷熊科技】工作积累 ----------- Unity3D UITable协程加载问题 (转载 ---- 关于NGUI中UiTable和UIGrid脚本的一点感受)
- 【酷熊科技】工作积累 ----------- 【Unity】减少GC回收
- 【酷熊科技】工作积累 ----------- Unity3d中的Awake()、OnEnable()、Start()等默认函数的执行顺序和生命周期
- 【酷熊科技】工作积累 ----------- unity scrollview 点击后会有偏移问题(有图片)
- 工作积累(三)——使用jQuery实现回车触发事件
- 工作积累(三)——使用jQuery实现回车触发事件
- 工作积累(六)——jQuery实现DOM元素事件动态绑定