Cozy Wather + buld systeme
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Ambience Profile", order = 361)]
|
||||
public class AmbienceProfile : CozyProfile
|
||||
{
|
||||
|
||||
[Tooltip("Specifies the minimum length for this ambience profile.")]
|
||||
[MeridiemTimeAttribute]
|
||||
public float minTime = new MeridiemTime(0, 30);
|
||||
[Tooltip("Specifies the maximum length for this ambience profile.")]
|
||||
[MeridiemTimeAttribute]
|
||||
public float maxTime = new MeridiemTime(2, 30);
|
||||
[Tooltip("Multiplier for the computational chance that this ambience profile will play; 0 being never, and 2 being twice as likely as the average.")]
|
||||
[Range(0, 2)]
|
||||
public float likelihood = 1;
|
||||
public WeightedRandomChance chance;
|
||||
[HideTitle(1)]
|
||||
public WeatherProfile[] dontPlayDuring;
|
||||
[ChanceEffector]
|
||||
public List<ChanceEffector> chances;
|
||||
|
||||
|
||||
[FX]
|
||||
public FXProfile[] FX;
|
||||
|
||||
public float GetChance (CozyWeather weather)
|
||||
{
|
||||
|
||||
float i = likelihood;
|
||||
|
||||
foreach (ChanceEffector j in chances)
|
||||
{
|
||||
i *= j.GetChance(weather);
|
||||
}
|
||||
|
||||
return i > 0 ? i : 0;
|
||||
|
||||
}
|
||||
public void SetWeight(float weightVal)
|
||||
{
|
||||
foreach (FXProfile fx in FX)
|
||||
fx?.PlayEffect(weightVal);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3dccf7172616748499437c285a6d18fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 718a6dd5871d1014c96a89569253c5d2, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/AmbienceProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,410 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Atmosphere Profile", order = 361)]
|
||||
public class AtmosphereProfile : CozyProfile
|
||||
{
|
||||
|
||||
|
||||
[Tooltip("Sets the color of the zenith (or top) of the skybox at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty skyZenithColor;
|
||||
[Tooltip("Sets the color of the horizon (or middle) of the skybox at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty skyHorizonColor;
|
||||
|
||||
[Tooltip("Sets the main color of the clouds at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudColor;
|
||||
[Tooltip("Sets the highlight color of the clouds at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudHighlightColor;
|
||||
[Tooltip("Sets the color of the high altitude clouds at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty highAltitudeCloudColor;
|
||||
[Tooltip("Sets the color of the sun light source at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty sunlightColor;
|
||||
public LightShadows sunlightShadows = LightShadows.Soft;
|
||||
public LightShadows moonlightShadows = LightShadows.Soft;
|
||||
[Tooltip("Sets the color of the moon light source at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty moonlightColor;
|
||||
[Tooltip("Sets the color of the star particle FX and textures at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty starColor;
|
||||
[Tooltip("Sets the color of the zenith (or top) of the ambient scene lighting at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty ambientLightHorizonColor;
|
||||
[Tooltip("Sets the color of the horizon (or middle) of the ambient scene lighting at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty ambientLightZenithColor;
|
||||
[Tooltip("Multiplies the ambient light intensity.")]
|
||||
[CozyPropertyType(false, 0, 4)]
|
||||
[CozySearchable]
|
||||
public VariableProperty ambientLightMultiplier;
|
||||
[Tooltip("Sets the intensity of the galaxy effects at a certain time. Starts and ends at midnight.")]
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
public VariableProperty galaxyIntensity;
|
||||
|
||||
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the fog color from 0m away from the camera to fog start 1.")]
|
||||
public VariableProperty fogColor1;
|
||||
[CozySearchable]
|
||||
[CozyPropertyType(true)]
|
||||
[Tooltip("Sets the fog color from fog start 1 to fog start 2.")]
|
||||
public VariableProperty fogColor2;
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the fog color from fog start 2 to fog start 3.")]
|
||||
[CozyPropertyType(true)]
|
||||
public VariableProperty fogColor3;
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the fog color from fog start 3 to fog start 4.")]
|
||||
[CozyPropertyType(true)]
|
||||
public VariableProperty fogColor4;
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the fog color from fog start 4 to fog start 5.")]
|
||||
[CozyPropertyType(true)]
|
||||
public VariableProperty fogColor5;
|
||||
[CozySearchable]
|
||||
[CozyPropertyType(true)]
|
||||
[Tooltip("Sets the color of the fog flare.")]
|
||||
public VariableProperty fogFlareColor;
|
||||
[CozySearchable]
|
||||
[CozyPropertyType(true)]
|
||||
[Tooltip("Sets the color of the moon flare for the fog.")]
|
||||
public VariableProperty fogMoonFlareColor;
|
||||
[CozySearchable]
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[Tooltip("Sets the smoothness of the fog.")]
|
||||
public VariableProperty fogSmoothness;
|
||||
|
||||
[CozySearchable]
|
||||
public Vector3 fogVariationDirection;
|
||||
[CozyPropertyType(false, 0, 30)]
|
||||
[Tooltip("Sets the variation scale of the fog.")]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogVariationScale;
|
||||
[CozySearchable]
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[Tooltip("Sets the variation amount.")]
|
||||
public VariableProperty fogVariationAmount;
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the variation distance of the fog.")]
|
||||
[CozyPropertyType(false, 0, 200)]
|
||||
public VariableProperty fogVariationDistance;
|
||||
|
||||
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
public VariableProperty heightFogIntensity;
|
||||
|
||||
[CozyPropertyType(false, 100, 1000)]
|
||||
[CozySearchable]
|
||||
public VariableProperty heightFogVariationScale;
|
||||
|
||||
[CozyPropertyType(false, 0, 50)]
|
||||
[CozySearchable]
|
||||
public VariableProperty heightFogVariationAmount;
|
||||
|
||||
[CozyPropertyType(false)]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogBase;
|
||||
|
||||
[CozyPropertyType(false, 0, 500)]
|
||||
[CozySearchable]
|
||||
public VariableProperty heightFogTransition;
|
||||
|
||||
[CozyPropertyType(false, 0, 5000)]
|
||||
[CozySearchable]
|
||||
public VariableProperty heightFogDistance;
|
||||
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty heightFogColor;
|
||||
|
||||
|
||||
|
||||
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Controls the exponent used to modulate from the horizon color to the zenith color of the sky.")]
|
||||
public VariableProperty gradientExponent;
|
||||
[CozyPropertyType(false, 0, 5)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the size of the visual sun in the sky.")]
|
||||
public VariableProperty sunSize;
|
||||
[Tooltip("Sets the world space direction of the sun in degrees.")]
|
||||
[CozyPropertyType(false, 0, 360)]
|
||||
[CozySearchable]
|
||||
public VariableProperty sunDirection;
|
||||
[Tooltip("Sets the roll value of the sun's rotation. Allows the sun to be slightly off from directly overhead at noon.")]
|
||||
[CozyPropertyType(false, -90, 90)]
|
||||
[CozySearchable]
|
||||
public VariableProperty sunPitch;
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the visual sun in the sky.")]
|
||||
[CozyPropertyType(true)]
|
||||
public VariableProperty sunColor;
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the visual moon in the sky (only impacts the global shader variable for the stylized moon material).")]
|
||||
[CozyPropertyType(true)]
|
||||
public VariableProperty moonColor;
|
||||
|
||||
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the falloff of the halo around the visual sun.")]
|
||||
public VariableProperty sunFalloff;
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the halo around the visual sun.")]
|
||||
public VariableProperty sunFlareColor;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the falloff of the halo around the main moon.")]
|
||||
public VariableProperty moonFalloff;
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the halo around the main moon.")]
|
||||
public VariableProperty moonFlareColor;
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the first galaxy algorithm.")]
|
||||
public VariableProperty galaxy1Color;
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the second galaxy algorithm.")]
|
||||
public VariableProperty galaxy2Color;
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the third galaxy algorithm.")]
|
||||
public VariableProperty galaxy3Color;
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the color of the light columns around the horizon.")]
|
||||
public VariableProperty lightScatteringColor;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the position of the light columns around the horizon.")]
|
||||
public VariableProperty lightScatteringPosition;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the position of the light columns around the horizon.")]
|
||||
public VariableProperty lightScatteringHeight;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the brightness of constellation lines in the night sky.")]
|
||||
public VariableProperty constellationIntensity;
|
||||
[Tooltip("Should COZY use a rainbow?")]
|
||||
[CozySearchable]
|
||||
public bool useRainbow = true;
|
||||
public Texture rainbowTexture;
|
||||
[Tooltip("Sets the position of the rainbow in the sky.")]
|
||||
[CozyPropertyType(false, 0, 100)]
|
||||
[CozySearchable]
|
||||
public VariableProperty rainbowPosition;
|
||||
[Tooltip("Sets the width of the rainbow in the sky.")]
|
||||
[CozySearchable]
|
||||
[CozyPropertyType(false, 0, 50)]
|
||||
public VariableProperty rainbowWidth;
|
||||
|
||||
|
||||
[CozyPropertyType(false, 0, 5)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Multiplies the world space distance before entering the fog algorithm. Use this for simple density changes.")]
|
||||
public VariableProperty fogDensityMultiplier;
|
||||
|
||||
[Tooltip("Sets the distance at which the first fog color fades into the second fog color.")]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogStart1 = new VariableProperty() { floatVal = 5};
|
||||
[Tooltip("Sets the distance at which the second fog color fades into the third fog color.")]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogStart2 = new VariableProperty() { floatVal = 12};
|
||||
[Tooltip("Sets the distance at which the third fog color fades into the fourth fog color.")]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogStart3 = new VariableProperty() { floatVal = 20};
|
||||
[Tooltip("Sets the distance at which the fourth fog color fades into the fifth fog color.")]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogStart4 = new VariableProperty() { floatVal = 35};
|
||||
[CozyPropertyType(false, 0, 2)]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogHeight;
|
||||
[CozyPropertyType(false, 0, 2)]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogLightFlareIntensity;
|
||||
[CozyPropertyType(false, 0, 40)]
|
||||
[CozySearchable]
|
||||
public VariableProperty fogLightFlareFalloff;
|
||||
[CozyPropertyType(false, 0, 10)]
|
||||
[CozySearchable]
|
||||
[Tooltip("Sets the height divisor for the fog flare. High values sit the flare closer to the horizon, small values extend the flare into the sky.")]
|
||||
public VariableProperty fogLightFlareSquish;
|
||||
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudMoonColor;
|
||||
[CozyPropertyType(false, 0, 50)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudSunHighlightFalloff;
|
||||
[CozyPropertyType(false, 0, 50)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudMoonHighlightFalloff;
|
||||
[CozyPropertyType(false, 0, 10)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudWindSpeed;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
public VariableProperty clippingThreshold;
|
||||
[CozyPropertyType(false, 2, 60)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudMainScale;
|
||||
[CozyPropertyType(false, 0.2f, 10)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudDetailScale;
|
||||
[CozyPropertyType(false, 0, 30)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudDetailAmount;
|
||||
[CozyPropertyType(false, 0.1f, 3)]
|
||||
[CozySearchable]
|
||||
public VariableProperty acScale;
|
||||
[CozyPropertyType(false, 0, 3)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cirroMoveSpeed;
|
||||
[CozyPropertyType(false, 0, 3)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cirrusMoveSpeed;
|
||||
[CozyPropertyType(false, 0, 3)]
|
||||
[CozySearchable]
|
||||
public VariableProperty chemtrailsMoveSpeed;
|
||||
|
||||
//TEXTURES
|
||||
|
||||
[CozySearchable]
|
||||
public Texture cloudTexture;
|
||||
[CozySearchable]
|
||||
public Texture chemtrailsTexture;
|
||||
[CozySearchable]
|
||||
public Texture cirrusCloudTexture;
|
||||
[CozySearchable]
|
||||
public Texture cirrostratusCloudTexture;
|
||||
[CozySearchable]
|
||||
public Texture altocumulusCloudTexture;
|
||||
[CozySearchable]
|
||||
public Texture starMap;
|
||||
[CozySearchable]
|
||||
public Texture starDomeTexture;
|
||||
[CozySearchable]
|
||||
public Texture galaxyMap;
|
||||
[CozySearchable]
|
||||
public Texture galaxyDomeTexture;
|
||||
[CozySearchable]
|
||||
public Texture constellationDomeTexture;
|
||||
[CozySearchable]
|
||||
public Texture galaxyStarMap;
|
||||
[CozySearchable]
|
||||
public Texture galaxyVariationMap;
|
||||
[CozySearchable]
|
||||
public Texture lightScatteringMap;
|
||||
|
||||
//LUXURY CLOUDS
|
||||
|
||||
[CozySearchable]
|
||||
public Texture partlyCloudyLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture mostlyCloudyLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture overcastLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture lowBorderLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture highBorderLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture lowNimbusLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture midNimbusLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture highNimbusLuxuryClouds;
|
||||
[CozySearchable]
|
||||
public Texture luxuryVariation;
|
||||
|
||||
//ADDITIONAL CLOUD PROPERTIES
|
||||
|
||||
[CozyPropertyType(true)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudTextureColor;
|
||||
[CozyPropertyType(false, 0, 10)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudCohesion;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
public VariableProperty spherize;
|
||||
[CozyPropertyType(false, 0, 10)]
|
||||
[CozySearchable]
|
||||
public VariableProperty shadowDistance;
|
||||
[CozyPropertyType(false, 0, 4)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudThickness;
|
||||
[CozyPropertyType(false, 0, 3)]
|
||||
[CozySearchable]
|
||||
public VariableProperty textureAmount;
|
||||
[CozySearchable]
|
||||
public Vector3 texturePanDirection;
|
||||
|
||||
//FLARES
|
||||
|
||||
#if COZY_URP || COZY_HDRP
|
||||
[System.Serializable]
|
||||
public class SRPFlare
|
||||
{
|
||||
public LensFlareDataSRP flare;
|
||||
public float intensity = 1;
|
||||
public float scale = 1;
|
||||
public AnimationCurve screenAttenuation;
|
||||
public bool useOcclusion = true;
|
||||
public float occlusionRadius = 0.5f;
|
||||
public bool allowOffscreen = true;
|
||||
}
|
||||
public SRPFlare sunFlare;
|
||||
public SRPFlare moonFlare;
|
||||
#endif
|
||||
|
||||
//LAYERS
|
||||
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
public VariableProperty skyFogAmount;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudsFogAmount;
|
||||
[CozyPropertyType(false, 0, 1)]
|
||||
[CozySearchable]
|
||||
public VariableProperty cloudsFogLightAmount;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58971c84a8da56f46bc72a85a31d8a2d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- skyShader: {fileID: 2100000, guid: 6eb59c244ec58774ab61d691d4cf6a19, type: 2}
|
||||
- cloudShader: {fileID: 2100000, guid: bfd828e6ce201e9478ecded123a8d908, type: 2}
|
||||
- fogShader: {fileID: 2100000, guid: 8521660c56b3a0642a23d3f0ebacac58, type: 2}
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 75645812b98cbf94b9dd8d2f9401cf16, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/AtmosphereProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,90 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Climate Profile", order = 361)]
|
||||
public class ClimateProfile : CozyProfile
|
||||
{
|
||||
|
||||
|
||||
[Tooltip("The global temperature during the year. the x-axis is the current day over the days in the year and the y axis is the temperature in Fahrenheit.")]
|
||||
public AnimationCurve temperatureOverYear;
|
||||
[Tooltip("The global humidity during the year. the x-axis is the current day over the days in the year and the y axis is the humidity.")]
|
||||
public AnimationCurve humidityOverYear;
|
||||
[Tooltip("The local temperature during the day. the x-axis is the current ticks over 360 and the y axis is the temperature change in Fahrenheit from the global temperature.")]
|
||||
public AnimationCurve temperatureOverDay;
|
||||
[Tooltip("The local humidity during the day. the x-axis is the current ticks over 360 and the y axis is the humidity change from the global precipitation.")]
|
||||
public AnimationCurve humidityOverDay;
|
||||
|
||||
[Tooltip("Adds an offset to the global temperature. Useful for adding biomes or climate change by location or elevation")]
|
||||
public float temperatureFilter;
|
||||
[Tooltip("Adds an offset to the global precipitation. Useful for adding biomes or climate change by location or elevation")]
|
||||
public float humidityFilter;
|
||||
|
||||
public float GetTemperature()
|
||||
{
|
||||
|
||||
CozyWeather weather = CozyWeather.instance;
|
||||
|
||||
float i = (temperatureOverYear.Evaluate(weather.yearPercentage) * temperatureOverDay.Evaluate(weather.modifiedDayPercentage)) + temperatureFilter;
|
||||
|
||||
return i;
|
||||
}
|
||||
public float GetTemperature(CozyWeather weather)
|
||||
{
|
||||
if (weather == null)
|
||||
return GetTemperature();
|
||||
|
||||
float i = (temperatureOverYear.Evaluate(weather.yearPercentage) * temperatureOverDay.Evaluate(weather.modifiedDayPercentage)) + temperatureFilter;
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public float GetTemperature(CozyWeather weather, float time)
|
||||
{
|
||||
|
||||
if (!weather.timeModule)
|
||||
return GetTemperature(weather);
|
||||
|
||||
float i = (temperatureOverYear.Evaluate(time / weather.timeModule.DaysPerYear) * temperatureOverDay.Evaluate(time % 1)) + temperatureFilter;
|
||||
|
||||
return i;
|
||||
}
|
||||
public float GetHumidity()
|
||||
{
|
||||
CozyWeather weather = CozyWeather.instance;
|
||||
float i = (humidityOverYear.Evaluate(weather.yearPercentage) * humidityOverDay.Evaluate(weather.modifiedDayPercentage)) + humidityFilter;
|
||||
|
||||
return i;
|
||||
}
|
||||
public float GetHumidity(CozyWeather weather)
|
||||
{
|
||||
if (weather == null)
|
||||
weather = CozyWeather.instance;
|
||||
|
||||
float i = (humidityOverYear.Evaluate(weather.yearPercentage) * humidityOverDay.Evaluate(weather.modifiedDayPercentage)) + humidityFilter;
|
||||
|
||||
return i;
|
||||
}
|
||||
public float GetHumidity(CozyWeather weather, float time)
|
||||
{
|
||||
if (!weather.timeModule)
|
||||
return GetHumidity(weather);
|
||||
|
||||
float i = (humidityOverYear.Evaluate(time / weather.timeModule.DaysPerYear) * humidityOverDay.Evaluate(time % 1)) + humidityFilter;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a57fa09c0955c24f8927dc03941c8e6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: e2beee9336739484189066227b4acf6b, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/ClimateProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bff46cb63007c98458080129b5c44d75
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,133 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Audio FX", order = 361)]
|
||||
public class AudioFX : FXProfile
|
||||
{
|
||||
|
||||
public AudioClip clip;
|
||||
[Tooltip("The audio mixer group that the COZY weather audio FX will use.")]
|
||||
public AudioMixerGroup audioMixer;
|
||||
private AudioSource runtimeRef;
|
||||
public float maximumVolume = 1;
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
|
||||
if (!runtimeRef)
|
||||
if (InitializeEffect(weatherSphere) == false)
|
||||
return;
|
||||
|
||||
if (weight == 0)
|
||||
{
|
||||
runtimeRef.volume = 0;
|
||||
// runtimeRef.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!runtimeRef.isPlaying && runtimeRef.isActiveAndEnabled)
|
||||
runtimeRef.Play();
|
||||
|
||||
runtimeRef.volume = maximumVolume * transitionTimeModifier.Evaluate(weight);
|
||||
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
return false;
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (runtimeRef == null)
|
||||
{
|
||||
runtimeRef = weatherSphere.GetFXRuntimeRef<AudioSource>(name);
|
||||
if (runtimeRef)
|
||||
return true;
|
||||
|
||||
runtimeRef = new GameObject().AddComponent<AudioSource>();
|
||||
|
||||
runtimeRef.gameObject.name = name;
|
||||
runtimeRef.transform.parent = weatherSphere.audioFXParent;
|
||||
runtimeRef.transform.localPosition = Vector3.zero;
|
||||
runtimeRef.transform.localRotation = Quaternion.identity;
|
||||
runtimeRef.clip = clip;
|
||||
runtimeRef.outputAudioMixerGroup = audioMixer;
|
||||
runtimeRef.playOnAwake = false;
|
||||
runtimeRef.volume = 0;
|
||||
runtimeRef.loop = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(AudioFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_AudioFX : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("clip"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("audioMixer"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumVolume"));
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosD = new Rect(pos.x, pos.y + space * 4, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("clip"));
|
||||
EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("audioMixer"));
|
||||
EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("maximumVolume"));
|
||||
EditorGUI.PropertyField(propPosD, serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 4;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 775038a52e8def44495fe8e572edf7f8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- clip: {instanceID: 0}
|
||||
- weatherFXMixer: {fileID: 6122681528400141310, guid: 7657aaa11fc9748449b9a88b6a5dc9ca,
|
||||
type: 2}
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 081fe520c7a02c34eb4d1aa74f5f9b16, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/AudioFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,110 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using OverrideData = DistantLands.Cozy.Overridable<float>;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Climate FX", order = 361)]
|
||||
public class ClimateFX : FXProfile
|
||||
{
|
||||
|
||||
|
||||
[OverrideRange(-50, 50)]
|
||||
public OverrideData temperatureOffset;
|
||||
[OverrideRange(-50, 50)]
|
||||
public OverrideData precipitationOffset;
|
||||
CozyClimateModule climate;
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
if (climate == null)
|
||||
if (InitializeEffect(null) == false)
|
||||
return;
|
||||
|
||||
climate.temperatureOffset += temperatureOffset * weight;
|
||||
climate.precipitationOffset += precipitationOffset * weight;
|
||||
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
if (weatherSphere.climateModule == null)
|
||||
return false;
|
||||
|
||||
climate = weatherSphere.climateModule;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(ClimateFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_CliamteFX : E_FXProfile
|
||||
{
|
||||
|
||||
SerializedProperty temperatureOffset;
|
||||
SerializedProperty precipitationOffset;
|
||||
|
||||
SerializedProperty transitionTimeModifier;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
temperatureOffset = serializedObject.FindProperty("temperatureOffset");
|
||||
precipitationOffset = serializedObject.FindProperty("precipitationOffset");
|
||||
transitionTimeModifier = serializedObject.FindProperty("transitionTimeModifier");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(temperatureOffset);
|
||||
EditorGUILayout.PropertyField(precipitationOffset);
|
||||
EditorGUILayout.PropertyField(transitionTimeModifier);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, temperatureOffset);
|
||||
EditorGUI.PropertyField(propPosB, precipitationOffset);
|
||||
EditorGUI.PropertyField(propPosC, transitionTimeModifier);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 3;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4421fb2a566390d489aab3006714af84
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 687a08f4fecec08459bf14249588c0d6, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/ClimateFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,210 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Cloud FX", order = 361)]
|
||||
public class CloudFX : FXProfile
|
||||
{
|
||||
|
||||
|
||||
[Tooltip("Multiplier for cumulus clouds.")]
|
||||
[OverrideRange(0, 2)]
|
||||
public Overridable<float> cumulusCoverage = 1;
|
||||
[Tooltip("Multiplier for altocumulus clouds.")]
|
||||
[OverrideRange(0, 2)]
|
||||
public Overridable<float> altocumulusCoverage = 0;
|
||||
[Tooltip("Multiplier for chemtrails.")]
|
||||
[OverrideRange(0, 2)]
|
||||
public Overridable<float> chemtrailCoverage = 0;
|
||||
[Tooltip("Multiplier for cirrostratus clouds.")]
|
||||
[OverrideRange(0, 2)]
|
||||
public Overridable<float> cirrostratusCoverage = 0;
|
||||
[Tooltip("Multiplier for cirrus clouds.")]
|
||||
[OverrideRange(0, 2)]
|
||||
public Overridable<float> cirrusCoverage = 0;
|
||||
[Tooltip("Multiplier for nimbus clouds.")]
|
||||
[OverrideRange(0, 2)]
|
||||
public Overridable<float> nimbusCoverage = 0;
|
||||
[Tooltip("Variation for nimbus clouds.")]
|
||||
[OverrideRange(0, 1)]
|
||||
public Overridable<float> nimbusVariation = 0.9f;
|
||||
[Tooltip("Height mask effect for nimbus clouds.")]
|
||||
[OverrideRange(0, 1)]
|
||||
public Overridable<float> nimbusHeightEffect = 1;
|
||||
|
||||
[Tooltip("Starting height for cloud border.")]
|
||||
[OverrideRange(0, 1)]
|
||||
public Overridable<float> borderHeight = 0.5f;
|
||||
[Tooltip("Variation for cloud border.")]
|
||||
[OverrideRange(0, 1)]
|
||||
public Overridable<float> borderVariation = 0.9f;
|
||||
[Tooltip("Multiplier for the border. Values below zero clip the clouds whereas values above zero add clouds.")]
|
||||
[OverrideRange(-1, 1)]
|
||||
public Overridable<float> borderEffect = 1;
|
||||
[Tooltip("Controls the average density of the fog.")]
|
||||
[OverrideRange(0, 5)]
|
||||
public Overridable<float> fogDensity = 1;
|
||||
|
||||
CozyWeatherModule weatherModule;
|
||||
|
||||
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
|
||||
if (!weatherModule)
|
||||
if (InitializeEffect(null) == false)
|
||||
return;
|
||||
|
||||
weatherModule.cumulus = Mathf.Clamp(weatherModule.cumulus + cumulusCoverage * transitionTimeModifier.Evaluate(weight), 0, 2);
|
||||
weatherModule.cirrus = Mathf.Clamp(weatherModule.cirrus + cirrusCoverage * transitionTimeModifier.Evaluate(weight), 0, 2);
|
||||
weatherModule.altocumulus = Mathf.Clamp(weatherModule.altocumulus + altocumulusCoverage * transitionTimeModifier.Evaluate(weight), 0, 2);
|
||||
weatherModule.cirrostratus = Mathf.Clamp(weatherModule.cirrostratus + cirrostratusCoverage * transitionTimeModifier.Evaluate(weight), 0, 2);
|
||||
weatherModule.chemtrails = Mathf.Clamp(weatherModule.chemtrails + chemtrailCoverage * transitionTimeModifier.Evaluate(weight), 0, 2);
|
||||
weatherModule.nimbus = Mathf.Clamp(weatherModule.nimbus + nimbusCoverage * transitionTimeModifier.Evaluate(weight), 0, 2);
|
||||
weatherModule.nimbusHeight = Mathf.Clamp(weatherModule.nimbusHeight + nimbusHeightEffect * transitionTimeModifier.Evaluate(weight), 0, 1);
|
||||
weatherModule.nimbusVariation = Mathf.Clamp(weatherModule.nimbusVariation + nimbusVariation * transitionTimeModifier.Evaluate(weight), 0, 1);
|
||||
weatherModule.borderHeight = borderHeight ? Mathf.Lerp(weatherModule.borderHeight, borderHeight, transitionTimeModifier.Evaluate(weight)) : weatherModule.borderHeight;
|
||||
weatherModule.borderEffect = borderEffect ? Mathf.Lerp(weatherModule.borderEffect, borderEffect, transitionTimeModifier.Evaluate(weight)) : weatherModule.borderEffect;
|
||||
weatherModule.borderVariation = borderVariation ? Mathf.Lerp(weatherModule.borderVariation, borderVariation, transitionTimeModifier.Evaluate(weight)) : weatherModule.borderVariation;
|
||||
weatherModule.fogDensity = fogDensity ? Mathf.Clamp(weatherModule.fogDensity + fogDensity * transitionTimeModifier.Evaluate(weight), 0, 5) : weatherModule.fogDensity;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (!weatherSphere.weatherModule)
|
||||
return false;
|
||||
|
||||
weatherModule = weatherSphere.weatherModule;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(CloudFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_CloudFX : E_FXProfile
|
||||
{
|
||||
|
||||
SerializedProperty cumulusCoverage;
|
||||
SerializedProperty altocumulusCoverage;
|
||||
SerializedProperty chemtrailCoverage;
|
||||
SerializedProperty cirrostratusCoverage;
|
||||
SerializedProperty cirrusCoverage;
|
||||
SerializedProperty nimbusCoverage;
|
||||
SerializedProperty nimbusVariation;
|
||||
SerializedProperty nimbusHeightEffect;
|
||||
SerializedProperty borderHeight;
|
||||
SerializedProperty borderVariation;
|
||||
SerializedProperty borderEffect;
|
||||
SerializedProperty fogDensity;
|
||||
SerializedProperty transitionTimeModifier;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
cumulusCoverage = serializedObject.FindProperty("cumulusCoverage");
|
||||
altocumulusCoverage = serializedObject.FindProperty("altocumulusCoverage");
|
||||
chemtrailCoverage = serializedObject.FindProperty("chemtrailCoverage");
|
||||
cirrostratusCoverage = serializedObject.FindProperty("cirrostratusCoverage");
|
||||
cirrusCoverage = serializedObject.FindProperty("cirrusCoverage");
|
||||
nimbusCoverage = serializedObject.FindProperty("nimbusCoverage");
|
||||
nimbusVariation = serializedObject.FindProperty("nimbusVariation");
|
||||
nimbusHeightEffect = serializedObject.FindProperty("nimbusHeightEffect");
|
||||
borderHeight = serializedObject.FindProperty("borderHeight");
|
||||
borderVariation = serializedObject.FindProperty("borderVariation");
|
||||
borderEffect = serializedObject.FindProperty("borderEffect");
|
||||
fogDensity = serializedObject.FindProperty("fogDensity");
|
||||
transitionTimeModifier = serializedObject.FindProperty("transitionTimeModifier");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(cumulusCoverage);
|
||||
EditorGUILayout.PropertyField(altocumulusCoverage);
|
||||
EditorGUILayout.PropertyField(chemtrailCoverage);
|
||||
EditorGUILayout.PropertyField(cirrostratusCoverage);
|
||||
EditorGUILayout.PropertyField(cirrusCoverage);
|
||||
EditorGUILayout.PropertyField(nimbusCoverage);
|
||||
EditorGUILayout.PropertyField(nimbusVariation);
|
||||
EditorGUILayout.PropertyField(nimbusHeightEffect);
|
||||
EditorGUILayout.PropertyField(borderHeight);
|
||||
EditorGUILayout.PropertyField(borderVariation);
|
||||
EditorGUILayout.PropertyField(borderEffect);
|
||||
EditorGUILayout.PropertyField(fogDensity);
|
||||
EditorGUILayout.PropertyField(transitionTimeModifier);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosD = new Rect(pos.x, pos.y + space * 4, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosE = new Rect(pos.x, pos.y + space * 5, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosF = new Rect(pos.x, pos.y + space * 6, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosG = new Rect(pos.x, pos.y + space * 7, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosH = new Rect(pos.x, pos.y + space * 8, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosI = new Rect(pos.x, pos.y + space * 9, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosJ = new Rect(pos.x, pos.y + space * 10, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosK = new Rect(pos.x, pos.y + space * 11, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosL = new Rect(pos.x, pos.y + space * 12, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosM = new Rect(pos.x, pos.y + space * 13, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, cumulusCoverage);
|
||||
EditorGUI.PropertyField(propPosB, altocumulusCoverage);
|
||||
EditorGUI.PropertyField(propPosC, chemtrailCoverage);
|
||||
EditorGUI.PropertyField(propPosD, cirrostratusCoverage);
|
||||
EditorGUI.PropertyField(propPosE, cirrusCoverage);
|
||||
EditorGUI.PropertyField(propPosF, nimbusCoverage);
|
||||
EditorGUI.PropertyField(propPosG, nimbusVariation);
|
||||
EditorGUI.PropertyField(propPosH, nimbusHeightEffect);
|
||||
EditorGUI.PropertyField(propPosI, borderHeight);
|
||||
EditorGUI.PropertyField(propPosJ, borderVariation);
|
||||
EditorGUI.PropertyField(propPosK, borderEffect);
|
||||
EditorGUI.PropertyField(propPosL, fogDensity);
|
||||
EditorGUI.PropertyField(propPosM, transitionTimeModifier);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 13;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81f7af4072372144893b5e90876c5a13
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 48867ccc7c2b91e41ab3e62d1b1d39d1, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/CloudFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,132 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
// using System.Collections.Generic;
|
||||
// using UnityEngine;
|
||||
// using System.Collections;
|
||||
// #if UNITY_EDITOR
|
||||
// using UnityEditor;
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
// namespace DistantLands.Cozy.Data
|
||||
// {
|
||||
// [System.Serializable]
|
||||
// [CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Custom FX", order = 361)]
|
||||
// public class CustomFXExample : FXProfile
|
||||
// {
|
||||
|
||||
|
||||
// public override void PlayEffect()
|
||||
// {
|
||||
|
||||
// //This is called when the FX profile is played.
|
||||
|
||||
// }
|
||||
|
||||
// public override void PlayEffect(float intensity)
|
||||
// {
|
||||
|
||||
// //This will play your effect at a certain intensity. Used for transitioning weather primarily.
|
||||
|
||||
// }
|
||||
|
||||
// public override void StopEffect()
|
||||
// {
|
||||
|
||||
// //This is called when your effect is stopped.
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// public override bool InitializeEffect(VFXModule VFX)
|
||||
// {
|
||||
// if (VFX == null)
|
||||
// {
|
||||
// if (CozyWeather.instance.vfxModule)
|
||||
// VFX = CozyWeather.instance.vfxModule;
|
||||
// else
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// VFXMod = VFX;
|
||||
|
||||
// if (!VFX.particleManager.isEnabled)
|
||||
// {
|
||||
|
||||
// return false;
|
||||
|
||||
// }
|
||||
|
||||
// //This ensures that the VFX module is setup correctly.
|
||||
|
||||
// return true;
|
||||
|
||||
// }
|
||||
|
||||
// public override void DeinitializeEffect()
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// #if UNITY_EDITOR
|
||||
// [CustomEditor(typeof(CustomFXExample))]
|
||||
// [CanEditMultipleObjects]
|
||||
// public class E_CustomFX : E_FXProfile
|
||||
// {
|
||||
|
||||
|
||||
// void OnEnable()
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
// public override void OnInspectorGUI()
|
||||
// {
|
||||
// serializedObject.Update();
|
||||
|
||||
// //Add your custom properties as property fields here:
|
||||
// //EditorGUILayout.PropertyField(serializedObject.FindProperty("myCustomProperty1"));
|
||||
// //EditorGUILayout.PropertyField(serializedObject.FindProperty("myCustomProperty2"));
|
||||
// //EditorGUILayout.PropertyField(serializedObject.FindProperty("myCustomProperty3"));
|
||||
|
||||
// serializedObject.ApplyModifiedProperties();
|
||||
|
||||
// }
|
||||
|
||||
// public override void RenderInWindow(Rect pos)
|
||||
// {
|
||||
|
||||
// //Render your properties inline in a weather or ambience profile like this:
|
||||
|
||||
// // float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
// // var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
// // var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
// // var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
// // serializedObject.Update();
|
||||
|
||||
// // EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("myCustomProperty1"));
|
||||
// // EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("myCustomProperty2"));
|
||||
// // EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("myCustomProperty3"));
|
||||
|
||||
// // serializedObject.ApplyModifiedProperties();
|
||||
// }
|
||||
|
||||
// public override float GetLineHeight()
|
||||
// {
|
||||
// //This sets the number of lines a property will take.
|
||||
// return 3;
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
// #endif
|
||||
// }
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a7fc1d64da06d54f989b922d6dbaa06
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: db319a0b03d0cda4eb6b0b013758f7ce, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/CustomFXExample.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,103 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Event FX", order = 361)]
|
||||
public class EventFX : FXProfile
|
||||
{
|
||||
|
||||
public CozyEventModule events;
|
||||
|
||||
public bool isPlaying;
|
||||
public delegate void OnCall();
|
||||
public event OnCall onCall;
|
||||
public void RaiseOnCall()
|
||||
{
|
||||
onCall?.Invoke();
|
||||
}
|
||||
public delegate void OnEnd();
|
||||
public event OnEnd onEnd;
|
||||
public void RaiseOnEnd()
|
||||
{
|
||||
onEnd?.Invoke();
|
||||
}
|
||||
|
||||
public void PlayEffect()
|
||||
{
|
||||
if (!isPlaying)
|
||||
{
|
||||
isPlaying = true;
|
||||
onCall?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
if (weight > 0.5f)
|
||||
PlayEffect();
|
||||
else
|
||||
StopEffect();
|
||||
}
|
||||
|
||||
public void StopEffect()
|
||||
{
|
||||
if (isPlaying)
|
||||
{
|
||||
isPlaying = false;
|
||||
onEnd?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (!weatherSphere.GetModule<CozyEventModule>())
|
||||
return false;
|
||||
|
||||
events = weatherSphere.GetModule<CozyEventModule>();
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(EventFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_EventFX : E_FXProfile
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("No other properties to adjust! Set events in the Cozy Event Module!", MessageType.Info);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e14efcec9f4e524fa3788848e968419
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 5c58d664db31a3f4797e24c36fa76bfa, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/EventFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,55 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
public abstract class FXProfile : ScriptableObject
|
||||
{
|
||||
|
||||
[TransitionTime]
|
||||
[Tooltip("A curve modifier that is used to impact the speed of the transition for this effect.")]
|
||||
public AnimationCurve transitionTimeModifier = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1));
|
||||
protected CozyWeather weatherSphere;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Plays the Cozy effect at a set intensity.
|
||||
/// </summary>
|
||||
/// <param name="weight">The weight (or intensity percentage) that this effect will play at. From 0.0 to 1.0</param>
|
||||
public abstract void PlayEffect(float weight);
|
||||
|
||||
/// <summary>
|
||||
/// Called to initialize the COZY effect into the system.
|
||||
/// </summary>
|
||||
/// <param name="module">Holds a reference to the Cozy Module that this FX profile works with.</param>
|
||||
public virtual bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
|
||||
weatherSphere = weather ? weather : CozyWeather.instance;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(FXProfile))]
|
||||
[CanEditMultipleObjects]
|
||||
public abstract class E_FXProfile : Editor
|
||||
{
|
||||
|
||||
public abstract float GetLineHeight();
|
||||
|
||||
public abstract void RenderInWindow(Rect pos);
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2cdcf250671dc8748b03a0d03765609a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: -10
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/FXProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,127 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Filter FX", order = 361)]
|
||||
public class FilterFX : FXProfile
|
||||
{
|
||||
|
||||
|
||||
|
||||
[Range(-1, 1)]
|
||||
public float filterSaturation;
|
||||
[Range(-1, 1)]
|
||||
public float filterValue;
|
||||
[ColorUsage(false, true)]
|
||||
public Color filterColor = Color.white;
|
||||
[ColorUsage(false, true)]
|
||||
public Color sunFilter = Color.white;
|
||||
[ColorUsage(false, true)]
|
||||
public Color cloudFilter = Color.white;
|
||||
CozyWeatherModule weatherModule;
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
|
||||
if (!weatherSphere)
|
||||
if (InitializeEffect(null) == false)
|
||||
return;
|
||||
|
||||
weatherModule.filterSaturation = Mathf.Lerp(weatherModule.filterSaturation, filterSaturation, weight);
|
||||
weatherModule.filterValue = Mathf.Lerp(weatherModule.filterValue, filterValue, weight);
|
||||
weatherModule.filterColor = Color.Lerp(weatherModule.filterColor, filterColor, weight);
|
||||
weatherModule.sunFilter = Color.Lerp(weatherModule.sunFilter, sunFilter, weight);
|
||||
weatherModule.cloudFilter = Color.Lerp(weatherModule.cloudFilter, cloudFilter, weight);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (!weatherSphere.weatherModule)
|
||||
return false;
|
||||
|
||||
weatherModule = weatherSphere.weatherModule;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(FilterFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_FilterFX : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("filterSaturation"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("filterValue"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("filterColor"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("sunFilter"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("cloudFilter"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosD = new Rect(pos.x, pos.y + space * 4, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosE = new Rect(pos.x, pos.y + space * 5, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosF = new Rect(pos.x, pos.y + space * 6, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("filterSaturation"));
|
||||
EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("filterValue"));
|
||||
EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("filterColor"));
|
||||
EditorGUI.PropertyField(propPosD, serializedObject.FindProperty("sunFilter"));
|
||||
EditorGUI.PropertyField(propPosE, serializedObject.FindProperty("cloudFilter"));
|
||||
EditorGUI.PropertyField(propPosF, serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 6;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3aec3b970597e2c4590919a95c2c199a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: ea25c1366c1534345813ddb18d759197, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/FilterFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,104 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Multi FX", order = 361)]
|
||||
public class MultiFXProfile : FXProfile
|
||||
{
|
||||
|
||||
public CozyWeather weather;
|
||||
|
||||
[System.Serializable]
|
||||
public class MultiFXType
|
||||
{
|
||||
public FXProfile FX;
|
||||
public ChanceEffector intensityCurve;
|
||||
}
|
||||
|
||||
[MultiAudio]
|
||||
public List<MultiFXType> multiFX;
|
||||
|
||||
[MultiAudio]
|
||||
public MultiFXType test;
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
|
||||
if (weather == null)
|
||||
weather = CozyWeather.instance;
|
||||
|
||||
foreach (MultiFXType i in multiFX)
|
||||
{
|
||||
i.FX.PlayEffect(i.intensityCurve.GetChance(weather) * weight);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
foreach (MultiFXType i in multiFX)
|
||||
{
|
||||
i.FX.InitializeEffect(weatherSphere);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(MultiFXProfile))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_MultiFXProfile : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("multiFX"), true);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 1 + (serializedObject.FindProperty("multiFX").isExpanded ? (serializedObject.FindProperty("multiFX").arraySize * 2) + 1 : 0);
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("multiFX"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e5690365cd281242b33e8a4272ff544
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 003a6f80b12a27e49b0553f7eeb67077, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/MultiFXProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,125 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Particle FX", order = 361)]
|
||||
public class ParticleFX : FXProfile
|
||||
{
|
||||
|
||||
public CozyParticles particleSystem;
|
||||
private CozyParticles runtimeRef;
|
||||
public bool autoScale;
|
||||
|
||||
public override void PlayEffect(float intensity)
|
||||
{
|
||||
if (!runtimeRef)
|
||||
if (InitializeEffect(weatherSphere) == false)
|
||||
return;
|
||||
|
||||
if (autoScale)
|
||||
runtimeRef.transform.localScale = weatherSphere.transform.GetChild(0).localScale;
|
||||
|
||||
if (intensity == 0)
|
||||
{
|
||||
runtimeRef.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
runtimeRef.Play(transitionTimeModifier.Evaluate(intensity));
|
||||
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
return false;
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (runtimeRef == null)
|
||||
{
|
||||
runtimeRef = weatherSphere.GetFXRuntimeRef<CozyParticles>(name);
|
||||
if (runtimeRef)
|
||||
return true;
|
||||
|
||||
runtimeRef = Instantiate(particleSystem).GetComponent<CozyParticles>();
|
||||
|
||||
runtimeRef.gameObject.name = name;
|
||||
runtimeRef.transform.parent = weatherSphere.particleFXParent;
|
||||
runtimeRef.transform.localPosition = Vector3.zero;
|
||||
runtimeRef.transform.localRotation = Quaternion.identity;
|
||||
|
||||
runtimeRef.SetupTriggers();
|
||||
if (autoScale)
|
||||
runtimeRef.transform.localScale *= weatherSphere.transform.GetChild(0).localScale.x;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(ParticleFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_ParticleFX : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("particleSystem"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("autoScale"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("particleSystem"));
|
||||
EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("autoScale"));
|
||||
EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 3;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1198a026fd329fc4d8516e8ea9b39a4b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: bc6c5dfabf8c7e148ac95a5968760967, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/ParticleFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,119 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Precipitation FX", order = 361)]
|
||||
public class PrecipitationFX : FXProfile
|
||||
{
|
||||
|
||||
|
||||
|
||||
[Range(0, 0.05f)]
|
||||
public float rainAccumulationSpeed;
|
||||
[Range(0, 1f)]
|
||||
public float maximumRainAmount;
|
||||
[Range(0, 0.05f)]
|
||||
public float snowAccumulationSpeed;
|
||||
[Range(0, 1f)]
|
||||
public float maximumSnowAmount;
|
||||
public float weight;
|
||||
CozyWeather weather;
|
||||
CozyClimateModule climateModule;
|
||||
|
||||
public override void PlayEffect(float i)
|
||||
{
|
||||
if (!weather)
|
||||
if (InitializeEffect(null) == false)
|
||||
return;
|
||||
|
||||
climateModule.snowSpeed += snowAccumulationSpeed * Mathf.Clamp01(transitionTimeModifier.Evaluate(i)) * (climateModule.snowAmount < maximumSnowAmount ? 1 : 0);
|
||||
climateModule.rainSpeed += rainAccumulationSpeed * Mathf.Clamp01(transitionTimeModifier.Evaluate(i)) * (climateModule.groundwaterAmount < maximumRainAmount ? 1 : 0);
|
||||
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (!weatherSphere.climateModule)
|
||||
return false;
|
||||
|
||||
climateModule = weatherSphere.climateModule;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(PrecipitationFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_PrecipitationFX : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("rainAccumulationSpeed"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumRainAmount"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("snowAccumulationSpeed"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumSnowAmount"));
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosD = new Rect(pos.x, pos.y + space * 4, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosE = new Rect(pos.x, pos.y + space * 5, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("rainAccumulationSpeed"));
|
||||
EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("maximumRainAmount"));
|
||||
EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("snowAccumulationSpeed"));
|
||||
EditorGUI.PropertyField(propPosD, serializedObject.FindProperty("maximumSnowAmount"));
|
||||
EditorGUI.PropertyField(propPosE, serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 5;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a220b0eb91aa7b14db62e84fafcf00ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 7b4753b20d42bda48b9fbeca35ae8404, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/PrecipitationFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,165 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Thunder FX", order = 361)]
|
||||
public class ThunderFX : FXProfile
|
||||
{
|
||||
|
||||
public Vector2 timeBetweenStrikes;
|
||||
public GameObject thunderPrefab = null;
|
||||
public float weight;
|
||||
public CozyThunderManager runtimeRef;
|
||||
public float minimumDistance = 700;
|
||||
public float maximumDistance = 1200;
|
||||
public float minScreenXmultiplier = 0.1f;
|
||||
public float maxScreenXmultiplier = 0.9f;
|
||||
public float minScreenYmultiplier = 0.0f;
|
||||
public float maxScreenYmultiplier = 0.1f;
|
||||
[Range(0, 1)]
|
||||
[Tooltip("What percentage of the time should the lightning and thunder be forced to spawn in the camera's view?")]
|
||||
public float spawnInFrustumPercentage = 0.5f;
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
|
||||
if (!runtimeRef)
|
||||
if (InitializeEffect(weatherSphere) == false)
|
||||
return;
|
||||
|
||||
runtimeRef.PlayEffect(transitionTimeModifier.Evaluate(weight));
|
||||
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
return false;
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (runtimeRef == null)
|
||||
{
|
||||
if (weatherSphere.GetFXRuntimeRef<CozyThunderManager>(name))
|
||||
{
|
||||
runtimeRef = weatherSphere.GetFXRuntimeRef<CozyThunderManager>(name);
|
||||
return true;
|
||||
}
|
||||
|
||||
runtimeRef = new GameObject().AddComponent<CozyThunderManager>();
|
||||
|
||||
runtimeRef.gameObject.name = name;
|
||||
runtimeRef.transform.parent = weatherSphere.thunderFXParent;
|
||||
runtimeRef.transform.localPosition = Vector3.zero;
|
||||
runtimeRef.transform.localRotation = Quaternion.identity;
|
||||
runtimeRef.weatherSphere = weatherSphere;
|
||||
runtimeRef.thunderFX = this;
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(ThunderFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_ThunderFX : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("thunderPrefab"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("timeBetweenStrikes"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("minimumDistance"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumDistance"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("spawnInFrustumPercentage"));
|
||||
|
||||
float min = serializedObject.FindProperty("minScreenXmultiplier").floatValue;
|
||||
float max = serializedObject.FindProperty("maxScreenXmultiplier").floatValue;
|
||||
|
||||
EditorGUILayout.MinMaxSlider("Frustum Placement X", ref min, ref max, 0, 1);
|
||||
|
||||
serializedObject.FindProperty("minScreenXmultiplier").floatValue = min;
|
||||
serializedObject.FindProperty("maxScreenXmultiplier").floatValue = max;
|
||||
|
||||
min = serializedObject.FindProperty("minScreenYmultiplier").floatValue;
|
||||
max = serializedObject.FindProperty("maxScreenYmultiplier").floatValue;
|
||||
|
||||
EditorGUILayout.MinMaxSlider("Frustum Placement Y", ref min, ref max, 0, 1);
|
||||
|
||||
serializedObject.FindProperty("minScreenYmultiplier").floatValue = min;
|
||||
serializedObject.FindProperty("maxScreenYmultiplier").floatValue = max;
|
||||
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosD = new Rect(pos.x, pos.y + space * 4, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosE = new Rect(pos.x, pos.y + space * 5, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosF = new Rect(pos.x, pos.y + space * 6, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosG = new Rect(pos.x, pos.y + space * 7, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("thunderPrefab"));
|
||||
EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("timeBetweenStrikes"));
|
||||
EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("minimumDistance"));
|
||||
EditorGUI.PropertyField(propPosD, serializedObject.FindProperty("maximumDistance"));
|
||||
EditorGUI.PropertyField(propPosE, serializedObject.FindProperty("spawnInFrustumPercentage"));
|
||||
|
||||
float min = serializedObject.FindProperty("minScreenXmultiplier").floatValue;
|
||||
float max = serializedObject.FindProperty("maxScreenXmultiplier").floatValue;
|
||||
|
||||
EditorGUI.MinMaxSlider(propPosF, "Frustum Placement X", ref min, ref max, 0, 1);
|
||||
|
||||
serializedObject.FindProperty("minScreenXmultiplier").floatValue = min;
|
||||
serializedObject.FindProperty("maxScreenXmultiplier").floatValue = max;
|
||||
|
||||
min = serializedObject.FindProperty("minScreenYmultiplier").floatValue;
|
||||
max = serializedObject.FindProperty("maxScreenYmultiplier").floatValue;
|
||||
|
||||
EditorGUI.MinMaxSlider(propPosG, "Frustum Placement Y", ref min, ref max, 0, 1);
|
||||
|
||||
serializedObject.FindProperty("minScreenYmultiplier").floatValue = min;
|
||||
serializedObject.FindProperty("maxScreenYmultiplier").floatValue = max;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 7;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca76ee3291b361040b4d65c605cd0e5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 3700da53e9facc044af615d22cdcada1, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/ThunderFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,147 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
#if COZY_URP
|
||||
using UnityEngine.Rendering;
|
||||
#elif UNITY_POST_PROCESSING_STACK_V2
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
#endif
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Post Processing FX", order = 361)]
|
||||
public class VisualFX : FXProfile
|
||||
{
|
||||
|
||||
public int layer;
|
||||
public float priority = 100;
|
||||
#if COZY_URP
|
||||
public VolumeProfile effectSettings;
|
||||
Volume _volume;
|
||||
|
||||
#elif UNITY_POST_PROCESSING_STACK_V2
|
||||
public PostProcessProfile effectSettings;
|
||||
PostProcessVolume _volume;
|
||||
#endif
|
||||
|
||||
public override void PlayEffect(float i)
|
||||
{
|
||||
#if UNITY_POST_PROCESSING_STACK_V2 || COZY_URP
|
||||
if (!_volume)
|
||||
if (!InitializeEffect(weatherSphere))
|
||||
return;
|
||||
|
||||
_volume.weight = Mathf.Clamp01(transitionTimeModifier.Evaluate(i));
|
||||
#endif
|
||||
}
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
return false;
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
#if UNITY_POST_PROCESSING_STACK_V2 || COZY_URP
|
||||
if (_volume)
|
||||
return true;
|
||||
|
||||
if (_volume == null)
|
||||
{
|
||||
#if COZY_URP
|
||||
if (weatherSphere.GetFXRuntimeRef<Volume>(name))
|
||||
_volume = weatherSphere.GetFXRuntimeRef<Volume>(name);
|
||||
#elif UNITY_POST_PROCESSING_STACK_V2
|
||||
_volume = weather.GetFXRuntimeRef<PostProcessVolume>(name);
|
||||
#endif
|
||||
if (_volume)
|
||||
return true;
|
||||
|
||||
#if COZY_URP
|
||||
_volume = new GameObject().AddComponent<Volume>();
|
||||
#elif UNITY_POST_PROCESSING_STACK_V2
|
||||
_volume = new GameObject().AddComponent<PostProcessVolume>();
|
||||
#endif
|
||||
_volume.gameObject.name = name;
|
||||
_volume.transform.parent = weatherSphere.visualFXParent;
|
||||
_volume.transform.position = Vector3.zero;
|
||||
_volume.transform.rotation = Quaternion.identity;
|
||||
_volume.profile = effectSettings;
|
||||
_volume.priority = priority;
|
||||
_volume.weight = 0;
|
||||
_volume.isGlobal = true;
|
||||
_volume.gameObject.layer = layer;
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(VisualFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_VisualFX : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.LayerField(new GUIContent("Volume Layer"), serializedObject.FindProperty("layer").intValue);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("priority"), new GUIContent("Priority"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("transitionTimeModifier"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("effectSettings"), new GUIContent("Post Processing Profile"));
|
||||
EditorGUILayout.Space();
|
||||
if (serializedObject.FindProperty("effectSettings").objectReferenceValue)
|
||||
CreateEditor(serializedObject.FindProperty("effectSettings").objectReferenceValue).OnInspectorGUI();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosD = new Rect(pos.x, pos.y + space * 4, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosE = new Rect(pos.x, pos.y + space * 5, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosF = new Rect(pos.x, pos.y + space * 6, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.LayerField(propPosA, new GUIContent("Volume Layer"), serializedObject.FindProperty("layer").intValue);
|
||||
EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("priority"));
|
||||
EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("effectSettings"));
|
||||
|
||||
EditorGUI.PropertyField(propPosD, serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 4;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6be874a6122670e47af29134c1e9002c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 198a9fef84fe9ed4eaa6caa5d17f380d, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/VisualFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,120 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/FX/Wind FX", order = 361)]
|
||||
public class WindFX : FXProfile
|
||||
{
|
||||
|
||||
|
||||
|
||||
[Range(0, 2)]
|
||||
public float windAmount;
|
||||
[Range(0, 2)]
|
||||
public float windSpeed;
|
||||
[Range(0, 2)]
|
||||
public float windGusting;
|
||||
[Range(0, 10)]
|
||||
public float windChangeSpeed = 1;
|
||||
CozyWindModule windModule;
|
||||
|
||||
public override void PlayEffect(float weight)
|
||||
{
|
||||
if (!weatherSphere)
|
||||
return;
|
||||
|
||||
if (!windModule)
|
||||
{
|
||||
if (!InitializeEffect(weatherSphere))
|
||||
return;
|
||||
}
|
||||
|
||||
windModule.windAmount += windAmount * weight;
|
||||
windModule.windGusting += windGusting * weight;
|
||||
windModule.windSpeed += windSpeed * weight;
|
||||
windModule.windChangeSpeed += windChangeSpeed * weight;
|
||||
}
|
||||
|
||||
public override bool InitializeEffect(CozyWeather weather)
|
||||
{
|
||||
|
||||
base.InitializeEffect(weather);
|
||||
|
||||
if (!weatherSphere.windModule)
|
||||
return false;
|
||||
|
||||
windModule = weatherSphere.windModule;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(WindFX))]
|
||||
[CanEditMultipleObjects]
|
||||
public class E_WindFX : E_FXProfile
|
||||
{
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("windAmount"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("windSpeed"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("windGusting"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("windChangeSpeed"));
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
public override void RenderInWindow(Rect pos)
|
||||
{
|
||||
|
||||
float space = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
var propPosA = new Rect(pos.x, pos.y + space, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosB = new Rect(pos.x, pos.y + space * 2, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosC = new Rect(pos.x, pos.y + space * 3, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
var propPosD = new Rect(pos.x, pos.y + space * 4, pos.width, EditorGUIUtility.singleLineHeight);
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.PropertyField(propPosA, serializedObject.FindProperty("windAmount"));
|
||||
EditorGUI.PropertyField(propPosB, serializedObject.FindProperty("windSpeed"));
|
||||
EditorGUI.PropertyField(propPosC, serializedObject.FindProperty("windGusting"));
|
||||
|
||||
EditorGUI.PropertyField(propPosD, serializedObject.FindProperty("transitionTimeModifier"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override float GetLineHeight()
|
||||
{
|
||||
|
||||
return 4;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1839d607387d7141b9b2740289fdbc4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 1e5d1669bf992464b8919cb9312f8d17, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/FX/WindFX.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,34 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Forecast Profile", order = 361)]
|
||||
public class ForecastProfile : CozyProfile
|
||||
{
|
||||
|
||||
|
||||
[Tooltip("The weather profiles that this profile will forecast.")]
|
||||
public List<WeatherProfile> profilesToForecast;
|
||||
|
||||
[Tooltip("The weather profile that this profile will forecast initially.")]
|
||||
public WeatherProfile initialProfile;
|
||||
[Tooltip("The weather profiles that this profile will forecast initially.")]
|
||||
public List<CozyEcosystem.WeatherPattern> initialForecast;
|
||||
|
||||
public enum StartWeatherWith { Random, InitialProfile, InitialForecast }
|
||||
public StartWeatherWith startWeatherWith;
|
||||
|
||||
[Tooltip("The amount of weather profiles to forecast ahead.")]
|
||||
public int forecastLength;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd9f2f3af9c7daa40b51758d10f57159
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: e51b7563b2e461141a757c1b77ca0217, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/ForecastProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,55 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Material Manager Profile", order = 361)]
|
||||
public class MaterialManagerProfile : CozyProfile
|
||||
{
|
||||
|
||||
|
||||
public Texture snowTexture;
|
||||
public float snowNoiseSize = 10;
|
||||
public Color snowColor = Color.white;
|
||||
public float puddleScale = 2;
|
||||
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class ModulatedValue
|
||||
{
|
||||
public enum ModulationSource { dayPercent, yearPercent, precipitation, temperature, snowAmount, rainAmount }
|
||||
public enum ModulationTarget { terrainLayerColor, terrainLayerTint, materialColor, materialValue, globalColor, globalValue }
|
||||
[Tooltip("The source that will modulate the target.")]
|
||||
public ModulationSource modulationSource;
|
||||
[Tooltip("The target type that will be modulated.")]
|
||||
public ModulationTarget modulationTarget;
|
||||
[Tooltip("The gradient that will pass a color to the modulation target based on the modulation source.")]
|
||||
public Gradient mappedGradient;
|
||||
[Tooltip("The curve that will pass a float value to the modulation target based on the modulation source.")]
|
||||
public AnimationCurve mappedCurve;
|
||||
|
||||
[Tooltip("The terrain layer that this profile impacts.")]
|
||||
public TerrainLayer targetLayer;
|
||||
[Tooltip("The material that this profile impacts.")]
|
||||
public Material targetMaterial;
|
||||
|
||||
public string targetVariableName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
[ModulatedProperty]
|
||||
public ModulatedValue[] modulatedValues;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab43f620421ea8447ac2c347f8e8584d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- snowTexture: {fileID: 2800000, guid: da7b2a01626e7224d92acb5c2e151193, type: 3}
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 72bac8028b56df24ebb3db8c0309ecf0, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/MaterialManagerProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,77 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Perennial Profile", order = 361)]
|
||||
public class PerennialProfile : CozyProfile
|
||||
{
|
||||
public bool pauseTime;
|
||||
[Tooltip("Should this profile use a series of months for a more realistic year.")]
|
||||
public bool realisticYear;
|
||||
[Tooltip("Should this profile use a longer year every 4th year.")]
|
||||
public bool useLeapYear;
|
||||
|
||||
[Tooltip("Should this system reset the time when it loads?")]
|
||||
public bool resetTimeOnStart = false;
|
||||
[Tooltip("The time that this system should start at when the scene is loaded.")]
|
||||
public MeridiemTime startTime = new MeridiemTime(9, 00);
|
||||
[Tooltip("Specifies the amount of in-game minutes that pass in a real-world second.")]
|
||||
public float timeMovementSpeed = 1;
|
||||
[Tooltip("Change the rate at which time moves based on the current time.")]
|
||||
public bool modulateTimeSpeed = true;
|
||||
[Tooltip("Changes the time speed based on the day percentage.")]
|
||||
public AnimationCurve timeSpeedMultiplier;
|
||||
[Tooltip("Will the day move to the next day at 12:00 midnight")]
|
||||
public bool progressDay = true;
|
||||
|
||||
[System.Serializable]
|
||||
public class Month
|
||||
{
|
||||
|
||||
public string name;
|
||||
public int days;
|
||||
|
||||
}
|
||||
|
||||
[MonthList]
|
||||
public Month[] standardYear = new Month[12] { new Month() { days = 31, name = "January"}, new Month() { days = 28, name = "Febraury" },
|
||||
new Month() { days = 31, name = "March"}, new Month() { days = 30, name = "April"}, new Month() { days = 31, name = "May"},
|
||||
new Month() { days = 30, name = "June"}, new Month() { days = 31, name = "July"}, new Month() { days = 31, name = "August"},
|
||||
new Month() { days = 30, name = "September"}, new Month() { days = 31, name = "October"}, new Month() { days = 30, name = "Novemeber"},
|
||||
new Month() { days = 31, name = "December"}};
|
||||
|
||||
[MonthList]
|
||||
public Month[] leapYear = new Month[12] { new Month() { days = 31, name = "January"}, new Month() { days = 29, name = "Febraury" },
|
||||
new Month() { days = 31, name = "March"}, new Month() { days = 30, name = "April"}, new Month() { days = 31, name = "May"},
|
||||
new Month() { days = 30, name = "June"}, new Month() { days = 31, name = "July"}, new Month() { days = 31, name = "August"},
|
||||
new Month() { days = 30, name = "September"}, new Month() { days = 31, name = "October"}, new Month() { days = 30, name = "Novemeber"},
|
||||
new Month() { days = 31, name = "December"}};
|
||||
|
||||
public enum DefaultYear { January, February, March, April, May, June, July, August, September, October, November, December }
|
||||
public enum TimeDivisors { Early, Mid, Late }
|
||||
|
||||
public int daysPerYear = 48;
|
||||
|
||||
public int GetRealisticDaysPerYear(int currentYear)
|
||||
{
|
||||
|
||||
int i = 0;
|
||||
foreach (Month j in (useLeapYear && currentYear % 4 == 0) ? leapYear : standardYear) i += j.days;
|
||||
return i;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 940bc5c08f23e3947a38c262be3e3dfc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 133489adeebdafa48b245f103e2e3ef7, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/PerennialProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,43 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Satellite Profile", order = 361)]
|
||||
public class SatelliteProfile : ScriptableObject
|
||||
{
|
||||
|
||||
public GameObject satelliteReference;
|
||||
public Transform orbitRef;
|
||||
public Transform moonRef;
|
||||
public Light lightRef;
|
||||
public float size = 1;
|
||||
[Range(0, 1)]
|
||||
public float distance = 1;
|
||||
public bool autoScaleByDistance = true;
|
||||
public float orbitOffset;
|
||||
public Vector3 initialRotation;
|
||||
public float satelliteRotateSpeed;
|
||||
public bool linkToDay;
|
||||
public int rotationPeriod = 28;
|
||||
public int rotationPeriodOffset;
|
||||
public Vector3 satelliteRotateAxis;
|
||||
public float satelliteDirection;
|
||||
public float satelliteRotation;
|
||||
public float satellitePitch;
|
||||
public float declination;
|
||||
public int declinationPeriod;
|
||||
public bool changedLastFrame;
|
||||
public bool open;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac36c75b9c2af5b42a8f1907e068490d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: d6d096f39b66f2d4fbf0ced720779466, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/SatelliteProfile.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,49 @@
|
||||
// Distant Lands 2025
|
||||
// COZY: Stylized Weather 3
|
||||
// All code included in this file is protected under the Unity Asset Store Eula
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace DistantLands.Cozy.Data
|
||||
{
|
||||
|
||||
[System.Serializable]
|
||||
[CreateAssetMenu(menuName = "Distant Lands/Cozy/Weather Profile", order = 361)]
|
||||
public class WeatherProfile : ScriptableObject
|
||||
{
|
||||
|
||||
[Tooltip("Specifies the minimum length for this weather profile in in-game hours and minutes.")]
|
||||
[FormerlySerializedAs("minWeatherTime")]
|
||||
[MeridiemTime]
|
||||
public float minTime = 0.25f;
|
||||
public float minWeatherTime => minTime;
|
||||
[Tooltip("Specifies the maximum length for this weather profile in in-game hours and minutes.")]
|
||||
[FormerlySerializedAs("maxWeatherTime")]
|
||||
[MeridiemTime]
|
||||
public float maxTime = 0.35f;
|
||||
public float maxWeatherTime => maxTime;
|
||||
public WeightedRandomChance chance;
|
||||
[HideTitle]
|
||||
[Tooltip("Allow only these weather profiles to immediately follow this weather profile in a forecast.")]
|
||||
public WeatherProfile[] forecastNext;
|
||||
public enum ForecastModifierMethod { forecastNext, DontForecastNext, forecastAnyProfileNext }
|
||||
public ForecastModifierMethod forecastModifierMethod = ForecastModifierMethod.forecastAnyProfileNext;
|
||||
|
||||
[FX]
|
||||
public FXProfile[] FX;
|
||||
|
||||
public float GetChance(CozyWeather weather, float inTime) => chance.GetChance(weather, inTime);
|
||||
public float GetChance(CozyWeather weather) => chance.GetChance(weather);
|
||||
public void SetWeatherWeight(float weightVal)
|
||||
{
|
||||
foreach (FXProfile fx in FX)
|
||||
fx?.PlayEffect(weightVal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: edc9e8ccf7e1f314da24a604c1a11094
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 0068e4ca93e839c4184a107b1bd62f35, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Runtime/Data/WeatherProfile.cs
|
||||
uploadId: 939148
|
||||
Reference in New Issue
Block a user