Exemple #1
0
    public void ShowOutlines(bool show = true)
    {
        if (!show)
        {
            OutlineCreator.Tile = Blanktile;
        }
        else
        {
            var pos = IlluminaConverter.ToCoordInt(GridPosition);
            pos         = IlluminaConverter.FlapTopSwitch(pos);
            clickedBase = world.Map.Maps.BasesMap[pos];
        }
        var outlines = OutlineCreator.GetSurroundingPos(IlluminaConverter.ToFlatTopPos(this.GridPosition));

        for (int i = 0; i < outlines.Length; i++)
        {
            var _pos      = IlluminaConverter.ToCoordInt(outlines[i]);
            var available = true;
            if (show)
            {
                available = clickedBase.owner.navigators.Count < 3;
                if (((int)clickedBase.owner.tribe) != GamePlayManager.PlayerTurn)
                {
                    continue;
                }
            }
            if ((!world.Map.Maps.GeneralsMap.ContainsKey(_pos) && !world.Map.Maps.NavigatorsMap.ContainsKey(_pos)) && i != 3 && i != 0 && available)
            {
                OutlinePositions.Add(outlines[i]);
                OutlineCreator.SetTile(outlines[i]);
            }
        }
        OutlineCreator.Tile = (Tile)GameObject.FindGameObjectWithTag("ScriptsContainer").GetComponent <GameAssetsCollection>().Outline;
    }