Answers for "unity c# change game resolution"

C#
2

unity c# change game resolution

using UnityEngine;
public class ExampleScript : MonoBehaviour
{
    void Start()
    {
        // Switch to 640 x 480 full-screen
        Screen.SetResolution(640, 480, true);
        
        // Switch to 640 x 480 full-screen at 60 hz
        Screen.SetResolution(640, 480, true, 60);
        
        // Switch to 800 x 600 windowed
        Screen.SetResolution(800, 600, false);
    }
}

//A resolution switch does not happen immediately;
//it will actually happen when the current frame is finished.
Posted by: Guest on February-09-2021

C# Answers by Framework

Browse Popular Code Answers by Language