Almost forgor

This commit is contained in:
Noah Pilarski 2022-09-11 02:03:14 -04:00
parent 6caa2d8991
commit 1182865753
13 changed files with 57 additions and 18 deletions

View File

@ -46,6 +46,7 @@ namespace NewHorizons.Builder.Atmosphere
atmo.name = "Atmosphere";
atmo.transform.localPosition = Vector3.zero;
atmo.transform.localEulerAngles = Vector3.zero;
atmo.SetActive(true);
Material material;

View File

@ -25,6 +25,8 @@ namespace NewHorizons.Builder.Body
if (config.Base.cometTailRotation != null) alignment = config.Base.cometTailRotation;
cometTail.transform.rotation = Quaternion.Euler(alignment);
cometTail.SetActive(true);
}
}
}

View File

@ -62,12 +62,15 @@ namespace NewHorizons.Builder.Body
var proxyGO = GameObject.Instantiate(_proxySandFunnel, scaleRoot.transform);
proxyGO.name = "Proxy_Funnel";
proxyGO.SetActive(true);
var geoGO = GameObject.Instantiate(_geoSandFunnel, scaleRoot.transform);
geoGO.name = "Geo_Funnel";
geoGO.SetActive(true);
var volumesGO = GameObject.Instantiate(_volumesSandFunnel, scaleRoot.transform);
volumesGO.name = "Volumes_Funnel";
volumesGO.SetActive(true);
var sfv = volumesGO.GetComponentInChildren<SimpleFluidVolume>();
var fluidVolume = sfv.gameObject;
switch (funnelType)

View File

@ -47,12 +47,14 @@ namespace NewHorizons.Builder.Body
lavaSphere.transform.name = "LavaSphere";
lavaSphere.GetComponent<MeshRenderer>().material.SetFloat(HeightScale, heightScale);
if (module.tint != null) lavaSphere.GetComponent<MeshRenderer>().material.SetColor(EmissionColor, module.tint.ToColor());
lavaSphere.SetActive(true);
var sectorCullGroup = lavaSphere.GetComponent<SectorCullGroup>();
sectorCullGroup.SetSector(sector);
var moltenCoreProxy = GameObject.Instantiate(_moltenCoreProxy, moltenCore.transform); ;
moltenCoreProxy.name = "MoltenCore_Proxy";
moltenCoreProxy.SetActive(true);
var proxyLavaSphere = moltenCoreProxy.transform.Find("LavaSphere (1)");
proxyLavaSphere.transform.localScale = Vector3.one;

View File

