223 lines
5.5 KiB
C#
223 lines
5.5 KiB
C#
using System.Collections.Generic;
|
|
using Artngame.GIPROXY;
|
|
using UnityEngine;
|
|
|
|
namespace Artngame.SKYMASTER
|
|
{
|
|
[ExecuteInEditMode]
|
|
public class SkyMaster : MonoBehaviour
|
|
{
|
|
public GameObject TMPCloudOBJ;
|
|
|
|
public bool AddSmTerrainMat = true;
|
|
|
|
public bool UseTabs = true;
|
|
|
|
public int currentTab;
|
|
|
|
public AnimationCurve IntensityDiff = new AnimationCurve();
|
|
|
|
public AnimationCurve IntensityFog = new AnimationCurve();
|
|
|
|
public AnimationCurve IntensitySun = new AnimationCurve();
|
|
|
|
public AnimationCurve FexposureC = new AnimationCurve();
|
|
|
|
public AnimationCurve FscaleDiffC = new AnimationCurve();
|
|
|
|
public AnimationCurve FSunGC = new AnimationCurve();
|
|
|
|
public AnimationCurve FSunringC = new AnimationCurve();
|
|
|
|
public AnimationCurve heightOffsetFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public AnimationCurve luminanceVFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public AnimationCurve lumFactorFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public AnimationCurve scatterFacFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public AnimationCurve turbidityFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public AnimationCurve turbFacFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public AnimationCurve horizonFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public AnimationCurve contrastFogCurve = new AnimationCurve();
|
|
|
|
[SerializeField]
|
|
public Gradient SkyColorGrad;
|
|
|
|
[SerializeField]
|
|
public Gradient SkyTintGrad;
|
|
|
|
[SerializeField]
|
|
public Gradient VolCloudLitGrad;
|
|
|
|
[SerializeField]
|
|
public Gradient VolCloudShadGrad;
|
|
|
|
[SerializeField]
|
|
public Gradient VolCloudFogGrad;
|
|
|
|
[SerializeField]
|
|
public SkyMasterManager SkyManager;
|
|
|
|
public SeasonalTerrainSKYMASTER TerrainManager;
|
|
|
|
public WaterHandlerSM WaterManager;
|
|
|
|
public LightCollisionsPDM GIProxyManager;
|
|
|
|
public WaterHeightSM WaterHeightHandle;
|
|
|
|
public bool LargeWaterPlane;
|
|
|
|
public float LargeWaterPlaneScale = 1f;
|
|
|
|
public bool OverridePeformance;
|
|
|
|
public bool DecoupleWind = true;
|
|
|
|
public float UpdateInteraval = 0.2f;
|
|
|
|
public int SpreadToFrames = 6;
|
|
|
|
public bool RenewClouds;
|
|
|
|
public bool OverrideRenewSettings;
|
|
|
|
public float FadeInSpeed = 0.15f;
|
|
|
|
public float FadeOutSpeed = 0.3f;
|
|
|
|
public float MaxFadeTime = 1.5f;
|
|
|
|
public float Boundary = 90000f;
|
|
|
|
private float lastFadeInSpeed;
|
|
|
|
private float lastFadeOutSpeed;
|
|
|
|
private float lastMaxFadeTime;
|
|
|
|
private float lastBoundary;
|
|
|
|
public float TerrainDepthSize;
|
|
|
|
public bool PreviewDepthTexture;
|
|
|
|
public List<Terrain> UnityTerrains = new List<Terrain>();
|
|
|
|
public List<GameObject> MeshTerrains = new List<GameObject>();
|
|
|
|
public bool DontScaleParticleTranf;
|
|
|
|
public bool DontScaleParticleProps;
|
|
|
|
public bool SKY_folder = true;
|
|
|
|
public bool water_folder1 = true;
|
|
|
|
public bool foliage_folder1 = true;
|
|
|
|
public bool weather_folder1 = true;
|
|
|
|
public bool cloud_folder1;
|
|
|
|
public bool cloud_folder2;
|
|
|
|
public bool cloud_folder3 = true;
|
|
|
|
public bool cloud_folder4;
|
|
|
|
public bool camera_folder1 = true;
|
|
|
|
public bool terrain_folder1 = true;
|
|
|
|
public bool scaler_folder1 = true;
|
|
|
|
public bool scaler_folder11 = true;
|
|
|
|
public Material MeshTerrainSnowMat;
|
|
|
|
public Material UnityTerrainSnowMat;
|
|
|
|
private void Start()
|
|
{
|
|
if (base.gameObject.name == "GameObject")
|
|
{
|
|
base.gameObject.name = "SKY MASTER MANAGER";
|
|
}
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
SeasonalTerrainSKYMASTER component = GetComponent<SeasonalTerrainSKYMASTER>();
|
|
if (TerrainManager == null && component != null)
|
|
{
|
|
TerrainManager = component;
|
|
}
|
|
if (UnityTerrainSnowMat != null && MeshTerrainSnowMat != null)
|
|
{
|
|
TerrainManager.TerrainMat = UnityTerrainSnowMat;
|
|
SkyManager.SnowMat = MeshTerrainSnowMat;
|
|
SkyManager.SnowMatTerrain = UnityTerrainSnowMat;
|
|
}
|
|
if (TerrainManager == null && SkyManager != null)
|
|
{
|
|
SkyManager.gameObject.AddComponent<SeasonalTerrainSKYMASTER>();
|
|
TerrainManager = SkyManager.gameObject.GetComponent<SeasonalTerrainSKYMASTER>();
|
|
TerrainManager.Mesh_moon = true;
|
|
TerrainManager.Glow_moon = true;
|
|
TerrainManager.Enable_trasition = true;
|
|
TerrainManager.Fog_Sky_Update = true;
|
|
TerrainManager.Foggy_Terrain = true;
|
|
TerrainManager.Use_both_fogs = true;
|
|
TerrainManager.SkyManager = SkyManager;
|
|
}
|
|
if (!Application.isPlaying || !(SkyManager != null))
|
|
{
|
|
return;
|
|
}
|
|
bool flag = false;
|
|
if (SkyManager.currentWeather != null && SkyManager.currentWeather.VolumeScript != null)
|
|
{
|
|
flag = true;
|
|
}
|
|
if (OverridePeformance && flag)
|
|
{
|
|
SkyManager.currentWeather.VolumeScript.DecoupledWind = DecoupleWind;
|
|
SkyManager.currentWeather.VolumeScript.max_divider = SpreadToFrames;
|
|
SkyManager.currentWeather.VolumeScript.UpdateInterval = UpdateInteraval;
|
|
}
|
|
if (RenewClouds)
|
|
{
|
|
if (flag)
|
|
{
|
|
SkyManager.currentWeather.VolumeScript.DestroyOnfadeOut = true;
|
|
SkyManager.currentWeather.VolumeScript.Restore_on_bound = true;
|
|
SkyManager.currentWeather.VolumeScript.Disable_on_bound = true;
|
|
SkyManager.currentWeather.VolumeScript.SmoothInRate = FadeInSpeed;
|
|
SkyManager.currentWeather.VolumeScript.SmoothOutRate = FadeOutSpeed;
|
|
SkyManager.currentWeather.VolumeScript.max_fade_speed = MaxFadeTime;
|
|
SkyManager.currentWeather.VolumeScript.Bound = Boundary;
|
|
}
|
|
}
|
|
else if (flag)
|
|
{
|
|
SkyManager.currentWeather.VolumeScript.DestroyOnfadeOut = false;
|
|
SkyManager.currentWeather.VolumeScript.Restore_on_bound = false;
|
|
SkyManager.currentWeather.VolumeScript.Disable_on_bound = false;
|
|
}
|
|
}
|
|
}
|
|
}
|