From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/Scene/LightMapSwitcher.cs | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Client/Assets/Scripts/Scene/LightMapSwitcher.cs (limited to 'Client/Assets/Scripts/Scene/LightMapSwitcher.cs') diff --git a/Client/Assets/Scripts/Scene/LightMapSwitcher.cs b/Client/Assets/Scripts/Scene/LightMapSwitcher.cs new file mode 100644 index 00000000..a7433606 --- /dev/null +++ b/Client/Assets/Scripts/Scene/LightMapSwitcher.cs @@ -0,0 +1,68 @@ +using UnityEngine; + +using System.Linq; + +public class LightMapSwitcher : MonoBehaviour +{ + //public Texture2D[] DayNear; + public Texture2D[] DayFar; + //public Texture2D[] NightNear; + public Texture2D[] NightFar; + + private LightmapData[] dayLightMaps; + private LightmapData[] nightLightMaps; + + void Start () + { + + + // Sort the Day and Night arrays in numerical order, so you can just blindly drag and drop them into the inspector + //DayNear = DayNear.OrderBy(t2d => t2d.name, new NaturalSortComparer()).ToArray(); + DayFar = DayFar.OrderBy(t2d => t2d.name, new NaturalSortComparer()).ToArray(); + //NightNear = NightNear.OrderBy(t2d => t2d.name, new NaturalSortComparer()).ToArray(); + NightFar = NightFar.OrderBy(t2d => t2d.name, new NaturalSortComparer()).ToArray(); + + // Put them in a LightMapData structure + dayLightMaps = new LightmapData[DayFar.Length]; + for (int i=0; i