private void ChainEventReceivedHandler(object sender, ChainEventArgs e) { if (e.EventName != "onTileMapStateUpdate") { return; } string stringData = Encoding.UTF8.GetString(e.Data); JsonTileMapState tileMapStateParsed = JsonUtility.FromJson <JsonTileMapState>(stringData); this.eventActions.Enqueue(() => { TileMapStateUpdated?.Invoke(tileMapStateParsed); }); }
private void EventReceivedHandler(object sender, EvmChainEventArgs e) { if (e.EventName != "OnTileMapStateUpdate") { return; } OnTileMapStateUpdateEvent onTileMapStateUpdateEvent = e.DecodeEventDTO <OnTileMapStateUpdateEvent>(); JsonTileMapState jsonTileMapState = JsonUtility.FromJson <JsonTileMapState>(onTileMapStateUpdateEvent.State); this.eventActions.Enqueue(() => { TileMapStateUpdated?.Invoke(jsonTileMapState); }); }