1
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user