public UnityEngine.Color GetHexAttributeColor(HexAttribute attribute)
        {
            hexType = hexType ?? typeof(HexAttribute);
            var list = GetColorList(hexType);

            list = list ?? ConvertToColorList(hexType, hexAttributeColors);
            return(GetColor(list, (uint)attribute));
        }
            public void SetHexInfo(UnitSide side, uint index, HexAttribute attribute)
            {
                if (hex)
                {
                    hex.hexIndex  = index;
                    hex.attribute = attribute;
                }

                foreach (var u in units)
                {
                    u.side = side;
                }
            }
Ejemplo n.º 3
0
 public static UnityEngine.Color GetHexAttributeColor(HexAttribute attribute)
 {
     return(Instance.hexAttributeColorSettings.GetHexAttributeColor(attribute));
 }
Ejemplo n.º 4
0
        public static EntityTemplate CreateHexEntityTemplate(Coordinates coords, uint index, HexAttribute attribute, int hexId, UnitSide side)
        {
            var template = new EntityTemplate();

            template.AddComponent(new Position.Snapshot(coords), WorkerUtils.UnityGameLogic);
            template.AddComponent(new Metadata.Snapshot("HexBase"), WorkerUtils.UnityGameLogic);
            template.AddComponent(new Persistence.Snapshot(), WorkerUtils.UnityGameLogic);
            template.AddComponent(new HexBase.Snapshot {
                Index = index, Attribute = attribute, HexId = hexId, Side = side
            }, WorkerUtils.UnityGameLogic);
            template.AddComponent(new HexPower.Snapshot()
            {
                IsActive = false, SidePowers = new Dictionary <UnitSide, float>()
            }, WorkerUtils.UnityGameLogic);

            if (hexId % 3 == 0)
            {
                template.AddComponent(new StrategyHexAccessPortal.Snapshot {
                    FrontHexes = new Dictionary <UnitSide, FrontHexInfo>(), HexIndexes = new Dictionary <uint, HexIndex>()
                }, WorkerUtils.UnityGameLogic);
            }

            template.SetReadAccess(WorkerUtils.AllWorkerAttributes.ToArray());
            template.SetComponentWriteAccess(EntityAcl.ComponentId, WorkerUtils.UnityGameLogic);

            return(template);
        }