コード例 #1
0
        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);
        }
コード例 #2
0
        void LateUpdate()
        {
            createQuery = UICityLabel.GetUICreateQuery();

            if (createQuery.CalculateEntityCount() > 0)
            {
                CityLabelService.CreateCityLabel(
                    createQuery,
                    cityPanelPrefab,
                    transform,
                    gridCanvas
                    );
            }
        }
コード例 #3
0
        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);
            }