@ -28,6 +28,7 @@ namespace NewHorizons.Builder.Body
var sandSphere = GameObject.Instantiate(_sandSphere, sandGO.transform);
sandSphere.name = "Sphere";
sandSphere.SetActive(true);
if (module.tint != null)
{
var oldMR = sandSphere.GetComponent<TessellatedSphereRenderer>();
@ -50,11 +51,13 @@ namespace NewHorizons.Builder.Body
var occlusionSphere = GameObject.Instantiate(_sandOcclusion, sandGO.transform);
occlusionSphere.name = "Occlusion";
occlusionSphere.SetActive(true);
var proxyShadowCasterGO = GameObject.Instantiate(_sandProxyShadowCaster, sandGO.transform);
proxyShadowCasterGO.name = "ProxyShadowCaster";
var proxyShadowCaster = proxyShadowCasterGO.GetComponent<ProxyShadowCaster>();
proxyShadowCaster.SetSuperGroup(sandGO.GetComponent<ProxyShadowCasterSuperGroup>());
proxyShadowCasterGO.SetActive(true);
sandSphere.AddComponent<ChildColliderSettings>();

View File

@ -159,6 +159,7 @@ namespace NewHorizons.Builder.Body
{
var blackHoleAmbience = GameObject.Instantiate(_blackHoleAmbience, blackHole.transform);
blackHoleAmbience.name = "BlackHoleAmbience";
blackHoleAmbience.SetActive(true);
blackHoleAmbience.GetComponent<SectorAudioGroup>().SetSector(sector);
var blackHoleAudioSource = blackHoleAmbience.GetComponent<AudioSource>();
@ -169,6 +170,7 @@ namespace NewHorizons.Builder.Body
var blackHoleOneShot = GameObject.Instantiate(_blackHoleEmissionOneShot, blackHole.transform);
blackHoleOneShot.name = "BlackHoleEmissionOneShot";
blackHoleOneShot.SetActive(true);
var oneShotAudioSource = blackHoleOneShot.GetComponent<AudioSource>();
oneShotAudioSource.maxDistance = size * 3f;
oneShotAudioSource.minDistance = size * 0.4f;
@ -199,6 +201,7 @@ namespace NewHorizons.Builder.Body
{
var blackHoleVolume = GameObject.Instantiate(_blackHoleVolume, blackHole.transform);
blackHoleVolume.name = "BlackHoleVolume";
blackHoleVolume.SetActive(true);
var blackHoleSphereCollider = blackHoleVolume.GetComponent<SphereCollider>();
blackHoleSphereCollider.radius = size * 0.4f;
if (sizeController != null) sizeController.sphereCollider = blackHoleSphereCollider;
@ -270,6 +273,7 @@ namespace NewHorizons.Builder.Body
ambientLight.transform.localScale = Vector3.one;
ambientLight.transform.localPosition = Vector3.zero;
ambientLight.name = "AmbientLight";
ambientLight.SetActive(true);
var light = ambientLight.GetComponent<Light>();
light.range = size * 7f;
if (sizeController != null) sizeController.light = light;
@ -280,6 +284,7 @@ namespace NewHorizons.Builder.Body
whiteHoleVolumeGO.transform.localScale = Vector3.one;
whiteHoleVolumeGO.GetComponent<SphereCollider>().radius = size;
whiteHoleVolumeGO.name = "WhiteHoleVolume";
whiteHoleVolumeGO.SetActive(true);
if (sizeController != null) sizeController.sphereCollider = whiteHoleVolumeGO.GetComponent<SphereCollider>();
var whiteHoleFluidVolume = whiteHoleVolumeGO.GetComponent<WhiteHoleFluidVolume>();
@ -306,6 +311,7 @@ namespace NewHorizons.Builder.Body
var zeroGVolume = GameObject.Instantiate(_whiteHoleZeroGVolume, whiteHole.transform);
zeroGVolume.name = "ZeroGVolume";
zeroGVolume.transform.localPosition = Vector3.zero;
zeroGVolume.SetActive(true);
zeroGVolume.GetComponent<SphereCollider>().radius = size * 10f;
zeroGVolume.GetComponent<ZeroGVolume>()._attachedBody = OWRB;
@ -313,6 +319,7 @@ namespace NewHorizons.Builder.Body
rulesetVolume.name = "RulesetVolume";
rulesetVolume.transform.localPosition = Vector3.zero;
rulesetVolume.transform.localScale = Vector3.one * size / 100f;
rulesetVolume.SetActive(true);
rulesetVolume.GetComponent<SphereShape>().enabled = true;
if (sizeController != null)

View File

@ -66,6 +66,7 @@ namespace NewHorizons.Builder.Body
surfaceAudio.SetSector(sector);
sunAudio.name = "Audio_Star";
sunAudio.SetActive(true);
GameObject sunAtmosphere = null;
if (starModule.hasAtmosphere)
@ -74,6 +75,7 @@ namespace NewHorizons.Builder.Body
sunAtmosphere.transform.position = planetGO.transform.position;
sunAtmosphere.transform.localScale = Vector3.one * OuterRadiusRatio;
sunAtmosphere.name = "Atmosphere_Star";
sunAtmosphere.SetActive(true);
var atmospheres = sunAtmosphere.transform.Find("AtmoSphere");
atmospheres.transform.localScale = Vector3.one;
@ -102,6 +104,7 @@ namespace NewHorizons.Builder.Body
var ambientLightGO = Object.Instantiate(_starAmbientLight, starGO.transform);
ambientLightGO.transform.localPosition = Vector3.zero;
ambientLightGO.name = "AmbientLight_Star";
ambientLightGO.SetActive(true);
Light ambientLight = ambientLightGO.GetComponent<Light>();
ambientLight.range = starModule.size * OuterRadiusRatio;
@ -227,6 +230,7 @@ namespace NewHorizons.Builder.Body
sunAtmosphere.transform.position = proxyGO.transform.position;
sunAtmosphere.transform.localScale = Vector3.one * OuterRadiusRatio;
sunAtmosphere.name = "Atmosphere_Star";
sunAtmosphere.SetActive(true);
atmosphere = sunAtmosphere.transform.Find("Atmosphere_LOD2").GetComponent<MeshRenderer>();
atmosphere.transform.localScale = Vector3.one;
@ -321,11 +325,13 @@ namespace NewHorizons.Builder.Body
sunSurface.transform.position = rootObject.transform.position;
sunSurface.transform.localScale = Vector3.one;
sunSurface.name = "Surface";
sunSurface.SetActive(true);
var solarFlareEmitter = Object.Instantiate(_starSolarFlareEmitter, starGO.transform);
solarFlareEmitter.transform.localPosition = Vector3.zero;
solarFlareEmitter.transform.localScale = Vector3.one;
solarFlareEmitter.name = "SolarFlareEmitter";
solarFlareEmitter.SetActive(true);
if (starModule.tint != null)
{

View File

@ -113,6 +113,7 @@ namespace NewHorizons.Builder.Body
fogGO.name = "OceanFog";
fogGO.transform.localPosition = Vector3.zero;
fogGO.transform.localScale = Vector3.one;
fogGO.SetActive(true);
if (module.tint != null)
{

View File

@ -314,6 +314,8 @@ namespace NewHorizons.Builder.Props
// Idk why but it wants reveals to be comma delimited not a list
if (info.reveals != null) slideCollectionContainer._shipLogOnComplete = string.Join(",", info.reveals);
g.SetActive(true);
return g;
}
@ -410,6 +412,8 @@ namespace NewHorizons.Builder.Props
// Idk why but it wants reveals to be comma delimited not a list
if (info.reveals != null) slideCollectionContainer._shipLogOnComplete = string.Join(",", info.reveals);
standingTorch.SetActive(true);
return standingTorch;
}

View File

@ -25,11 +25,11 @@ namespace NewHorizons.Builder.Props
}
}
public static void Make(GameObject planetGO, Sector sector, PropModule.RaftInfo info, OWRigidbody planetBody)
public static GameObject Make(GameObject planetGO, Sector sector, PropModule.RaftInfo info, OWRigidbody planetBody)
{
InitPrefab();
if (_prefab == null) return;
if (_prefab == null) return null;
GameObject raftObject = _prefab.InstantiateInactive();
raftObject.name = "Raft_Body";
@ -63,6 +63,8 @@ namespace NewHorizons.Builder.Props
}
raftObject.SetActive(true);
return raftObject;
}
}
}

