上传文件至 Common
This commit is contained in:
36
Common/Graphic.cs
Normal file
36
Common/Graphic.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace SinmaiAssist.Common;
|
||||
|
||||
public class Graphic
|
||||
{
|
||||
public static void ToggleFullscreen()
|
||||
{
|
||||
Screen.fullScreen = !Screen.fullScreen;
|
||||
}
|
||||
|
||||
public static int GetResolutionWidth()
|
||||
{
|
||||
return Screen.width;
|
||||
}
|
||||
public static int GetResolutionHeight()
|
||||
{
|
||||
return Screen.height;
|
||||
}
|
||||
|
||||
public static void SetResolution(int width, int height)
|
||||
{
|
||||
Screen.SetResolution(width, height, Screen.fullScreen);
|
||||
}
|
||||
|
||||
public static int GetMaxFrameRate()
|
||||
{
|
||||
return Application.targetFrameRate;
|
||||
}
|
||||
|
||||
public static void SetMaxFrameRate(int fps)
|
||||
{
|
||||
Application.targetFrameRate = fps;
|
||||
QualitySettings.vSyncCount = 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user