mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
31 lines
869 B
C#
31 lines
869 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using UnityEngine;
|
|
|
|
namespace Marshmallow.General
|
|
{
|
|
static class MakeAmbientLight
|
|
{
|
|
public static void Make(GameObject body)
|
|
{
|
|
GameObject light = new GameObject();
|
|
light.SetActive(false);
|
|
light.transform.parent = body.transform;
|
|
Light l = light.AddComponent<Light>();
|
|
l.type = LightType.Point;
|
|
l.range = 700f;
|
|
l.color = Color.red;
|
|
l.intensity = 0.8f;
|
|
l.shadows = LightShadows.None;
|
|
l.cookie = GameObject.Find("AmbientLight_GD").GetComponent<Light>().cookie;
|
|
|
|
SectorLightsCullGroup cg = light.AddComponent<SectorLightsCullGroup>();
|
|
cg.SetSector(Main.SECTOR);
|
|
|
|
light.SetActive(true);
|
|
}
|
|
}
|
|
}
|