mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
32 lines
829 B
C#
32 lines
829 B
C#
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
|
using UnityEngine;
|
|
|
|
namespace NewHorizons.Components.Volumes
|
|
{
|
|
public class BlackHoleDestructionVolume : DestructionVolume
|
|
{
|
|
protected OWAudioSource _audio;
|
|
|
|
public override void Awake()
|
|
{
|
|
base.Awake();
|
|
_deathType = DeathType.BlackHole;
|
|
_audio = GetComponent<OWAudioSource>();
|
|
}
|
|
|
|
public override void VanishProbe(OWRigidbody probeBody, RelativeLocationData entryLocation)
|
|
{
|
|
var probe = probeBody.GetRequiredComponent<SurveyorProbe>();
|
|
|
|
_audio.PlayOneShot(AudioType.BH_BlackHoleEmission, 1f);
|
|
|
|
if (probe.IsLaunched())
|
|
{
|
|
Destroy(probe.gameObject);
|
|
ProbeLostAchievement.Earn();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|