mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Do black hole sound when you go in unpaired ones
This commit is contained in:
parent
f2706eaf4d
commit
b40247d0af
@ -197,7 +197,15 @@ namespace NewHorizons.Builder.Body
|
|||||||
sphereCollider.isTrigger = true;
|
sphereCollider.isTrigger = true;
|
||||||
if (sizeController != null) sizeController.sphereCollider = sphereCollider;
|
if (sizeController != null) sizeController.sphereCollider = sphereCollider;
|
||||||
|
|
||||||
if (hasDestructionVolume) destructionVolumeGO.AddComponent<BlackHoleDestructionVolume>();
|
var audio = destructionVolumeGO.AddComponent<AudioSource>();
|
||||||
|
audio.spatialBlend = 1f;
|
||||||
|
audio.maxDistance = distort * 2.5f;
|
||||||
|
destructionVolumeGO.AddComponent<OWAudioSource>();
|
||||||
|
|
||||||
|
if (hasDestructionVolume)
|
||||||
|
{
|
||||||
|
destructionVolumeGO.AddComponent<BlackHoleDestructionVolume>();
|
||||||
|
}
|
||||||
else if (targetStarSystem != null)
|
else if (targetStarSystem != null)
|
||||||
{
|
{
|
||||||
var wormholeVolume = destructionVolumeGO.AddComponent<BlackHoleWarpVolume>();
|
var wormholeVolume = destructionVolumeGO.AddComponent<BlackHoleWarpVolume>();
|
||||||
|
|||||||
@ -1,21 +1,28 @@
|
|||||||
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components.Volumes
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class BlackHoleDestructionVolume : DestructionVolume
|
public class BlackHoleDestructionVolume : DestructionVolume
|
||||||
{
|
{
|
||||||
|
protected OWAudioSource _audio;
|
||||||
|
|
||||||
public override void Awake()
|
public override void Awake()
|
||||||
{
|
{
|
||||||
base.Awake();
|
base.Awake();
|
||||||
_deathType = DeathType.BlackHole;
|
_deathType = DeathType.BlackHole;
|
||||||
|
_audio = GetComponent<OWAudioSource>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void VanishProbe(OWRigidbody probeBody, RelativeLocationData entryLocation)
|
public override void VanishProbe(OWRigidbody probeBody, RelativeLocationData entryLocation)
|
||||||
{
|
{
|
||||||
SurveyorProbe requiredComponent = probeBody.GetRequiredComponent<SurveyorProbe>();
|
var probe = probeBody.GetRequiredComponent<SurveyorProbe>();
|
||||||
if (requiredComponent.IsLaunched())
|
|
||||||
|
_audio.PlayOneShot(AudioType.BH_BlackHoleEmission, 1f);
|
||||||
|
|
||||||
|
if (probe.IsLaunched())
|
||||||
{
|
{
|
||||||
Destroy(requiredComponent.gameObject);
|
Destroy(probe.gameObject);
|
||||||
ProbeLostAchievement.Earn();
|
ProbeLostAchievement.Earn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ namespace NewHorizons.Components.Volumes
|
|||||||
|
|
||||||
public override void VanishPlayer(OWRigidbody playerBody, RelativeLocationData entryLocation)
|
public override void VanishPlayer(OWRigidbody playerBody, RelativeLocationData entryLocation)
|
||||||
{
|
{
|
||||||
|
Locator.GetPlayerAudioController().PlayOneShotInternal(AudioType.BH_BlackHoleEmission);
|
||||||
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
|
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user