Example #1
0
    private void PlaceIndicator(OrderIndicator indicator, IIndicatableMove indicatable, GameState state)
    {
        Vector3 fromPos = GetIndicatorPositionFor(indicatable.From, state);
        Vector3 toPos   = GetIndicatorPositionFor(indicatable.To, state);

        indicator.transform.position = fromPos;
        indicator.Target.position    = toPos;
    }
Example #2
0
    private void UpdateOrderIndicators(GameState state)
    {
        bool isSelected = _interactionManager.ActiveFaction == Faction;

        IIndicatableMove[] indicatables = _factionInteraction.IndicatableMoves.ToArray();
        for (int i = 0; i < FactionInteraction.MaxMoves; i++)
        {
            OrderIndicator indicator = _orderIndicators[i];
            bool           exists    = indicatables.Length > i;
            if (isSelected && exists)
            {
                indicator.gameObject.SetActive(true);
                IIndicatableMove indicatable = indicatables[i];
                PlaceIndicator(indicator, indicatable, state);
            }
            else
            {
                indicator.gameObject.SetActive(false);
            }
        }
    }