コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        switch (PlayerPrefs.GetString(pref_keys.c_tile_highlighted_str.ToString()))
        {
        default:
        case "#EDF50C":
            color_button01.GetComponent <Button>().interactable = false;
            break;

        case "#17A4EB":
            color_button02.GetComponent <Button>().interactable = false;
            break;

        case "#4BC96E":
            color_button03.GetComponent <Button>().interactable = false;
            break;
        }

        current_error = (error_Highlighting)PlayerPrefs.GetInt(pref_keys.error_highlighting_int.ToString());
        error_button.GetComponentInChildren <Text>().text = current_error.ToString();
        color_button01.GetComponent <Button>().onClick.AddListener(delegate { ColorButtons(color_Themes.Yellow); });
        color_button02.GetComponent <Button>().onClick.AddListener(delegate { ColorButtons(color_Themes.Blue); });
        color_button03.GetComponent <Button>().onClick.AddListener(delegate { ColorButtons(color_Themes.Green); });
        color_buttons.AddRange(new List <Button> {
            color_button01.GetComponent <Button>(),
            color_button02.GetComponent <Button>(),
            color_button03.GetComponent <Button>()
        });
    }
コード例 #2
0
    public void CycleError()
    {
        List <Options.error_Highlighting> valueList = Enum.GetValues(typeof(error_Highlighting)).Cast <Options.error_Highlighting>().ToList();
        int j = valueList.IndexOf(current_error) + 1;

        j             = valueList.Count == j ? 0 : j;
        current_error = (error_Highlighting)j;
        PlayerPrefs.SetInt(pref_keys.error_highlighting_int.ToString(), j);
        error_button.GetComponentInChildren <Text>().text = current_error.ToString();
    }