60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
using UnityEngine;
|
|
|
|
public class QualitySetting : MonoBehaviour
|
|
{
|
|
public RealWater WaterPlane;
|
|
|
|
private float native_width = 1920f;
|
|
|
|
private float native_height = 1080f;
|
|
|
|
private void OnGUI()
|
|
{
|
|
float x = (float)Screen.width / native_width;
|
|
float y = (float)Screen.height / native_height;
|
|
GUI.matrix = Matrix4x4.TRS(new Vector3(0f, 0f, 0f), Quaternion.identity, new Vector3(x, y, 1f));
|
|
if (GUI.Button(new Rect(57.6f, 172.8f, 96f, 43.2f), "V.Low"))
|
|
{
|
|
WaterPlane.quality = RealWater.Quality.VeryLow;
|
|
WaterPlane.Reset();
|
|
WaterPlane.InputSmoothingSettings.BlurRadius = 0;
|
|
WaterPlane.InputSmoothingSettings.SmoothingLevel = 3;
|
|
}
|
|
if (GUI.Button(new Rect(172.8f, 172.8f, 96f, 43.2f), "Low"))
|
|
{
|
|
WaterPlane.quality = RealWater.Quality.Low;
|
|
WaterPlane.Reset();
|
|
WaterPlane.InputSmoothingSettings.BlurRadius = 1;
|
|
WaterPlane.InputSmoothingSettings.SmoothingLevel = 3;
|
|
}
|
|
if (GUI.Button(new Rect(288f, 172.8f, 96f, 43.2f), "Med"))
|
|
{
|
|
WaterPlane.quality = RealWater.Quality.Medium;
|
|
WaterPlane.Reset();
|
|
WaterPlane.InputSmoothingSettings.BlurRadius = 2;
|
|
WaterPlane.InputSmoothingSettings.SmoothingLevel = 3;
|
|
}
|
|
if (GUI.Button(new Rect(403.19998f, 172.8f, 96f, 43.2f), "High"))
|
|
{
|
|
WaterPlane.quality = RealWater.Quality.High;
|
|
WaterPlane.Reset();
|
|
WaterPlane.InputSmoothingSettings.BlurRadius = 2;
|
|
WaterPlane.InputSmoothingSettings.SmoothingLevel = 3;
|
|
}
|
|
if (GUI.Button(new Rect(518.4f, 172.8f, 96f, 43.2f), "V.High"))
|
|
{
|
|
WaterPlane.quality = RealWater.Quality.VeryHigh;
|
|
WaterPlane.Reset();
|
|
WaterPlane.InputSmoothingSettings.BlurRadius = 3;
|
|
WaterPlane.InputSmoothingSettings.SmoothingLevel = 3;
|
|
}
|
|
if (GUI.Button(new Rect(633.60004f, 172.8f, 105.6f, 43.2f), "Extreme"))
|
|
{
|
|
WaterPlane.quality = RealWater.Quality.Extreme;
|
|
WaterPlane.Reset();
|
|
WaterPlane.InputSmoothingSettings.BlurRadius = 4;
|
|
WaterPlane.InputSmoothingSettings.SmoothingLevel = 3;
|
|
}
|
|
}
|
|
}
|