Ejemplo n.º 1
0
    /// <summary>
    /// Fetch the target array for this cursor. This highly depends on the target mode
    /// </summary>
    private void updateTargets()
    {
        HexTile tile = character.currentTile;

        List <HexTile> tilesInRange = HexTerrain.GetTilesInRange(tile, maxRange, false);

        targets = tilesInRange.Where(t => t.currentFrame)
                  .Select(t => t.currentFrame)
                  .Where(t => isValidTarget(t))
                  .ToArray();
    }
    /// <summary>
    /// Init the cursor
    /// </summary>
    protected override void OnInitializeCursor()
    {
        selector      = HexTerrain.CreateTileSelector(controller.color, 1.5f, 0.9f);
        outlineHandle = HexTerrain.CreateBorder(HexTerrain.GetTilesInRange(character.currentTile, maxRange, true), controller.color);

        AlphaPingPong anim = selector.AddComponent <AlphaPingPong>();

        anim.intensity = 0.5f;

        selector.transform.position = Vector3.forward * 10000.0f;

        if (GameController.state == GameState.Exploration)
        {
            HexCamera.ShowMask(character, maxRange);
        }

        updateTargets();
        updateSelector();
    }
Ejemplo n.º 3
0
    public void AddArea(HexTile center, int range)
    {
        List <HexTile> tiles = HexTerrain.GetTilesInRange(center, range, true);

        foreach (HexTile tile in tiles)
        {
            tiles.Add(tile);
        }

        areas.Add(new BattlefieldArea()
        {
            center = center.position,
            radius = range * HexTerrain.tileSize
        });

        int i = 0;

        foreach (BattlefieldArea area in areas)
        {
            maskArray[i++] = area.mask;
        }

        maskLength = i;
    }