CharacterUI.UpdateActionPoints C# (CSharp) Method

UpdateActionPoints() public method

public UpdateActionPoints ( ) : void
return void
    void UpdateActionPoints()
    {
        Color colorActive = new Color(1, 1, 1, 1);
        Color colorEmpty = new Color(0.5f, 0.5f, 0.5f, 0.3f);

        if (_character != null)
        {
            int nbPoints = _character.CurrentActionPoints;
            for (int i = 0; i < _listActionPoints.Count; ++i)
            {
                Color c;
                if (i < nbPoints)
                {
                    c = colorActive;
                }
                else
                {
                    c = colorEmpty;
                }
                _listActionPoints[i].gameObject.GetComponent<Image>().color = c;
            }
        }
    }