Add buoyancy and density properties

This commit is contained in:
Noah Pilarski 2023-01-14 23:21:29 -05:00
parent addc0041ab
commit 250d51abf4
2 changed files with 14 additions and 1 deletions

View File

@ -114,6 +114,8 @@ namespace NewHorizons.Builder.Body
fluidVolume._attachedBody = rb;
fluidVolume._triggerVolume = buoyancyTriggerVolume;
fluidVolume._radius = waterSize;
fluidVolume._buoyancyDensity = module.buoyancy;
fluidVolume._density = module.density;
fluidVolume._layer = LayerMask.NameToLayer("BasicEffectVolume");
var fogGO = GameObject.Instantiate(_oceanFog, waterGO.transform);

View File

@ -1,5 +1,6 @@
using NewHorizons.Utility;
using NewHorizons.Utility;
using Newtonsoft.Json;
using System.ComponentModel;
namespace NewHorizons.External.Modules.VariableSize
{
@ -11,6 +12,16 @@ namespace NewHorizons.External.Modules.VariableSize
/// </summary>
public float size;
/// <summary>
/// Density of the water sphere. The higher the density, the harder it is to go through this fluid.
/// </summary>
[DefaultValue(1.2f)] public float density = 1.2f;
/// <summary>
/// Buoyancy density of the water sphere
/// </summary>
[DefaultValue(1f)] public float buoyancy = 1f;
/// <summary>
/// Tint of the water
/// </summary>