Merge branch 'dev' into shock

This commit is contained in:
Noah Pilarski 2022-08-16 02:08:04 -04:00
commit 7eb11e980c
3 changed files with 11 additions and 9 deletions

View File

@ -6,22 +6,27 @@ namespace NewHorizons.Builder.General
{ {
public static Light Make(GameObject planetGO, Sector sector, float scale, float intensity) public static Light Make(GameObject planetGO, Sector sector, float scale, float intensity)
{ {
GameObject lightGO = GameObject.Instantiate(SearchUtilities.Find("BrittleHollow_Body/AmbientLight_BH_Surface"), sector?.transform ?? planetGO.transform); GameObject lightGO = GameObject.Instantiate(SearchUtilities.Find("QuantumMoon_Body/AmbientLight_QM"), sector?.transform ?? planetGO.transform);
lightGO.transform.position = planetGO.transform.position; lightGO.transform.position = planetGO.transform.position;
lightGO.name = "Light"; lightGO.name = "AmbientLight";
var light = lightGO.GetComponent<Light>(); var light = lightGO.GetComponent<Light>();
light.name = "AmbientLight";
/* R is related to the inner radius of the ambient light volume /* R is related to the inner radius of the ambient light volume
* G is if its a shell or not. 1.0f for shell else 0.0f. * G is if its a shell or not. 1.0f for shell else 0.0f.
* B is just 1.0 always I think, altho no because changing it changes the brightness so idk * B is just 1.0 always I think, altho no because changing it changes the brightness so idk
* A is the intensity and its like square rooted and squared and idgi * A is the intensity and its like square rooted and squared and idgi
*/ */
light.color = new Color(0.0f, 0.0f, 0.8f, 0.0225f); light.color = new Color(0.5f, 0.0f, 0.8f, 0.0225f);
light.range = scale; light.range = scale;
light.intensity = intensity; light.intensity = intensity;
/*if (tint != null)
{
var cubemap = ImageUtilities.TintImage(ImageUtilities.GetTexture(Main.Instance, "Assets/textures/AmbientLight_QM.png"), tint.ToColor());
light.cookie = cubemap;
}*/
return light; return light;
} }
} }

View File

@ -89,7 +89,7 @@ namespace NewHorizons.Builder.General
fluidDetector._splashEffects = splashEffects.ToArray(); fluidDetector._splashEffects = splashEffects.ToArray();
} }
SetDetector(primaryBody, astroObject, forceDetector); if (!config.Orbit.isStatic) SetDetector(primaryBody, astroObject, forceDetector);
detectorGO.SetActive(true); detectorGO.SetActive(true);
return detectorGO; return detectorGO;

View File

@ -434,10 +434,7 @@ namespace NewHorizons.Handlers
Delay.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao as NHAstroObject, body.Config.Orbit.isMoon, body.Config)); Delay.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao as NHAstroObject, body.Config.Orbit.isMoon, body.Config));
} }
if (!body.Config.Orbit.isStatic)
{
DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config); DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config);
}
AstroObjectLocator.RegisterCustomAstroObject(ao); AstroObjectLocator.RegisterCustomAstroObject(ao);