博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【酷熊科技】工作积累 ----------- Unity3D button 回调事件
阅读量:7244 次
发布时间:2019-06-29

本文共 779 字,大约阅读时间需要 2 分钟。

 

通过 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         }

 

转载于:https://www.cnblogs.com/dudu580231/p/5949748.html

你可能感兴趣的文章
ipad
查看>>
Spring RPC 入门学习(1)-HelloWorld入门
查看>>
Codeforces 1076 E - Vasya and a Tree
查看>>
Erlang使用ProtoBuffer
查看>>
集中式(SVN)和分布式(Git)版本控制系统的简单比较
查看>>
Chapter 11. WinForm-文件及文件夹操作
查看>>
索引及基应用
查看>>
[BZOJ 4800][Ceoi2015]Ice Hockey World Championship(Meet-in-the-Middle)
查看>>
python 数据加密以及生成token和token验证
查看>>
学Js之prototype
查看>>
CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14
查看>>
Apache Storm
查看>>
优达学城数据分析师纳米学位——P4项目知识点整理及代码分析
查看>>
lambda 分组练习
查看>>
PowerDesigner Comment与Name相互替换
查看>>
(二) JPA基础
查看>>
(四)Centos之查询目录中内容命名ls
查看>>
压缩 KVM 的 qcow2 镜像文件
查看>>
紫书 例题 10-26 UVa 11440(欧拉函数+数论)
查看>>
DDOS攻击攻击种类和原理
查看>>