void OnBlockPreviewUpdated(Event_BlockPreviewUpdated e) { if (e.Block.Type != _shownBlock.Type || e.Block.Subtype != _shownBlock.Subtype) { return; } _image.texture = e.Texture; _image.enabled = true; }
void OnPreviewUpdated(Event_BlockPreviewUpdated e) { var hash = (byte)e.Block.Type * 256 + e.Block.Subtype; if (_blockPreviews.ContainsKey(hash)) { _blockPreviews[hash] = e.Texture; } else { _blockPreviews.Add(hash, e.Texture); } }