50 lines
2.2 KiB
C#
50 lines
2.2 KiB
C#
using UnityEngine;
|
|
|
|
public class LargePlaneGui : MonoBehaviour
|
|
{
|
|
public GUIStyle SubTitle;
|
|
|
|
public RealWaterCollider Controller1;
|
|
|
|
public RealWaterSpeedManager speedManager;
|
|
|
|
public RealWaterNormalMap WaterPlane;
|
|
|
|
public GUIStyle Normal;
|
|
|
|
public GUIStyle Title;
|
|
|
|
private float inputForce = 0.717f;
|
|
|
|
private float inputForcePrev = 0.717f;
|
|
|
|
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));
|
|
GUI.depth = 10;
|
|
GUI.Box(new Rect(38.399998f, 81f, 729.6f, 324f), "");
|
|
GUI.Label(new Rect(57.6f, 97.200005f, 288f, 43.2f), "RealWater Settings", Title);
|
|
GUI.Label(new Rect(57.6f, 162f, 288f, 43.2f), "Damping: " + WaterPlane.Damping.ToString("F2"), Normal);
|
|
WaterPlane.Damping = GUI.HorizontalSlider(new Rect(211.2f, 166.31999f, 288f, 32.399998f), WaterPlane.Damping, 0.8f, 0.99f);
|
|
GUI.Label(new Rect(57.6f, 205.2f, 288f, 43.2f), "Speed: " + speedManager.Speed.ToString("F0"), Normal);
|
|
speedManager.Speed = GUI.HorizontalSlider(new Rect(211.2f, 209.52f, 288f, 32.399998f), speedManager.Speed, 10f, 100f);
|
|
GUI.Label(new Rect(57.6f, 248.40001f, 288f, 43.2f), "Simulation Area: " + WaterPlane.simulationSettings.simSize.ToString("F0") + "x" + WaterPlane.simulationSettings.simSize.ToString("F0"), Normal);
|
|
WaterPlane.simulationSettings.simSize = (int)GUI.HorizontalSlider(new Rect(326.4f, 252.72f, 288f, 32.399998f), WaterPlane.simulationSettings.simSize, 90f, 300f);
|
|
GUI.Label(new Rect(57.6f, 291.6f, 288f, 43.2f), "Input Force: " + Controller1.InputForce.ToString("F2"), Normal);
|
|
inputForce = GUI.HorizontalSlider(new Rect(230.4f, 295.91998f, 288f, 32.399998f), Controller1.InputForce, 0.1f, 1f);
|
|
if (inputForcePrev != inputForce)
|
|
{
|
|
Controller1.InputForce = inputForce;
|
|
inputForcePrev = inputForce;
|
|
}
|
|
GUI.Label(new Rect(57.6f, 334.8f, 288f, 43.2f), "Obstruction Texture: ", Normal);
|
|
WaterPlane.obstructionTextureSettings.ObstructionTexturesEnabled = GUI.Toggle(new Rect(268.8f, 334.8f, 60.288f, 32.399998f), WaterPlane.obstructionTextureSettings.ObstructionTexturesEnabled, "");
|
|
}
|
|
}
|