private void SetPosition() { float3 pos = UICityLabel.GetWorldPosition(createCityLabel); this.label.GetComponent <RectTransform>().SetParent(gridCanvas.transform, false); this.label.GetComponent <RectTransform>().position = new Vector3(pos.x, pos.y + 10f, pos.z - 5f); }
void LateUpdate() { createQuery = UICityLabel.GetUICreateQuery(); if (createQuery.CalculateEntityCount() > 0) { CityLabelService.CreateCityLabel( createQuery, cityPanelPrefab, transform, gridCanvas ); } }
protected override void OnUpdate() { CityPrefab cityPrefab = GetSingleton <CityPrefab>(); var ecb = barrier.CreateCommandBuffer(); var archetype = UICityLabel.GetCreateArchetype(); Entities .WithoutBurst() .ForEach(( Entity entity, int entityInQueryIndex, in SettlerTag settlerTag, in CommandCreateCity cmdCreateCity, in HexCoordinates hexCoordinates ) => { Entity city = CityEntity.Create(ecb, cityPrefab, entity); UICityLabel.Create(ecb, archetype, hexCoordinates); }