new-horizons/NewHorizons/General/AmbientLightBuilder.cs
Nick J. Connors 52584c278d Icospheres and API
New mesh generation for heightmap planets.
Made the API work.
Added air to planets.
Ambient light works.
Atmospheres work.
2021-12-17 22:19:08 -05:00

27 lines
854 B
C#

using NewHorizons.External;
using NewHorizons.Utility;
using OWML.Utils;
using UnityEngine;
using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.General
{
static class AmbientLightBuilder
{
public static void Make(GameObject body, float scale)
{
GameObject lightGO = GameObject.Instantiate(GameObject.Find("BrittleHollow_Body/AmbientLight_BH_Surface"), body.transform);
lightGO.transform.localPosition = Vector3.zero;
lightGO.name = "Light";
var light = lightGO.GetComponent<Light>();
light.name = "AmbientLight";
light.color = new Color(0.5f, 1f, 1f, 0.0225f);
light.range = scale;
light.intensity = 0.5f;
Logger.Log("Finished building ambient light", Logger.LogType.Log);
}
}
}