mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
rename to Particle Fields
This commit is contained in:
parent
7320e51306
commit
ca7e0f25e7
@ -79,23 +79,23 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
var maxHeight = config.Atmosphere.size;
|
var maxHeight = config.Atmosphere.size;
|
||||||
if (config.Atmosphere.clouds?.outerCloudRadius != null) maxHeight = config.Atmosphere.clouds.outerCloudRadius;
|
if (config.Atmosphere.clouds?.outerCloudRadius != null) maxHeight = config.Atmosphere.clouds.outerCloudRadius;
|
||||||
|
|
||||||
foreach (var vectionField in config.VectionFields)
|
foreach (var particleField in config.ParticleFields)
|
||||||
{
|
{
|
||||||
var prefab = GetPrefabByType(vectionField.type);
|
var prefab = GetPrefabByType(particleField.type);
|
||||||
var emitter = Object.Instantiate(prefab, effectsGO.transform);
|
var emitter = Object.Instantiate(prefab, effectsGO.transform);
|
||||||
emitter.name = !string.IsNullOrWhiteSpace(vectionField.rename) ? vectionField.rename : prefab.name.Replace("Prefab_", "");
|
emitter.name = !string.IsNullOrWhiteSpace(particleField.rename) ? particleField.rename : prefab.name.Replace("Prefab_", "");
|
||||||
emitter.transform.position = planetGO.transform.position;
|
emitter.transform.position = planetGO.transform.position;
|
||||||
|
|
||||||
var vfe = emitter.GetComponent<VectionFieldEmitter>();
|
var vfe = emitter.GetComponent<VectionFieldEmitter>();
|
||||||
var pvc = emitter.GetComponent<PlanetaryVectionController>();
|
var pvc = emitter.GetComponent<PlanetaryVectionController>();
|
||||||
pvc._vectionFieldEmitter = vfe;
|
pvc._vectionFieldEmitter = vfe;
|
||||||
pvc._densityByHeight = vectionField.densityByHeightCurve != null ? vectionField.densityByHeightCurve.ToAnimationCurve() : new AnimationCurve(new Keyframe[]
|
pvc._densityByHeight = particleField.densityByHeightCurve != null ? particleField.densityByHeightCurve.ToAnimationCurve() : new AnimationCurve(new Keyframe[]
|
||||||
{
|
{
|
||||||
new Keyframe(minHeight - 0.5f, 0),
|
new Keyframe(minHeight - 0.5f, 0),
|
||||||
new Keyframe(minHeight, 10f),
|
new Keyframe(minHeight, 10f),
|
||||||
new Keyframe(maxHeight, 0f)
|
new Keyframe(maxHeight, 0f)
|
||||||
});
|
});
|
||||||
pvc._followTarget = vectionField.followTarget == VectionFieldModule.FollowTarget.Probe ? PlanetaryVectionController.FollowTarget.Probe : PlanetaryVectionController.FollowTarget.Player;
|
pvc._followTarget = particleField.followTarget == ParticleFieldModule.FollowTarget.Probe ? PlanetaryVectionController.FollowTarget.Probe : PlanetaryVectionController.FollowTarget.Player;
|
||||||
pvc._activeInSector = sector;
|
pvc._activeInSector = sector;
|
||||||
pvc._exclusionSectors = new Sector[] { };
|
pvc._exclusionSectors = new Sector[] { };
|
||||||
|
|
||||||
@ -106,27 +106,27 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
effectsGO.SetActive(true);
|
effectsGO.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameObject GetPrefabByType(VectionFieldModule.VectionFieldType type)
|
public static GameObject GetPrefabByType(ParticleFieldModule.ParticleFieldType type)
|
||||||
{
|
{
|
||||||
return type switch
|
return type switch
|
||||||
{
|
{
|
||||||
VectionFieldModule.VectionFieldType.Rain => _rainEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Rain => _rainEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.SnowflakesHeavy => _snowEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.SnowflakesHeavy => _snowEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.SnowflakesLight => _snowLightEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.SnowflakesLight => _snowLightEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Embers => _emberEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Embers => _emberEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Clouds => _cloudEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Clouds => _cloudEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Leaves => _leafEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Leaves => _leafEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Bubbles => _bubbleEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Bubbles => _bubbleEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Fog => _fogEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Fog => _fogEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.CrystalMotes => _crystalMoteEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.CrystalMotes => _crystalMoteEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.RockMotes => _rockMoteEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.RockMotes => _rockMoteEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.IceMotes => _iceMoteEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.IceMotes => _iceMoteEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.SandMotes => _sandMoteEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.SandMotes => _sandMoteEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Crawlies => _crawliesEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Crawlies => _crawliesEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Fireflies => _firefliesEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Fireflies => _firefliesEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Plankton => _planktonEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Plankton => _planktonEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Pollen => _pollenEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Pollen => _pollenEmitterPrefab,
|
||||||
VectionFieldModule.VectionFieldType.Current => _currentEmitterPrefab,
|
ParticleFieldModule.ParticleFieldType.Current => _currentEmitterPrefab,
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
17
NewHorizons/External/Configs/PlanetConfig.cs
vendored
17
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -169,9 +169,10 @@ namespace NewHorizons.External.Configs
|
|||||||
public WaterModule Water;
|
public WaterModule Water;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add particle effects to the planet
|
/// Add particle effects in a field around the planet.
|
||||||
|
/// Also known as Vection Fields.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public VectionFieldModule[] VectionFields;
|
public ParticleFieldModule[] ParticleFields;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add various volumes on this body
|
/// Add various volumes on this body
|
||||||
@ -350,22 +351,22 @@ namespace NewHorizons.External.Configs
|
|||||||
|
|
||||||
if (Atmosphere.hasRain)
|
if (Atmosphere.hasRain)
|
||||||
{
|
{
|
||||||
if (VectionFields == null) VectionFields = new VectionFieldModule[0];
|
if (ParticleFields == null) ParticleFields = new ParticleFieldModule[0];
|
||||||
VectionFields = VectionFields.Append(new VectionFieldModule
|
ParticleFields = ParticleFields.Append(new ParticleFieldModule
|
||||||
{
|
{
|
||||||
type = VectionFieldModule.VectionFieldType.Rain,
|
type = ParticleFieldModule.ParticleFieldType.Rain,
|
||||||
rename = "RainEmitter"
|
rename = "RainEmitter"
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Atmosphere.hasSnow)
|
if (Atmosphere.hasSnow)
|
||||||
{
|
{
|
||||||
if (VectionFields == null) VectionFields = new VectionFieldModule[0];
|
if (ParticleFields == null) ParticleFields = new ParticleFieldModule[0];
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
VectionFields = VectionFields.Append(new VectionFieldModule
|
ParticleFields = ParticleFields.Append(new ParticleFieldModule
|
||||||
{
|
{
|
||||||
type = VectionFieldModule.VectionFieldType.SnowflakesHeavy,
|
type = ParticleFieldModule.ParticleFieldType.SnowflakesHeavy,
|
||||||
rename = "SnowEmitter"
|
rename = "SnowEmitter"
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
|
|||||||
11
NewHorizons/External/Modules/AtmosphereModule.cs
vendored
11
NewHorizons/External/Modules/AtmosphereModule.cs
vendored
@ -57,7 +57,7 @@ namespace NewHorizons.External.Modules
|
|||||||
/// Colour of fog on the planet, if you put fog.
|
/// Colour of fog on the planet, if you put fog.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MColor fogTint;
|
public MColor fogTint;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relative filepath to the fog color ramp texture, if you put fog.
|
/// Relative filepath to the fog color ramp texture, if you put fog.
|
||||||
/// x axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top).
|
/// x axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top).
|
||||||
@ -76,7 +76,7 @@ namespace NewHorizons.External.Modules
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Does this planet have rain?
|
/// Does this planet have rain?
|
||||||
/// This is equivalent to effects of setting a rain vection field, rain audio volume, and visor effect volume, combined for convenience.
|
/// This is equivalent to effects of setting a rain particle/vection field, rain audio volume, and visor effect volume, combined for convenience.
|
||||||
/// For more control over the rain, use those individual components.
|
/// For more control over the rain, use those individual components.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool hasRain;
|
public bool hasRain;
|
||||||
@ -170,7 +170,7 @@ namespace NewHorizons.External.Modules
|
|||||||
/// How fast the clouds will rotate relative to the planet in degrees per second.
|
/// How fast the clouds will rotate relative to the planet in degrees per second.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(0f)] public float rotationSpeed = 0f;
|
[DefaultValue(0f)] public float rotationSpeed = 0f;
|
||||||
|
|
||||||
#region Obsolete
|
#region Obsolete
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -185,7 +185,7 @@ namespace NewHorizons.External.Modules
|
|||||||
|
|
||||||
|
|
||||||
#region Obsolete
|
#region Obsolete
|
||||||
[Obsolete("HasSnow is deprecated, please use VectionFields instead")]
|
[Obsolete("HasSnow is deprecated, please use ParticleFields instead")]
|
||||||
public bool hasSnow;
|
public bool hasSnow;
|
||||||
|
|
||||||
[Obsolete("CloudTint is deprecated, please use CloudInfo instead")]
|
[Obsolete("CloudTint is deprecated, please use CloudInfo instead")]
|
||||||
@ -206,7 +206,8 @@ namespace NewHorizons.External.Modules
|
|||||||
[Obsolete("UseBasicCloudShader is deprecated, please use CloudInfo instead")]
|
[Obsolete("UseBasicCloudShader is deprecated, please use CloudInfo instead")]
|
||||||
public bool useBasicCloudShader;
|
public bool useBasicCloudShader;
|
||||||
|
|
||||||
[DefaultValue(true)] [Obsolete("ShadowsOnClouds is deprecated, please use CloudInfo instead")]
|
[DefaultValue(true)]
|
||||||
|
[Obsolete("ShadowsOnClouds is deprecated, please use CloudInfo instead")]
|
||||||
public bool shadowsOnClouds = true;
|
public bool shadowsOnClouds = true;
|
||||||
|
|
||||||
[Obsolete("HasAtmosphere is deprecated, please use UseAtmosphereShader instead")]
|
[Obsolete("HasAtmosphere is deprecated, please use UseAtmosphereShader instead")]
|
||||||
|
|||||||
@ -10,15 +10,15 @@ using System.Runtime.Serialization;
|
|||||||
namespace NewHorizons.External.Modules
|
namespace NewHorizons.External.Modules
|
||||||
{
|
{
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class VectionFieldModule
|
public class ParticleFieldModule
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Particle type for this vection field.
|
/// Particle type for this vection field.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public VectionFieldType type;
|
public ParticleFieldType type;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// What the vection field activates based on.
|
/// What the particle field activates based on.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue("player")] public FollowTarget followTarget = FollowTarget.Player;
|
[DefaultValue("player")] public FollowTarget followTarget = FollowTarget.Player;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public enum VectionFieldType
|
public enum ParticleFieldType
|
||||||
{
|
{
|
||||||
[EnumMember(Value = @"rain")] Rain,
|
[EnumMember(Value = @"rain")] Rain,
|
||||||
[EnumMember(Value = @"snowflakesHeavy")] SnowflakesHeavy,
|
[EnumMember(Value = @"snowflakesHeavy")] SnowflakesHeavy,
|
||||||
|
|||||||
@ -658,7 +658,7 @@ namespace NewHorizons.Handlers
|
|||||||
atmosphere = AtmosphereBuilder.Make(go, sector, body.Config.Atmosphere, surfaceSize).GetComponentInChildren<LODGroup>();
|
atmosphere = AtmosphereBuilder.Make(go, sector, body.Config.Atmosphere, surfaceSize).GetComponentInChildren<LODGroup>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.VectionFields != null)
|
if (body.Config.ParticleFields != null)
|
||||||
{
|
{
|
||||||
EffectsBuilder.Make(go, sector, body.Config);
|
EffectsBuilder.Make(go, sector, body.Config);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,11 +132,11 @@
|
|||||||
"description": "Add water to this planet",
|
"description": "Add water to this planet",
|
||||||
"$ref": "#/definitions/WaterModule"
|
"$ref": "#/definitions/WaterModule"
|
||||||
},
|
},
|
||||||
"VectionFields": {
|
"ParticleFields": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"description": "Add particle effects to the planet",
|
"description": "Add particle effects to the planet",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/VectionFieldModule"
|
"$ref": "#/definitions/ParticleFieldModule"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Volumes": {
|
"Volumes": {
|
||||||
@ -378,7 +378,7 @@
|
|||||||
},
|
},
|
||||||
"hasRain": {
|
"hasRain": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Does this planet have rain? \nThis is equivalent to effects of setting a rain vection field, rain audio volume, and visor effect volume, combined for convenience.\nFor more control over the rain, use those individual components."
|
"description": "Does this planet have rain? \nThis is equivalent to effects of setting a rain particle/vection field, rain audio volume, and visor effect volume, combined for convenience.\nFor more control over the rain, use those individual components."
|
||||||
},
|
},
|
||||||
"size": {
|
"size": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
@ -3421,16 +3421,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"VectionFieldModule": {
|
"ParticleFieldModule": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"description": "Particle type for this vection field.",
|
"description": "Particle type for this vection field.",
|
||||||
"$ref": "#/definitions/VectionFieldType"
|
"$ref": "#/definitions/ParticleFieldType"
|
||||||
},
|
},
|
||||||
"followTarget": {
|
"followTarget": {
|
||||||
"description": "What the vection field activates based on.",
|
"description": "What the particle field activates based on.",
|
||||||
"default": "player",
|
"default": "player",
|
||||||
"$ref": "#/definitions/FollowTarget"
|
"$ref": "#/definitions/FollowTarget"
|
||||||
},
|
},
|
||||||
@ -3447,7 +3447,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"VectionFieldType": {
|
"ParticleFieldType": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "",
|
"description": "",
|
||||||
"x-enumNames": [
|
"x-enumNames": [
|
||||||
|
|||||||
@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using static NewHorizons.External.Modules.VectionFieldModule;
|
using static NewHorizons.External.Modules.ParticleFieldModule;
|
||||||
using NomaiCoordinates = NewHorizons.External.Configs.StarSystemConfig.NomaiCoordinates;
|
using NomaiCoordinates = NewHorizons.External.Configs.StarSystemConfig.NomaiCoordinates;
|
||||||
|
|
||||||
namespace NewHorizons.Utility
|
namespace NewHorizons.Utility
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user