public override void OnFrameBegin() { var mapEntity = GetSingletonEntity <MapData>(); _moveSystem = World.GetOrCreateSystem <MoveSystem>(); // Early out if the map is regenerating. if (EntityManager.HasComponent <GenerateMap>(mapEntity) || _playerQuery.IsEmptyIgnoreFilter) { _dontRun = true; return; } _mapData = EntityManager.GetComponentData <MapData>(mapEntity); _playerEntity = _playerQuery.GetSingletonEntity(); _dontRun = false; }