View File

@ -41,26 +41,26 @@ namespace NewHorizons.Components
// The star part cant be disabled like the rest and we have to manually disable the renderers
// Else it can stop the supernova effect mid way through
StarEvolutionControllers = GetComponentsInChildren<StarEvolutionController>();
StarEvolutionControllers = GetComponentsInChildren<StarEvolutionController>(true);
_stars = StarEvolutionControllers.Select(x => x.gameObject).ToArray();
foreach (var star in _stars)
{
_starRenderers = _starRenderers.Concat(star.GetComponentsInChildren<Renderer>());
_starTessellatedRenderers = _starTessellatedRenderers.Concat(star.GetComponentsInChildren<TessellatedRenderer>());
_starParticleRenderers = _starParticleRenderers.Concat(star.GetComponentsInChildren<ParticleSystemRenderer>());
_solarFlareEmitter = _solarFlareEmitter.Append(star.GetComponentInChildren<SolarFlareEmitter>());
_starRenderers = _starRenderers.Concat(star.GetComponentsInChildren<Renderer>(true));
_starTessellatedRenderers = _starTessellatedRenderers.Concat(star.GetComponentsInChildren<TessellatedRenderer>(true));
_starParticleRenderers = _starParticleRenderers.Concat(star.GetComponentsInChildren<ParticleSystemRenderer>(true));
_solarFlareEmitter = _solarFlareEmitter.Append(star.GetComponentInChildren<SolarFlareEmitter>(true));
}
var progenitorEvolutionController = root.GetComponentInChildren<StarEvolutionController>();
var progenitorEvolutionController = root.GetComponentInChildren<StarEvolutionController>(true);
if (progenitorEvolutionController != null && stellarRemnantGO != null)
{
progenitorEvolutionController.SetStellarRemnant(stellarRemnantGO);
}
if (lightningGenerator == null) lightningGenerator = GetComponentInChildren<CloudLightningGenerator>();
if (lightningGenerator == null) lightningGenerator = GetComponentInChildren<CloudLightningGenerator>(true);
if (supernovaPlanetEffectController == null) supernovaPlanetEffectController = GetComponentInChildren<NHSupernovaPlanetEffectController>();
if (supernovaPlanetEffectController == null) supernovaPlanetEffectController = GetComponentInChildren<NHSupernovaPlanetEffectController>(true);
// Start off
_outOfRange = false;

