コード例 #1
0
    private object SetResolution(int id)
    {
        _resolution = (Resolution)id;
        PlayerPrefHelper.SetResolution(_resolution);
        _resolutionData.text = _resolution.GetDescription().ToLower();
        var resStr = _resolution.ToString();
        int width  = int.Parse(resStr.Substring(1, resStr.IndexOf('x') - 1));
        int height = int.Parse(resStr.Substring(resStr.IndexOf('x') + 1));

        Debug.Log($"{width} x {height}");
        Screen.SetResolution(width, height, false);
        return(true);
    }