private void onSpriteLeaveZone(GameEvent e) { Variant data = e.data; using (List <Variant> .Enumerator enumerator = data["iidary"]._arr.GetEnumerator()) { while (enumerator.MoveNext()) { uint key = enumerator.Current; bool flag = !this._heroInfos.ContainsKey(key); if (!flag) { this._heroInfos.Remove(key); bool flag2 = this._heroWaitCreateInfos.ContainsKey(key); if (flag2) { this._heroWaitCreateInfos.Remove(key); } bool flag3 = !this._heros.ContainsKey(key); if (!flag3) { LGAvatarHero lGAvatarHero = this._heros[key]; this._heros.Remove(key); lGAvatarHero.dispose(); } } } } }
private void onSpriteLeaveZone(GameEvent e) { Variant data = e.data; foreach (uint iid in data["iidary"]._arr) { if (!_heroInfos.ContainsKey(iid)) { continue; } _heroInfos.Remove(iid); if (_heroWaitCreateInfos.ContainsKey(iid)) { _heroWaitCreateInfos.Remove(iid); } if (!_heros.ContainsKey(iid)) { continue; } LGAvatarHero ct = _heros[iid]; _heros.Remove(iid); ct.dispose(); } }