This commit is contained in:
CortexCore
2024-11-14 17:17:46 +08:00
parent 416e3322db
commit b65b45c062
368 changed files with 1785 additions and 400 deletions

View File

@@ -3,17 +3,10 @@ using System.Collections.Generic;
using BITKit;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace Net.Like.Xue.Tokyo.Weather
{
public class ScriptableWeather : ScriptableObject
{
#if UNITY_EDITOR
[SerializeField] private LightingDataAsset lightingDataAsset;
#endif
[SerializeField] private Vector3 sunLightDirection = new Vector3(0, 1, 0);
[SerializeField] private Color sunLightColor;
[SerializeField] private float sunLightIntensity = 1;
@@ -25,10 +18,6 @@ namespace Net.Like.Xue.Tokyo.Weather
[BIT]
public void Save()
{
#if UNITY_EDITOR
lightingDataAsset = Lightmapping.lightingDataAsset;
#endif
sunLightDirection = RenderSettings.sun.transform.eulerAngles;
sunLightIntensity = RenderSettings.sun.intensity;
sunLightColor = RenderSettings.sun.color;
@@ -38,17 +27,11 @@ namespace Net.Like.Xue.Tokyo.Weather
fogMode = RenderSettings.fogMode;
fogColor = RenderSettings.fogColor;
fogDensity = RenderSettings.fogDensity;
#if UNITY_EDITOR
EditorUtility.SetDirty(this);
#endif
}
[BIT]
public void Load()
{
#if UNITY_EDITOR
Lightmapping.lightingDataAsset = lightingDataAsset;
#endif
RenderSettings.sun.transform.eulerAngles = sunLightDirection;
RenderSettings.sun.intensity = sunLightIntensity;
RenderSettings.skybox = skyboxMaterial;