您的位置:首页 > 移动开发 > Unity3D

【酷熊科技】工作积累 ----------- Unity3D button 回调事件

2016-10-11 16:16 288 查看
通过 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         }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