Files
2026-03-04 10:03:45 +08:00

302 lines
9.7 KiB
C#

using Artngame.GIPROXY;
using UnityEngine;
namespace Artngame.SKYMASTER
{
public class SKYMASTER_Demo2 : MonoBehaviour
{
private ControlGIPROXY_ATTRIUM_SM GI_controller;
public float Sun_time_start = 14.43f;
public GameObject SKYMASTER_OBJ;
private SkyMasterManager SUNMASTER;
public GameObject SUN;
public GameObject TREES;
public bool HUD_ON = true;
private float HDR = 0.8f;
private float Esun = 22f;
private float Kr = 0.0025f;
private float Km = 0.0015f;
private float GE = -0.96f;
private float SPEED = 0.01f;
private float fSamples = 3f;
private float fScaleDepth = 0.5f;
private bool set_sun_start;
private float Ring_factor;
private Vector3 CURRENT_Force_color = new Vector3(0.65f, 0.52f, 0.475f);
private float Coloration = 0.28f;
private Vector4 TintColor = new Vector4(0f, 0f, 0f, 0f);
private bool enable_controls;
public GameObject Clouds_top;
public GameObject Clouds_bottom;
public GameObject Flat_Clouds_top;
public GameObject Flat_Clouds_bottom;
public GameObject Cloud_Dome;
public GameObject Cloud_Rays;
public GameObject Cloud_Static;
private float Dome_rot;
public GameObject Tornado1;
public GameObject Tornado2;
public GameObject Butterflies;
public GameObject FreezeEffect;
public GameObject LightningStorm;
public bool Auto_Season_Cycle;
private float Cycle_speed = 1500f;
private bool GI_controls_on;
private void Start()
{
if (SKYMASTER_OBJ != null)
{
SUNMASTER = SKYMASTER_OBJ.GetComponent(typeof(SkyMasterManager)) as SkyMasterManager;
}
SPEED = SUNMASTER.SPEED;
SUNMASTER.Seasonal_change_auto = false;
GI_controller = SUNMASTER.SUN_LIGHT.GetComponent(typeof(ControlGIPROXY_ATTRIUM_SM)) as ControlGIPROXY_ATTRIUM_SM;
if (GI_controller != null)
{
GI_controller.enabled = false;
}
}
private void OnGUI()
{
float num = 100f;
float num2 = 30f;
if ((SUNMASTER.Current_Time != Sun_time_start) & !set_sun_start)
{
set_sun_start = true;
}
if (SUNMASTER.Season == 1)
{
if (!Butterflies.activeInHierarchy)
{
Butterflies.SetActive(value: true);
}
}
else if (Butterflies.activeInHierarchy)
{
Butterflies.SetActive(value: false);
}
GI_controls_on = false;
if (GI_controls_on)
{
return;
}
if (GUI.Button(new Rect(5f * num + 10f, num2 + 0f, num, 30f), "Sunny"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.Sunny;
SUNMASTER.On_demand = true;
}
Auto_Season_Cycle = false;
if (!Auto_Season_Cycle)
{
if (GUI.Button(new Rect(2f * num + 10f, num2 - 0f, num, 30f), "Cloudy"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.Cloudy;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(2f * num + 10f, num2 + 30f, num, 30f), "Heavy Rain"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.FlatClouds;
SUNMASTER.On_demand = true;
}
string text = "Spring";
if (SUNMASTER.Season == 2)
{
text = "Summer";
}
if (SUNMASTER.Season == 3)
{
text = "Autumn";
}
if (SUNMASTER.Season == 4)
{
text = "Winter";
}
GUI.TextArea(new Rect(2f * num + 10f - 0f, num2 + 60f + 30f, num / 1f, 25f), text);
if (GUI.Button(new Rect(2f * num + 10f, num2 + 60f, num, 30f), "Cycle Season"))
{
if (SUNMASTER.Season == 0)
{
SUNMASTER.Season = 2;
}
else
{
SUNMASTER.Season++;
}
if (SUNMASTER.Season > 4)
{
SUNMASTER.Season = 1;
}
}
if (GUI.Button(new Rect(2f * num + 10f, num2 + 60f + 30f + 25f, num, 30f), "Foggy"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.HeavyFog;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(3f * num + 10f, num2 - 0f, num, 30f), "Snow storm"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.FreezeStorm;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(2f * num + 10f, num2 - 30f, num, 30f), "Heavy Storm"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.HeavyStorm;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(3f * num + 10f, num2 - 30f, num, 30f), "Dark Storm"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.HeavyStormDark;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(4f * num + 10f, num2 - 30f, num, 30f), "Lightning"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.LightningStorm;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(5f * num + 10f, num2 - 30f, num, 30f), "Volume Fog"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.RollingFog;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(6f * num + 10f, num2 - 30f, num + 10f, 30f), "Tornado"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.Tornado;
SUNMASTER.On_demand = true;
}
if (GUI.Button(new Rect(6f * num + 10f, num2 + 0f, num + 10f, 30f), "Volcano Erupt"))
{
SUNMASTER.Weather = SkyMasterManager.Weather_types.VolcanoErupt;
SUNMASTER.On_demand = true;
}
GUI.TextArea(new Rect(6f * num + 10f, num2 + 30f, num + 10f, 25f), "SkyDome rot");
Dome_rot = GUI.HorizontalSlider(new Rect(6f * num + 10f, num2 + 30f + 30f, num + 10f, 30f), Dome_rot, 0f, 10f);
SUNMASTER.Horizontal_factor = Dome_rot;
if (GUI.Button(new Rect(5f, 0f * num2, 150f, 20f), "Enable Controls"))
{
if (enable_controls)
{
enable_controls = false;
SUNMASTER.Auto_Cycle_Sky = true;
}
else
{
enable_controls = true;
SUNMASTER.Auto_Cycle_Sky = false;
}
}
num2 += 20f;
float num3 = 50f;
GUI.TextArea(new Rect(5f, 5f * num2 + num3, 100f, 20f), "Speed");
SPEED = GUI.HorizontalSlider(new Rect(10f, 5f * num2 + num3 + 30f, 100f, 30f), SPEED, 0.01f, 70f);
SUNMASTER.SPEED = SPEED;
if (enable_controls)
{
GUI.TextArea(new Rect(5f, 0f * num2 + num3, 150f, 20f), "Increase HDR brightness");
HDR = GUI.HorizontalSlider(new Rect(10f, 0f * num2 + num3 + 30f, 150f, 30f), HDR, 0.05f, 3f);
SUNMASTER.m_fExposure = HDR;
GUI.TextArea(new Rect(5f, 1f * num2 + num3, 150f, 20f), "Esun");
Esun = GUI.HorizontalSlider(new Rect(10f, 1f * num2 + num3 + 30f, 150f, 30f), Esun, 0.9f, 80f);
SUNMASTER.m_ESun = Esun;
GUI.TextArea(new Rect(5f, 2f * num2 + num3, 150f, 20f), "Kr - White to Red factor");
Kr = GUI.HorizontalSlider(new Rect(10f, 2f * num2 + num3 + 30f, 150f, 30f), Kr, 0.0001f, 0.014f);
SUNMASTER.m_Kr = Kr;
GUI.TextArea(new Rect(5f, 3f * num2 + num3, 150f, 20f), "Km - Vertical effect factor");
Km = GUI.HorizontalSlider(new Rect(10f, 3f * num2 + num3 + 30f, 150f, 30f), Km, 0.0003f, 0.1195f);
SUNMASTER.m_Km = Km;
GUI.TextArea(new Rect(5f, 4f * num2 + num3, 150f, 20f), "G - Focus factor");
GE = GUI.HorizontalSlider(new Rect(10f, 4f * num2 + num3 + 30f, 150f, 30f), GE, -0.69f, -0.9999f);
SUNMASTER.m_g = GE;
GUI.TextArea(new Rect(5f, 6f * num2 + num3, 100f, 20f), "Sun Ring factor");
Ring_factor = GUI.HorizontalSlider(new Rect(10f, 6f * num2 + num3 + 30f, 100f, 30f), Ring_factor, 0f, 0.15f);
SUNMASTER.Sun_ring_factor = Ring_factor;
GUI.TextArea(new Rect(5f, 7f * num2 + num3, 150f, 20f), "Samples");
fSamples = GUI.HorizontalSlider(new Rect(10f, 7f * num2 + num3 + 30f, 150f, 30f), fSamples, 1f, 4f);
SUNMASTER.m_fSamples = fSamples;
GUI.TextArea(new Rect(5f, 8f * num2 + num3, 150f, 20f), "Scale depth");
fScaleDepth = GUI.HorizontalSlider(new Rect(10f, 8f * num2 + num3 + 30f, 150f, 30f), fScaleDepth, 0.1f, 2f);
SUNMASTER.m_fRayleighScaleDepth = fScaleDepth;
float num4 = 50f;
float num5 = 50f;
Rect position = new Rect(num4 + 130f, num5 + 140f - 20f + 70f, 180f, 20f);
Vector3 cURRENT_Force_color = CURRENT_Force_color;
GUI.TextArea(position, "Tint: " + cURRENT_Force_color.ToString());
SUNMASTER.m_fWaveLength.x = GUI.HorizontalSlider(new Rect(num4 + 130f, num5 + 140f + 70f, 100f, 30f), SUNMASTER.m_fWaveLength.x, 0f, 1f);
CURRENT_Force_color.x = SUNMASTER.m_fWaveLength.x;
SUNMASTER.m_fWaveLength.y = GUI.HorizontalSlider(new Rect(num4 + 130f, num5 + 172f + 70f, 100f, 30f), SUNMASTER.m_fWaveLength.y, 0f, 1f);
CURRENT_Force_color.y = SUNMASTER.m_fWaveLength.y;
SUNMASTER.m_fWaveLength.z = GUI.HorizontalSlider(new Rect(num4 + 130f, num5 + 204f + 70f, 100f, 30f), SUNMASTER.m_fWaveLength.z, 0f, 1f);
CURRENT_Force_color.z = SUNMASTER.m_fWaveLength.z;
num4 = 50f;
num5 = 150f;
Rect position2 = new Rect(num4 + 130f, num5 + 140f - 20f + 70f, 180f, 20f);
Vector4 tintColor = TintColor;
GUI.TextArea(position2, "Global tint: " + tintColor.ToString());
SUNMASTER.m_TintColor.r = GUI.HorizontalSlider(new Rect(num4 + 130f, num5 + 140f + 70f, 100f, 30f), SUNMASTER.m_TintColor.r, 0f, 1f);
TintColor.x = SUNMASTER.m_TintColor.r;
SUNMASTER.m_TintColor.g = GUI.HorizontalSlider(new Rect(num4 + 130f, num5 + 172f + 70f, 100f, 30f), SUNMASTER.m_TintColor.g, 0f, 1f);
TintColor.y = SUNMASTER.m_TintColor.g;
SUNMASTER.m_TintColor.b = GUI.HorizontalSlider(new Rect(num4 + 130f, num5 + 204f + 70f, 100f, 30f), SUNMASTER.m_TintColor.b, 0f, 1f);
TintColor.z = SUNMASTER.m_TintColor.b;
GUI.TextArea(new Rect(num4 + 130f, num5 + 204f + 70f + 30f, 100f, 30f), "Coloration");
Coloration = GUI.HorizontalSlider(new Rect(num4 + 130f, num5 + 204f + 70f + 30f + 30f, 100f, 30f), Coloration, 0.1f, 2f);
SUNMASTER.m_Coloration = Coloration;
}
}
else
{
string text2 = "Spring";
if (SUNMASTER.Season == 2)
{
text2 = "Summer";
}
if (SUNMASTER.Season == 3)
{
text2 = "Autumn";
}
if (SUNMASTER.Season == 4)
{
text2 = "Winter";
}
GUI.TextArea(new Rect(5f * num + 10f, num2 + 30f, num, 30f), text2);
}
}
}
}