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(MainClass.SECTOR); light.SetActive(true); }
public static void Make(GameObject body, Sector sector, IPlanetConfig config) { GameObject lightGO = new GameObject(); lightGO.SetActive(false); lightGO.transform.parent = body.transform; Light L = lightGO.AddComponent <Light>(); L.type = LightType.Point; L.range = config.AtmoEndSize + 10; L.color = config.LightTint.ToColor32(); L.intensity = 0.8f; L.shadows = LightShadows.None; L.cookie = GameObject.Find("AmbientLight_GD").GetComponent <Light>().cookie; SectorLightsCullGroup SLCG = lightGO.AddComponent <SectorLightsCullGroup>(); SLCG.SetSector(sector); lightGO.SetActive(true); Logger.Log("Finished building ambient light", Logger.LogType.Log); }