mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
commit
0633437061
@ -11,6 +11,8 @@ namespace NewHorizons.Components
|
|||||||
private GameObject _star;
|
private GameObject _star;
|
||||||
private Renderer[] _starRenderers;
|
private Renderer[] _starRenderers;
|
||||||
private TessellatedRenderer[] _starTessellatedRenderers;
|
private TessellatedRenderer[] _starTessellatedRenderers;
|
||||||
|
private ParticleSystemRenderer[] _starParticleRenderers;
|
||||||
|
private SolarFlareEmitter _solarFlareEmitter;
|
||||||
|
|
||||||
public override void Awake()
|
public override void Awake()
|
||||||
{
|
{
|
||||||
@ -20,10 +22,12 @@ namespace NewHorizons.Components
|
|||||||
// Else it can stop the supernova effect mid way through
|
// Else it can stop the supernova effect mid way through
|
||||||
_star = GetComponentInChildren<StarEvolutionController>()?.gameObject;
|
_star = GetComponentInChildren<StarEvolutionController>()?.gameObject;
|
||||||
|
|
||||||
if(_star != null)
|
if (_star != null)
|
||||||
{
|
{
|
||||||
_starRenderers = _star.GetComponentsInChildren<Renderer>();
|
_starRenderers = _star.GetComponentsInChildren<Renderer>();
|
||||||
_starTessellatedRenderers = _star.GetComponentsInChildren<TessellatedRenderer>();
|
_starTessellatedRenderers = _star.GetComponentsInChildren<TessellatedRenderer>();
|
||||||
|
_starParticleRenderers = _star.GetComponentsInChildren<ParticleSystemRenderer>();
|
||||||
|
_solarFlareEmitter = _star.GetComponentInChildren<SolarFlareEmitter>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start off
|
// Start off
|
||||||
@ -62,8 +66,13 @@ namespace NewHorizons.Components
|
|||||||
child.gameObject.SetActive(on);
|
child.gameObject.SetActive(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_star != null)
|
if (_star != null)
|
||||||
{
|
{
|
||||||
|
if (_solarFlareEmitter != null)
|
||||||
|
{
|
||||||
|
_solarFlareEmitter.gameObject.SetActive(on);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var renderer in _starRenderers)
|
foreach (var renderer in _starRenderers)
|
||||||
{
|
{
|
||||||
renderer.enabled = on;
|
renderer.enabled = on;
|
||||||
@ -73,6 +82,11 @@ namespace NewHorizons.Components
|
|||||||
{
|
{
|
||||||
renderer.enabled = on;
|
renderer.enabled = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var renderer in _starParticleRenderers)
|
||||||
|
{
|
||||||
|
renderer.enabled = on;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using NewHorizons.Builder.General;
|
using NewHorizons.Builder.General;
|
||||||
|
using NewHorizons.Builder.Orbital;
|
||||||
using NewHorizons.Components.Orbital;
|
using NewHorizons.Components.Orbital;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
@ -122,12 +123,14 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
private void SetNewOrbit(AstroObject primaryBody, OrbitalParameters orbitalParameters)
|
private void SetNewOrbit(AstroObject primaryBody, OrbitalParameters orbitalParameters)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
_astroObject._primaryBody = primaryBody;
|
_astroObject._primaryBody = primaryBody;
|
||||||
DetectorBuilder.SetDetector(primaryBody, _astroObject, _detector);
|
DetectorBuilder.SetDetector(primaryBody, _astroObject, _detector);
|
||||||
|
_detector._activeInheritedDetector = primaryBody.GetComponentInChildren<ForceDetector>();
|
||||||
|
_detector._activeVolumes = new List<EffectVolume>() { primaryBody.GetGravityVolume() };
|
||||||
if (_alignment != null) _alignment.SetTargetBody(primaryBody.GetComponent<OWRigidbody>());
|
if (_alignment != null) _alignment.SetTargetBody(primaryBody.GetComponent<OWRigidbody>());
|
||||||
|
|
||||||
|
_astroObject.SetOrbitalParametersFromTrueAnomaly(orbitalParameters.Eccentricity, orbitalParameters.SemiMajorAxis, orbitalParameters.Inclination, orbitalParameters.ArgumentOfPeriapsis, orbitalParameters.LongitudeOfAscendingNode, orbitalParameters.TrueAnomaly);
|
||||||
|
|
||||||
PlanetCreationHandler.UpdatePosition(gameObject, orbitalParameters, primaryBody, _astroObject);
|
PlanetCreationHandler.UpdatePosition(gameObject, orbitalParameters, primaryBody, _astroObject);
|
||||||
|
|
||||||
if (!Physics.autoSyncTransforms)
|
if (!Physics.autoSyncTransforms)
|
||||||
@ -135,7 +138,7 @@ namespace NewHorizons.Components
|
|||||||
Physics.SyncTransforms();
|
Physics.SyncTransforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
_rb.SetVelocity(orbitalParameters.InitialVelocity);
|
_rb.SetVelocity(orbitalParameters.InitialVelocity + primaryBody.GetAttachedOWRigidbody().GetVelocity());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPlayerBlink()
|
private void OnPlayerBlink()
|
||||||
|
|||||||
@ -44,6 +44,8 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
|
|
||||||
private StarEvolutionController _proxy;
|
private StarEvolutionController _proxy;
|
||||||
|
|
||||||
|
private float maxScale;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
var sun = GameObject.FindObjectOfType<SunController>();
|
var sun = GameObject.FindObjectOfType<SunController>();
|
||||||
@ -89,6 +91,11 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (willExplode) GlobalMessenger.AddListener("TriggerSupernova", Die);
|
if (willExplode) GlobalMessenger.AddListener("TriggerSupernova", Die);
|
||||||
|
|
||||||
|
if(scaleCurve != null)
|
||||||
|
{
|
||||||
|
maxScale = scaleCurve.keys.Select(x => x.value).Max() * size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnDestroy()
|
public void OnDestroy()
|
||||||
@ -142,9 +149,12 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
{
|
{
|
||||||
base.FixedUpdate();
|
base.FixedUpdate();
|
||||||
|
|
||||||
currentColour = Color.Lerp(_startColour, _endColour, ageValue);
|
// Use the age if theres no resizing happening, else make it get redder the larger it is or wtv
|
||||||
|
var t = ageValue;
|
||||||
|
if(maxScale > 0) t = CurrentScale / maxScale;
|
||||||
|
currentColour = Color.Lerp(_startColour, _endColour, t);
|
||||||
|
|
||||||
supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, ageValue);
|
supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, t);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -611,7 +611,7 @@ namespace NewHorizons.Handlers
|
|||||||
if (primaryBody != null)
|
if (primaryBody != null)
|
||||||
{
|
{
|
||||||
var primaryGravity = new Gravity(primaryBody.GetGravityVolume());
|
var primaryGravity = new Gravity(primaryBody.GetGravityVolume());
|
||||||
var secondaryGravity = new Gravity(secondaryBody.GetGravityVolume()); ;
|
var secondaryGravity = new Gravity(secondaryBody.GetGravityVolume());
|
||||||
|
|
||||||
go.transform.position = orbit.GetOrbitalParameters(primaryGravity, secondaryGravity).InitialPosition + primaryBody.transform.position;
|
go.transform.position = orbit.GetOrbitalParameters(primaryGravity, secondaryGravity).InitialPosition + primaryBody.transform.position;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -193,12 +193,12 @@
|
|||||||
"canShowOnTitle": {
|
"canShowOnTitle": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Should this planet ever be shown on the title screen",
|
"description": "Should this planet ever be shown on the title screen",
|
||||||
"default": "true"
|
"default": true
|
||||||
},
|
},
|
||||||
"isQuantumState": {
|
"isQuantumState": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Does this config describe a quantum state of a custom planet defined in another file?",
|
"description": "Does this config describe a quantum state of a custom planet defined in another file?",
|
||||||
"default": "false"
|
"default": false
|
||||||
},
|
},
|
||||||
"Base": {
|
"Base": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -950,7 +950,7 @@
|
|||||||
"description": "For creating different objects containing translatable text.",
|
"description": "For creating different objects containing translatable text.",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": "false",
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"position": {
|
"position": {
|
||||||
"$ref": "#/$defs/vector3",
|
"$ref": "#/$defs/vector3",
|
||||||
@ -989,7 +989,7 @@
|
|||||||
"description": "Additional information about each arc in the text",
|
"description": "Additional information about each arc in the text",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": "false",
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"position": {
|
"position": {
|
||||||
"$ref": "#/$defs/vector2",
|
"$ref": "#/$defs/vector2",
|
||||||
@ -1023,7 +1023,7 @@
|
|||||||
"description": "Like those on Giant's Deep",
|
"description": "Like those on Giant's Deep",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": "false",
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"position": {
|
"position": {
|
||||||
"$ref": "#/$defs/vector3",
|
"$ref": "#/$defs/vector3",
|
||||||
@ -1069,7 +1069,7 @@
|
|||||||
"description": "Like those in the DLC",
|
"description": "Like those in the DLC",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": "false",
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"position": {
|
"position": {
|
||||||
"$ref": "#/$defs/vector3",
|
"$ref": "#/$defs/vector3",
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"author": "xen, Bwc9876, & Book",
|
"author": "xen, Bwc9876, & Book",
|
||||||
"name": "New Horizons",
|
"name": "New Horizons",
|
||||||
"uniqueName": "xen.NewHorizons",
|
"uniqueName": "xen.NewHorizons",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"owmlVersion": "2.1.0",
|
"owmlVersion": "2.1.0",
|
||||||
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.AutoResume", "PacificEngine.OW_Randomizer" ],
|
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.AutoResume", "PacificEngine.OW_Randomizer" ],
|
||||||
"pathsToPreserve": [ "planets", "systems", "translations" ]
|
"pathsToPreserve": [ "planets", "systems", "translations" ]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user