Cozy Wather + buld systeme

This commit is contained in:
2026-07-07 16:43:51 +02:00
parent 031ac42e5d
commit 6b26ae3376
2140 changed files with 3482825 additions and 2252 deletions
@@ -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