mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' of https://github.com/xen-42/outer-wilds-new-horizons into dev
This commit is contained in:
commit
88ae09941b
@ -70,6 +70,9 @@ namespace NewHorizons.Builder.Body
|
||||
var cubeSphereMC = cubeSphere.AddComponent<MeshCollider>();
|
||||
cubeSphereMC.sharedMesh = mesh;
|
||||
|
||||
var cubeSphereSC = cubeSphere.AddComponent<SphereCollider>();
|
||||
cubeSphereSC.radius = Mathf.Min(module.minHeight, module.maxHeight);
|
||||
|
||||
var superGroup = planetGO.GetComponent<ProxyShadowCasterSuperGroup>();
|
||||
if (superGroup != null) cubeSphere.AddComponent<ProxyShadowCaster>()._superGroup = superGroup;
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ namespace NewHorizons.Builder.Body
|
||||
var surfaceAudio = sunSurfaceAudio.gameObject.AddComponent<StarSurfaceAudioController>();
|
||||
GameObject.Destroy(sunSurfaceAudio);
|
||||
surfaceAudio.SetSector(sector);
|
||||
surfaceAudio.SetSurfaceRadius(starModule.size);
|
||||
|
||||
sunAudio.name = "Audio_Star";
|
||||
|
||||
@ -141,6 +140,7 @@ namespace NewHorizons.Builder.Body
|
||||
controller.StartColour = starModule.tint;
|
||||
controller.EndColour = starModule.endTint;
|
||||
controller.WillExplode = starModule.goSupernova;
|
||||
surfaceAudio.SetStarEvolutionController(controller);
|
||||
starGO.SetActive(true);
|
||||
|
||||
// It fucking insists on this existing and its really annoying
|
||||
|
||||
@ -196,7 +196,14 @@ namespace NewHorizons.Builder.Props
|
||||
{
|
||||
foreach (var singularity in config.Props.singularities)
|
||||
{
|
||||
SingularityBuilder.Make(go, sector, go.GetComponent<OWRigidbody>(), config, singularity);
|
||||
try
|
||||
{
|
||||
SingularityBuilder.Make(go, sector, go.GetComponent<OWRigidbody>(), config, singularity);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Couldn't make singularity \"{(string.IsNullOrEmpty(singularity.uniqueID) ? config.name : singularity.uniqueID)}\" for [{go.name}] : {ex.Message}, {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (config.Props.audioVolumes != null)
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
@ -6,7 +7,7 @@ namespace NewHorizons.Components
|
||||
public class StarSurfaceAudioController : SectoredMonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private float _surfaceRadius;
|
||||
private StarEvolutionController _starEvolutionController;
|
||||
private OWAudioSource _audioSource;
|
||||
private float _fade;
|
||||
|
||||
@ -32,12 +33,11 @@ namespace NewHorizons.Components
|
||||
public void Update()
|
||||
{
|
||||
_fade = Mathf.MoveTowards(_fade, 1, Time.deltaTime * 0.2f);
|
||||
float value = Mathf.Max(0.0f, Vector3.Distance(Locator.GetPlayerCamera().transform.position, this.transform.position) - _surfaceRadius);
|
||||
float value = Mathf.Max(0.0f, Vector3.Distance(Locator.GetPlayerCamera().transform.position, this.transform.position) - _starEvolutionController.CurrentScale);
|
||||
float num = Mathf.InverseLerp(1600f, 100f, value);
|
||||
_audioSource.SetLocalVolume(num * num * _fade);
|
||||
}
|
||||
|
||||
public float GetSurfaceRadius() => _surfaceRadius;
|
||||
public float SetSurfaceRadius(float radius) => _surfaceRadius = radius;
|
||||
public void SetStarEvolutionController(StarEvolutionController controller) => _starEvolutionController = controller;
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ namespace NewHorizons.External.Modules
|
||||
/// <summary>
|
||||
/// Amount of asteroids to create.
|
||||
/// </summary>
|
||||
[Range(0, 200)] [DefaultValue(-1)] public int amount = -1;
|
||||
[Range(-1, 200)] [DefaultValue(-1)] public int amount = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Angle between the rings and the equatorial plane of the planet.
|
||||
|
||||
@ -243,6 +243,9 @@ namespace NewHorizons.Handlers
|
||||
|
||||
var ao = planetObject.GetComponent<NHAstroObject>();
|
||||
|
||||
var solarSystemRoot = SearchUtilities.Find("SolarSystemRoot").transform;
|
||||
planetObject.GetComponent<OWRigidbody>()._origParent = ao.IsDimension ? solarSystemRoot.Find("Dimensions") : solarSystemRoot;
|
||||
|
||||
if (!ao.IsDimension) _dict.Add(ao, body);
|
||||
else _dimensions.Add(ao, body);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ using NewHorizons.Utility;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
namespace NewHorizons.Handlers
|
||||
@ -30,12 +31,26 @@ namespace NewHorizons.Handlers
|
||||
"White Hole"
|
||||
};
|
||||
|
||||
private static readonly string[] _suspendBlacklist = new string[]
|
||||
{
|
||||
"Player_Body",
|
||||
"Ship_Body"
|
||||
};
|
||||
|
||||
public static void RemoveSolarSystem()
|
||||
{
|
||||
// Stop the sun from killing the player
|
||||
var sunVolumes = SearchUtilities.Find("Sun_Body/Sector_SUN/Volumes_SUN");
|
||||
sunVolumes.SetActive(false);
|
||||
|
||||
foreach (var ow in GameObject.FindObjectsOfType<OWRigidbody>())
|
||||
{
|
||||
if (ow._origParent != null && (ow._origParentBody != null || ow._simulateInSector != null) && ow.transform.GetComponent<AstroObject>() == null && !ow._suspended && !_suspendBlacklist.Contains(ow.gameObject.name))
|
||||
{
|
||||
ow.Suspend();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var name in _solarSystemBodies)
|
||||
{
|
||||
var ao = AstroObjectLocator.GetAstroObject(name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user