View File

@ -96,18 +96,18 @@ namespace NewHorizons.Components.SizeControllers
public static void Init()
{
var sun = GameObject.FindObjectOfType<SunController>();
var sun = SearchUtilities.Find("Sun_Body").GetComponent<SunController>();
if (sun == null) return;
// Need to grab all this early bc the star might only Start after the solar system was made (remnants)
_defaultCollapseStartSurfaceMaterial = new Material(sun._collapseStartSurfaceMaterial);
_defaultCollapseEndSurfaceMaterial = new Material(sun._collapseEndSurfaceMaterial);
_defaultStartSurfaceMaterial = new Material(sun._startSurfaceMaterial);
_defaultEndSurfaceMaterial = new Material(sun._endSurfaceMaterial);
if (_defaultCollapseStartSurfaceMaterial == null) _defaultCollapseStartSurfaceMaterial = new Material(sun._collapseStartSurfaceMaterial).DontDestroyOnLoad();
if (_defaultCollapseEndSurfaceMaterial == null) _defaultCollapseEndSurfaceMaterial = new Material(sun._collapseEndSurfaceMaterial).DontDestroyOnLoad();
if (_defaultStartSurfaceMaterial == null) _defaultStartSurfaceMaterial = new Material(sun._startSurfaceMaterial).DontDestroyOnLoad();
if (_defaultEndSurfaceMaterial == null) _defaultEndSurfaceMaterial = new Material(sun._endSurfaceMaterial).DontDestroyOnLoad();
_defaultNormalRamp = sun._startSurfaceMaterial.GetTexture(ColorRamp);
_defaultCollapseRamp = sun._collapseStartSurfaceMaterial.GetTexture(ColorRamp);
if (_defaultNormalRamp == null) _defaultNormalRamp = sun._startSurfaceMaterial.GetTexture(ColorRamp).DontDestroyOnLoad();
if (_defaultCollapseRamp == null) _defaultCollapseRamp = sun._collapseStartSurfaceMaterial.GetTexture(ColorRamp).DontDestroyOnLoad();
}
private void Start()

View File

@ -277,6 +277,7 @@ namespace NewHorizons
SandBuilder.InitPrefabs();
SingularityBuilder.InitPrefabs();
StarBuilder.InitPrefabs();
StarEvolutionController.Init();
SupernovaEffectBuilder.InitPrefabs();
TornadoBuilder.InitPrefabs();
VolcanoBuilder.InitPrefab();
@ -444,6 +445,14 @@ namespace NewHorizons
solarSystemRoot.AddComponent<EyeSunLightParamUpdater>();
var distantSun = eyeSector.gameObject.FindChild("DistantSun/Directional light");
var starController = distantSun.AddComponent<StarController>();
starController.Light = distantSun.GetComponent<Light>();
starController.Intensity = 0.2f;
starController.SunColor = new Color(0.3569f, 0.7843f, 1, 1);
distantSun.AddComponent<StarLightController>().Awake();
StarLightController.AddStar(starController);
if (IsWarpingFromShip && _ship != null)
{
var eyeShip = GameObject.Instantiate(_ship);
@ -470,7 +479,6 @@ namespace NewHorizons
RemoteHandler.Init();
AtmosphereBuilder.Init();
BrambleNodeBuilder.Init(BodyDict[CurrentStarSystem].Select(x => x.Config).Where(x => x.Bramble?.dimension != null).ToArray());
StarEvolutionController.Init();
if (isSolarSystem)
{