void UpdateDrawnSprite() { _DrawSpriteInfo = new Dictionary <int, List <SpriteTagInfo> >(); foreach (var item in _SpriteInfo) { int _id = item.Value._ID; //更新绘制表情的信息 List <SpriteTagInfo> _listSpriteInfo = null; if (_DrawSpriteInfo.ContainsKey(_id)) { _listSpriteInfo = _DrawSpriteInfo[_id]; } else { _listSpriteInfo = new List <SpriteTagInfo>(); _DrawSpriteInfo.Add(_id, _listSpriteInfo); } _listSpriteInfo.Add(item.Value); } foreach (var item in _DrawSpriteInfo) { _InlineManager.UpdateTextInfo(item.Key, this, item.Value); } }
void UpdateDrawnSprite() { //记录之前的信息 _OldDrawSpriteInfo = _DrawSpriteInfo; _DrawSpriteInfo = new Dictionary <int, List <SpriteTagInfo> >(); foreach (var item in _SpriteInfo) { int _id = item.Value._ID; //更新绘制表情的信息 List <SpriteTagInfo> _listSpriteInfo = null; if (_DrawSpriteInfo.ContainsKey(_id)) { _listSpriteInfo = _DrawSpriteInfo[_id]; } else { _listSpriteInfo = new List <SpriteTagInfo>(); _DrawSpriteInfo.Add(_id, _listSpriteInfo); } _listSpriteInfo.Add(item.Value); } //没有表情时也要提醒manager删除之前的信息 foreach (var item in _OldDrawSpriteInfo) { if (!_DrawSpriteInfo.ContainsKey(item.Key)) { _InlineManager.RemoveTextInfo(item.Key, this); } } foreach (var item in _DrawSpriteInfo) { _InlineManager.UpdateTextInfo(item.Key, this, item.Value); } }
void UpdateDrawnSprite() { //记录之前的信息 //_oldDrawSpriteInfo = _drawSpriteInfo; _drawSpriteInfo = new Dictionary <int, List <SpriteTagInfo> >(); foreach (var item in _spriteInfo) { int _id = item.Value.Id; //更新绘制表情的信息 List <SpriteTagInfo> listSpriteInfo = null; if (_drawSpriteInfo.ContainsKey(_id)) { listSpriteInfo = _drawSpriteInfo[_id]; } else { listSpriteInfo = new List <SpriteTagInfo>(); _drawSpriteInfo.Add(_id, listSpriteInfo); } listSpriteInfo.Add(item.Value); } //没有表情时也要提醒manager删除之前的信息 // foreach (var item in _oldDrawSpriteInfo) // { // if(!_drawSpriteInfo.ContainsKey(item.Key)) // _inlineManager.RemoveTextInfo(item.Key,this); //} foreach (var item in _drawSpriteInfo) { _inlineManager.UpdateTextInfo(item.Key, this, item.Value); } }