public void SetRollDropItem(List <Variant> s2cDataLst) { if (s2cDataLst == null) { return; } for (int i = 0; i < s2cDataLst.Count; i++) { ROllItem rollItem = new ROllItem(); rollItem.dpid = s2cDataLst[i]["dpid"]; rollItem.tp = s2cDataLst[i]["tp"]; rollItem.left_tm = s2cDataLst[i]["left_tm"]; rollItem.teamid = s2cDataLst[i]["teamid"]; rollItem.roll_tm = s2cDataLst[i]["roll_tm"]; rollItem.roll_owner = s2cDataLst[i]["roll_owner"]; if (s2cDataLst[i].ContainsKey("eqp")) { Variant eqpary = s2cDataLst[i]["eqp"]; a3_BagItemData itemData = new a3_BagItemData(); if (eqpary.ContainsKey("tpid")) { itemData.tpid = eqpary["tpid"]; } if (eqpary.ContainsKey("bnd")) { itemData.bnd = eqpary["bnd"]; } a3_EquipModel.getInstance().equipData_read(itemData, eqpary); itemData.confdata = a3_BagModel.getInstance().getItemDataById(itemData.tpid); rollItem.eqpData = itemData; } if (s2cDataLst[i].ContainsKey("itm")) { Variant itm = s2cDataLst[i]["itm"]; a3_BagItemData itemData = new a3_BagItemData(); itemData.tpid = itm["id"]; itemData.num = itm["cnt"]; itemData.confdata = a3_BagModel.getInstance().getItemDataById(itemData.tpid); rollItem.itemData = itemData; } rollItemMapping[rollItem.dpid] = rollItem; if (a3_RollItem.single != null) { a3_RollItem.single.AddRollItemGo(rollItem); } } }
public void Dispose() { _rollItemdata = null; _iconGo = null; _iconGoParent = null; _btnNeed.removeAllListener(); _btnGreed.removeAllListener(); _btnNeed = null; _btnGreed = null; _textitemName = null; _textResult = null; GameObject.Destroy(this._itemGo); _itemGo = null; _endTime = 0f; }
public RollItemGo(GameObject go, ROllItem data, GameObject parentGo) { _itemGo = go; _rollItemdata = data; _endTime = (float)_rollItemdata.left_tm; this._itemGo.gameObject.SetActive(true); this._itemGo.transform.SetParent(parentGo.transform); this._itemGo.transform.localScale = Vector3.one; this._itemGo.transform.localPosition = Vector3.zero; Init(); OnAddOnClick(); CreateIconGo(_iconGoParent.transform); }
public void AddRollItemGo(ROllItem itemData) { if (_goMapping.ContainsKey(itemData.dpid)) { return; } GameObject itemgo = GameObject.Instantiate(_itemGo); RollItemGo rollGo = new RollItemGo(itemgo, itemData, _itemContaninerGo); _goMapping[itemData.dpid] = rollGo; this.gameObject.SetActive(_goMapping.Count > 0); StartCoroutine(rollGo.TimeBegin()); }