using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GameManager : MonoBehaviour
{
    [SerializeField] private Text[] _texts;
    private int _valeur1 = 4;
    private int _valeur2 = 6;
    private int _valeur3 = 8;

    void Start()
    {
        Debug.Log("Hello World");
    }

    private void Afficher()
    {
        _texts[0].text = _valeur1.ToString();
        _texts[1].text = _valeur2.ToString();
        _texts[2].text = _valeur3.ToString();
    }

    public void CocherToggle(Toggle toggle)
    {
        Afficher();

        if (toggle.isOn)
        {
            if (toggle.name == "Toggle1")
            {
                _texts[0].text = $"<color=red>{_valeur1 * 2}</color>";
            }
            else if (toggle.name == "Toggle2")
            {
                _texts[1].text = $"<b>{_valeur2 * 2}</b>";
            }
            else
            {
                _texts[2].text = $"<color=yellow><size=30>{_valeur3 * 2}</size></color>";
            }
        }
    }
    
}