public void SetValue(MallProductModel config) { this.config = config; detail.CardNum_TextMeshProUGUI.text = "房卡X" + config.itemCount; detail.Price_TextMeshProUGUI.text = "¥" + config.price.ToString(); detail.Icon_Image.sprite = Game.IconMgr.Get(config.image); //detail.Icon_Image.SetNativeSize(); detail.Button_Button.onClick.AddListener(() => { Game.SoundManager.PlayClick(); System.Action <int> callback = OnSelectPayType; Game.UIMgr.PushScene(UIPage.PayPage, callback, config); }); }
public override void OnSceneActivated(params object[] sceneData) { base.OnSceneActivated(sceneData); callback = (Action <int>)sceneData[0]; MallProductModel config = (MallProductModel)sceneData[1]; if (config.category == 1) { detail.Text_Text.text = string.Format("购买 <color=\"#DC861B\">房卡X{0}</color> 价格 <color=\"#DC861B\">{1}</color> 元", config.itemCount, config.price); } else { string shotName = Utils.GetShotName(config.itemCount, 1); detail.Text_Text.text = string.Format("购买 <color=\"#DC861B\">{0} 金币</color> 价格 <color=\"#DC861B\">{1}</color> 元", shotName, config.price); } }