public void Init(FloatBallData data) { _data = data; title.text = _data.activityType; icon.sprite = BundleManager.Instance.GetSprite(_data.activityIcon); btn.onClick.AddListener(() => { if (!AudioManager.Instance.IsSoundPlaying) { AudioManager.Instance.PlaySound(AudioManager.AudioSoundType.BtnClick); } OnClickBtn(); }); }
public void Init(FloatBallNode node) { try { string assetsText = BundleManager.Instance.GetJson(ConstantUtils.floatBallConfig); LitJson.JsonData jd = LitJson.JsonMapper.ToObject(assetsText); for (int i = 0; i < jd.Count; i++) { FloatBallData data = LitJson.JsonMapper.ToObject <FloatBallData>(LitJson.JsonMapper.ToJson(jd[i])); itemArryer[i]._node = node; itemArryer[i].Init(data); } } catch (Exception) { TipManager.Instance.OpenTip(TipType.SimpleTip, "配置读取失败"); } }