mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Stop rings stealing you from moons
This commit is contained in:
parent
61ad85c685
commit
729b0297dc
@ -1,4 +1,4 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
@ -45,7 +45,7 @@ namespace NewHorizons.Builder.Body
|
||||
var trigger = ringVolume.AddComponent<OWTriggerVolume>();
|
||||
trigger._shape = ringShape;
|
||||
|
||||
var sfv = ringVolume.AddComponent<SimpleFluidVolume>();
|
||||
var sfv = ringVolume.AddComponent<RingFluidVolume>();
|
||||
var fluidType = FluidVolume.Type.NONE;
|
||||
|
||||
try
|
||||
|
||||
21
NewHorizons/Components/RingFluidVolume.cs
Normal file
21
NewHorizons/Components/RingFluidVolume.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class RingFluidVolume : SimpleFluidVolume
|
||||
{
|
||||
public override void OnEffectVolumeEnter(GameObject hitObj)
|
||||
{
|
||||
FluidDetector fluidDetector = hitObj.GetComponent<FluidDetector>();
|
||||
if (fluidDetector == null) return;
|
||||
|
||||
ForceDetector forceDetector = hitObj.GetComponent<ForceDetector>();
|
||||
if (forceDetector != null && forceDetector._activeVolumes != null && forceDetector._activeVolumes.Count > 0 && forceDetector._activeVolumes.Where(activeVolume => activeVolume is ForceVolume).Select(activeVolume => activeVolume as ForceVolume).Any(activeVolume => activeVolume.GetAffectsAlignment(forceDetector._attachedBody))) return;
|
||||
|
||||
fluidDetector.AddVolume(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user