public void initData() { ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); Button_ChouJiang = rc.Get <GameObject>("Button_ChouJiang").GetComponent <Button>(); Button_close = rc.Get <GameObject>("Button_close").GetComponent <Button>(); Button_wenhao = rc.Get <GameObject>("Button_wenhao").GetComponent <Button>(); Image_bg = rc.Get <GameObject>("Image_bg"); xingyunzhi = rc.Get <GameObject>("xingyunzhi"); Item = rc.Get <GameObject>("Item"); Button_ChouJiang.onClick.Add(onClick_ChouJiang); Button_close.onClick.Add(onClickClose); Button_wenhao.onClick.Add(showGuiZe); Image_bg.transform.Find("Text_tip1/Btn_share").GetComponent <Button>().onClick.Add(onClickShare); for (int i = 0; i < ZhuanPanConfig.getInstance().getZhuanPanInfoList().Count; i++) { ZhuanPanInfo zhuanpanInfo = ZhuanPanConfig.getInstance().getZhuanPanInfoList()[i]; GameObject item = Item.transform.Find("Item_" + zhuanpanInfo.itemId).gameObject; if (zhuanpanInfo.prop_id == 1) { item.transform.Find("Image_icon").GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "icon_gold"); item.transform.Find("Text_reward").GetComponent <Text>().text = ("金币" + (int)zhuanpanInfo.prop_num); } else if (zhuanpanInfo.prop_id == 3) { item.transform.Find("Image_icon").GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "icon_huafei"); item.transform.Find("Text_reward").GetComponent <Text>().text = ("话费" + zhuanpanInfo.prop_num + "元"); } } if (OtherData.getIsShiedShare()) { Image_bg.transform.Find("Text_tip1").localScale = Vector3.zero; } CommonUtil.SetTextFont(Button_close.transform.parent.gameObject); UIAnimation.ShowLayer(Button_close.transform.parent.gameObject); }
public void showGuiZe() { string content = "1、每完成一次对局可获得一次转盘机会,每日最高3次\r\n\r\n2、贵族用户每日额外赠送一次机会\r\n\r\n"; if (!OtherData.getIsShiedShare()) { content += "3、以上转盘次数用完后分享游戏可额外获得一次机会"; } UICommonPanelComponent script = UICommonPanelComponent.showCommonPanel("规则", content); script.setOnClickOkEvent(() => { Game.Scene.GetComponent <UIComponent>().Remove(UIType.UICommonPanel); }); script.setOnClickCloseEvent(() => { Game.Scene.GetComponent <UIComponent>().Remove(UIType.UICommonPanel); }); script.Text_content.alignment = TextAnchor.MiddleLeft; }