Cozy Wather + buld systeme
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89f20016c8eeaa14c81ff60ddd6f44a0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,300 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using DistantLands.Cozy.Data;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyAmbienceModule))]
|
||||
public class CozyAmbienceModuleEditor : CozyBiomeModuleEditor
|
||||
{
|
||||
|
||||
CozyAmbienceModule ambienceModule;
|
||||
public override ModuleCategory Category => ModuleCategory.ecosystem;
|
||||
public override string ModuleTitle => "Ambience";
|
||||
public override string ModuleSubtitle => "Secondary Weather Module";
|
||||
public override string ModuleTooltip => "Controls a secondary weather system that runs parallel to the main system allowing for ambient noises and FX.";
|
||||
|
||||
public VisualElement CurrentInfoContainer => root.Q<VisualElement>("current-information-container");
|
||||
public VisualElement DistributionMap => root.Q<VisualElement>("distribution-map");
|
||||
public VisualElement DistributionMapKey => root.Q<VisualElement>("distribution-map-key");
|
||||
public VisualElement ChancesByVariableChart => root.Q<VisualElement>("chances-by-variable-chart");
|
||||
public VisualElement ChancesByVariableKey => root.Q<VisualElement>("chances-by-variable-key");
|
||||
public EnumField ChancesByVariableLimit => root.Q<EnumField>("chances-by-variable-limit");
|
||||
|
||||
public ListView AmbienceProfileList => root.Q<ListView>("ambience-profile-list");
|
||||
public VisualElement CurrentInformationContainer => root.Q<VisualElement>("current-information-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
public static Gradient distributionGradient = new Gradient()
|
||||
{
|
||||
colorKeys = new GradientColorKey[5]
|
||||
{
|
||||
new GradientColorKey(new Color(0.149f, 0.329f, 0.486f, 1f), 0f), // #26547C
|
||||
new GradientColorKey(new Color(0.937f, 0.278f, 0.435f, 1f), 0.25f), // #EF476F
|
||||
new GradientColorKey(new Color(1.0f, 0.820f, 0.400f, 1f), 0.5f), // #FFD166
|
||||
new GradientColorKey(new Color(0.024f, 0.839f, 0.627f, 1f), 0.75f), // #06D6A0
|
||||
new GradientColorKey(new Color(0.765f, 0.765f, 0.902f, 1f), 1f) // #C3C3E6
|
||||
}
|
||||
};
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
ambienceModule = (CozyAmbienceModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.style.fontSize = 8;
|
||||
if (ambienceModule.currentAmbienceProfile)
|
||||
status.text = ambienceModule.currentAmbienceProfile.name;
|
||||
else
|
||||
status.text = "No ambience playing";
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/ambience-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
root.RegisterCallback<PointerMoveEvent>((PointerMoveEvent) =>
|
||||
{
|
||||
UpdateWheel();
|
||||
});
|
||||
|
||||
UpdateWheel();
|
||||
|
||||
AmbienceProfileList.BindProperty(serializedObject.FindProperty("ambienceProfiles"));
|
||||
|
||||
PropertyField currentAmbienceProfile = new PropertyField();
|
||||
currentAmbienceProfile.BindProperty(serializedObject.FindProperty("currentAmbienceProfile"));
|
||||
CurrentInfoContainer.Add(currentAmbienceProfile);
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayBiomeUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
PropertyField currentAmbienceProfile = new PropertyField();
|
||||
currentAmbienceProfile.BindProperty(serializedObject.FindProperty("currentAmbienceProfile"));
|
||||
root.Add(currentAmbienceProfile);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public void RefreshChanceGraph()
|
||||
{
|
||||
ChancesByVariableKey.Clear();
|
||||
|
||||
ChanceEffector.LimitType limitType = (ChanceEffector.LimitType)ChancesByVariableLimit.value;
|
||||
List<AmbienceProfile> adjustedProfiles = ambienceModule.ambienceProfiles
|
||||
.Where(x => x.chance.HasLimit(limitType))
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < adjustedProfiles.Count; i++)
|
||||
{
|
||||
AmbienceProfile profile = adjustedProfiles[i];
|
||||
VisualElement container = new VisualElement();
|
||||
container.AddToClassList("swatch");
|
||||
container.RegisterCallback<ClickEvent>((ClickEvent evt) =>
|
||||
{
|
||||
Selection.activeObject = ambienceModule.ambienceProfiles.First(x => x == profile);
|
||||
});
|
||||
|
||||
|
||||
VisualElement swatch = new VisualElement();
|
||||
swatch.style.backgroundColor = distributionGradient.Evaluate((float)i / adjustedProfiles.Count);
|
||||
container.Add(swatch);
|
||||
|
||||
Label timeLabel = new Label
|
||||
{
|
||||
text = adjustedProfiles[i].name
|
||||
};
|
||||
timeLabel.AddToClassList("font-bold");
|
||||
container.Add(timeLabel);
|
||||
|
||||
ChancesByVariableKey.Add(container);
|
||||
|
||||
}
|
||||
|
||||
ChancesByVariableChart.Clear();
|
||||
|
||||
VisualElement graphHolder = new VisualElement();
|
||||
graphHolder.AddToClassList("graph-section");
|
||||
|
||||
graphHolder.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = graphHolder.contentRect.width;
|
||||
float height = graphHolder.contentRect.height;
|
||||
|
||||
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.lineWidth = 2;
|
||||
painter.strokeColor = Branding.lightGreyAccent;
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(0, height));
|
||||
painter.LineTo(new Vector2(width, height));
|
||||
painter.MoveTo(new Vector2(0, height));
|
||||
painter.LineTo(new Vector2(0, 0));
|
||||
painter.MoveTo(new Vector2(width / 2f, height));
|
||||
painter.LineTo(new Vector2(width / 2f, 0));
|
||||
painter.MoveTo(new Vector2(width * 3f / 4f, height));
|
||||
painter.LineTo(new Vector2(width * 3f / 4f, 0));
|
||||
painter.MoveTo(new Vector2(width * 1f / 4f, height));
|
||||
painter.LineTo(new Vector2(width * 1f / 4f, 0));
|
||||
painter.MoveTo(new Vector2(width, height));
|
||||
painter.LineTo(new Vector2(width, 0));
|
||||
painter.MoveTo(new Vector2(0, 0));
|
||||
painter.LineTo(new Vector2(width, 0));
|
||||
painter.Stroke();
|
||||
|
||||
|
||||
for (int i = 0; i < adjustedProfiles.Count; i++)
|
||||
{
|
||||
|
||||
AmbienceProfile profile = adjustedProfiles[i];
|
||||
painter.strokeColor = distributionGradient.Evaluate((float)i / adjustedProfiles.Count);
|
||||
|
||||
int vertex = 40;
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(0, height * (1 - profile.chance.GetChance(limitType, 0f))));
|
||||
|
||||
for (int j = 1; j <= vertex; j++)
|
||||
{
|
||||
painter.LineTo(new Vector2(width * (float)j / vertex, height * (1 - profile.chance.GetChance((ChanceEffector.LimitType)ChancesByVariableLimit.value, (float)j / vertex))));
|
||||
}
|
||||
|
||||
painter.Stroke();
|
||||
}
|
||||
};
|
||||
|
||||
ChancesByVariableChart.Add(graphHolder);
|
||||
|
||||
}
|
||||
|
||||
public void UpdateWheel()
|
||||
{
|
||||
if (DistributionMap == null || DistributionMapKey == null) return;
|
||||
|
||||
DistributionMap.Clear();
|
||||
DistributionMapKey.Clear();
|
||||
|
||||
if (ambienceModule.ambienceProfiles.Length == 0)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CozyWeather cozyWeather = CozyWeather.instance;
|
||||
List<AmbienceProfile> sortedProfiles = ambienceModule.ambienceProfiles.ToList()
|
||||
.Where(x => x.GetChance(cozyWeather) > 0.05f)
|
||||
.OrderBy(x => x.GetChance(cozyWeather)).ToList();
|
||||
|
||||
float totalChance = sortedProfiles.Sum(x => x.GetChance(cozyWeather));
|
||||
float iteratedChance = 0;
|
||||
|
||||
if (sortedProfiles.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VisualElement element = new VisualElement();
|
||||
element.AddToClassList("graph-section");
|
||||
|
||||
element.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = element.contentRect.width;
|
||||
float height = element.contentRect.height;
|
||||
|
||||
var painter = context.painter2D;
|
||||
|
||||
for (int i = 0; i < sortedProfiles.Count; i++)
|
||||
{
|
||||
|
||||
Color distributionColor = distributionGradient.Evaluate((float)i / sortedProfiles.Count);
|
||||
float chance = sortedProfiles[i].GetChance(cozyWeather);
|
||||
|
||||
painter.strokeColor = distributionColor;
|
||||
painter.lineWidth = 24;
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2f, height / 2f), height / 3f, 360f * (iteratedChance / totalChance) + 1, 360 * (iteratedChance + chance) / totalChance, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
if (sortedProfiles[i] == ambienceModule.currentAmbienceProfile)
|
||||
{
|
||||
painter.BeginPath();
|
||||
painter.lineWidth = 2;
|
||||
painter.strokeColor = new Color(1, 1, 1, 0.6f);
|
||||
painter.Arc(new Vector2(width / 2f, height / 2f), height / 3f + 17, 360f * (iteratedChance / totalChance), 360 * (iteratedChance + chance) / totalChance, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
}
|
||||
|
||||
iteratedChance += chance;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
for (int i = 0; i < sortedProfiles.Count; i++)
|
||||
{
|
||||
Color distributionColor = distributionGradient.Evaluate((float)i / sortedProfiles.Count);
|
||||
AmbienceProfile profile = sortedProfiles[i];
|
||||
float chance = profile.GetChance(cozyWeather);
|
||||
|
||||
VisualElement key = new VisualElement();
|
||||
key.AddToClassList("swatch");
|
||||
key.RegisterCallback<ClickEvent>((ClickEvent evt) =>
|
||||
{
|
||||
Selection.activeObject = ambienceModule.ambienceProfiles.First(x => x == profile);
|
||||
});
|
||||
|
||||
VisualElement swatch = new VisualElement();
|
||||
swatch.style.backgroundColor = distributionColor;
|
||||
key.Add(swatch);
|
||||
|
||||
Label label = new Label()
|
||||
{
|
||||
text = $"{profile.name} - {Mathf.Round(chance / totalChance * 100)}%"
|
||||
};
|
||||
key.Add(label);
|
||||
DistributionMapKey.Insert(0, key);
|
||||
}
|
||||
|
||||
DistributionMap.Add(element);
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/ambience-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 155d70af0f5e9fe40bc14b6230bccf69
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyAmbienceModuleEditor.cs
|
||||
uploadId: 939148
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using DistantLands.Cozy.Data;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyAtmosphereModule))]
|
||||
public class CozyAtmosphereModuleEditor : CozyBiomeModuleEditor
|
||||
{
|
||||
|
||||
CozyAtmosphereModule atmosphereModule;
|
||||
public override ModuleCategory Category => ModuleCategory.atmosphere;
|
||||
public override string ModuleTitle => "Atmosphere";
|
||||
public override string ModuleSubtitle => "Skydome Module";
|
||||
public override string ModuleTooltip => "Manage skydome, fog, and lighting settings.";
|
||||
|
||||
|
||||
public VisualElement ProfileContainer => root.Q<VisualElement>("profile-container");
|
||||
public VisualElement InspectorContainer;
|
||||
VisualElement root;
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (target && target.GetType() == typeof(CozyAtmosphereModule))
|
||||
atmosphereModule = (CozyAtmosphereModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
Button widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.Bind(serializedObject);
|
||||
if (atmosphereModule.atmosphereProfile)
|
||||
status.text = atmosphereModule.atmosphereProfile.name;
|
||||
else
|
||||
status.text = "Please set an atmosphere";
|
||||
widget.Q<Label>("dynamic-status").style.fontSize = 8;
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/atmosphere-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
CozyProfileField<AtmosphereProfile> atmosphereProfile = new CozyProfileField<AtmosphereProfile>(serializedObject.FindProperty("atmosphereProfile"), (evt) => RefreshInspector());
|
||||
ProfileContainer.Add(atmosphereProfile);
|
||||
|
||||
InspectorContainer = new VisualElement();
|
||||
root.Add(InspectorContainer);
|
||||
|
||||
RefreshInspector();
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void RefreshInspector()
|
||||
{
|
||||
InspectorContainer.Clear();
|
||||
InspectorElement inspector = new InspectorElement(atmosphereModule.atmosphereProfile);
|
||||
inspector.AddToClassList("p-0");
|
||||
InspectorContainer.Add(inspector);
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayBiomeUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
CozyProfileField<AtmosphereProfile> atmosphereProfile = new CozyProfileField<AtmosphereProfile>(serializedObject.FindProperty("atmosphereProfile"));
|
||||
root.Add(atmosphereProfile);
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/atmosphere-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acd1fe65abd37de4b9a3b0b1d4ba301b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyAtmosphereModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,63 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyPureNatureModule))]
|
||||
public class CozyPureNatureModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyPureNatureModule module;
|
||||
public override ModuleCategory Category => ModuleCategory.integration;
|
||||
public override string ModuleTitle => "Pure Nature";
|
||||
public override string ModuleSubtitle => "Pure Nature 2 Integration";
|
||||
public override string ModuleTooltip => "Directly integrate with Pure Nature 2 by BK.";
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("current-settings-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
module = (CozyPureNatureModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = "Integrated";
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/pure-nature-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
root.Bind(serializedObject);
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/pure-nature-2-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a286107f677c1254ca869b30efd92a47
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyBKModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Reflection;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
public class CozyBiomeModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
public virtual VisualElement DisplayBiomeUI()
|
||||
{
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9f39c65124d7d642b26d0834b8047bc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyBiomeModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,97 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyButoModule))]
|
||||
public class CozyButoModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyButoModule butoModule;
|
||||
public override ModuleCategory Category => ModuleCategory.integration;
|
||||
public override string ModuleTitle => "Buto";
|
||||
public override string ModuleSubtitle => "Buto Integration";
|
||||
public override string ModuleTooltip => "Directly integrate with Buto by OccaSoftware.";
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("settings-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
butoModule = (CozyButoModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
#if BUTO
|
||||
status.text = "Buto recognized";
|
||||
#else
|
||||
status.text = "Buto not installed";
|
||||
#endif
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/buto-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
#if BUTO
|
||||
if (serializedObject.FindProperty("fog").objectReferenceValue == null)
|
||||
{
|
||||
HelpBox fogWarning = new HelpBox("Could not find any instance of Buto in your scene! You will have to set the profile manually in the module settings.", HelpBoxMessageType.Warning);
|
||||
Container.Add(fogWarning);
|
||||
}
|
||||
|
||||
Container.Add(new VisualElement { style = { height = 20 } });
|
||||
|
||||
if (serializedObject.FindProperty("volumeProfile").objectReferenceValue == null)
|
||||
{
|
||||
PropertyField volumeProfile = new PropertyField();
|
||||
volumeProfile.BindProperty(serializedObject.FindProperty("volumeProfile"));
|
||||
Container.Add(volumeProfile);
|
||||
}
|
||||
|
||||
PropertyField fogBrightnessMultiplier = new PropertyField();
|
||||
fogBrightnessMultiplier.BindProperty(serializedObject.FindProperty("fogBrightnessMultiplier"));
|
||||
Container.Add(fogBrightnessMultiplier);
|
||||
|
||||
PropertyField fogDensityMultiplier = new PropertyField();
|
||||
fogDensityMultiplier.BindProperty(serializedObject.FindProperty("fogDensityMultiplier"));
|
||||
Container.Add(fogDensityMultiplier);
|
||||
|
||||
|
||||
#else
|
||||
HelpBox butoWarning = new HelpBox("Buto Volumetric Fog is not currently in this project! Please make sure that it has been properly downloaded before using this module.", HelpBoxMessageType.Warning);
|
||||
Container.Add(butoWarning);
|
||||
#endif
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/buto-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ca4f13fea79fe6439ead46538c48ece
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyButoModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,215 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using DistantLands.Cozy.Data;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyClimateModule))]
|
||||
public class CozyClimateModuleEditor : CozyBiomeModuleEditor
|
||||
{
|
||||
|
||||
CozyClimateModule climateModule;
|
||||
public override ModuleCategory Category => ModuleCategory.ecosystem;
|
||||
public override string ModuleTitle => "Climate";
|
||||
public override string ModuleSubtitle => "Ecosystem Control Module";
|
||||
public override string ModuleTooltip => "Control temperature and humidity.";
|
||||
|
||||
public VisualElement ProfileContainer => root.Q<VisualElement>("profile-container");
|
||||
public VisualElement PrecipitationContainer => root.Q<VisualElement>("precipitation-container");
|
||||
public VisualElement CurrentTemperatureWidget => root.Q<VisualElement>("current-temperature-widget");
|
||||
public VisualElement CurrentHumidityWidget => root.Q<VisualElement>("current-humidity-widget");
|
||||
|
||||
VisualElement root;
|
||||
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (target)
|
||||
climateModule = (CozyClimateModule)target;
|
||||
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
Button widget = LargeWidget();
|
||||
|
||||
string fuzzyTemp = "Mild";
|
||||
string fuzzyHumidity = "";
|
||||
|
||||
if (climateModule.currentTemperature < 25)
|
||||
fuzzyTemp = "Cold";
|
||||
else if (climateModule.currentTemperature < 50)
|
||||
fuzzyTemp = "Cool";
|
||||
else if (climateModule.currentTemperature > 100)
|
||||
fuzzyTemp = "Hot";
|
||||
else if (climateModule.currentTemperature > 75)
|
||||
fuzzyTemp = "Warm";
|
||||
|
||||
if (climateModule.currentPrecipitation < 30)
|
||||
fuzzyHumidity = "and dry";
|
||||
else if (climateModule.currentPrecipitation > 70)
|
||||
fuzzyHumidity = "and wet";
|
||||
|
||||
widget.Bind(serializedObject);
|
||||
|
||||
widget.Q<Label>("dynamic-status").text = $"{fuzzyTemp} {fuzzyHumidity}";
|
||||
widget.Q<VisualElement>("lower-container").Add(new Label()
|
||||
{
|
||||
text = $"Temperature: {Mathf.Round(serializedObject.FindProperty("currentTemperature").floatValue)}°F"
|
||||
});
|
||||
widget.Q<VisualElement>("lower-container").Add(new Label()
|
||||
{
|
||||
text = $"Humidity: {Mathf.Round(climateModule.currentPrecipitation)}%"
|
||||
});
|
||||
widget.Q<VisualElement>("lower-container").Add(new Label()
|
||||
{
|
||||
text = climateModule.currentTemperature <= 32 ? $"Snow Amount: {Mathf.Round(climateModule.snowAmount * 10) / 10}" : $"Wetness: {Mathf.Round(climateModule.groundwaterAmount * 10) / 10}"
|
||||
});
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayBiomeUI()
|
||||
{
|
||||
|
||||
root = new VisualElement();
|
||||
|
||||
CozyProfileField<ClimateProfile> profile = new CozyProfileField<ClimateProfile>(serializedObject.FindProperty("climateProfile"));
|
||||
root.Add(profile);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/climate-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
UpdateTemperatureWidget();
|
||||
UpdateHumidityWidget();
|
||||
|
||||
PropertyField controlMethodElement = new PropertyField();
|
||||
controlMethodElement.BindProperty(serializedObject.FindProperty("controlMethod"));
|
||||
ProfileContainer.Add(controlMethodElement);
|
||||
|
||||
CozyProfileField<ClimateProfile> profile = new CozyProfileField<ClimateProfile>(serializedObject.FindProperty("climateProfile"));
|
||||
profile.style.display = serializedObject.FindProperty("controlMethod").intValue == 0 ? DisplayStyle.None : DisplayStyle.Flex;
|
||||
|
||||
VisualElement nativeSettingsContainer = new VisualElement();
|
||||
nativeSettingsContainer.style.display = serializedObject.FindProperty("controlMethod").intValue == 0 ? DisplayStyle.Flex : DisplayStyle.None;
|
||||
|
||||
PropertyField currentTemperatureElement = new PropertyField();
|
||||
currentTemperatureElement.BindProperty(serializedObject.FindProperty("currentTemperature"));
|
||||
currentTemperatureElement.RegisterCallback<ChangeEvent<float>>((ChangeEvent<float> evt) =>
|
||||
{
|
||||
UpdateTemperatureWidget();
|
||||
});
|
||||
nativeSettingsContainer.Add(currentTemperatureElement);
|
||||
|
||||
PropertyField currentHumidityElement = new PropertyField
|
||||
{
|
||||
label = "Current Humidity"
|
||||
};
|
||||
currentHumidityElement.BindProperty(serializedObject.FindProperty("currentPrecipitation"));
|
||||
currentHumidityElement.RegisterCallback<ChangeEvent<float>>((ChangeEvent<float> evt) =>
|
||||
{
|
||||
UpdateHumidityWidget();
|
||||
});
|
||||
nativeSettingsContainer.Add(currentHumidityElement);
|
||||
|
||||
ProfileContainer.Add(profile);
|
||||
ProfileContainer.Add(nativeSettingsContainer);
|
||||
|
||||
|
||||
PropertyField snowAmountElement = new PropertyField();
|
||||
snowAmountElement.BindProperty(serializedObject.FindProperty("snowAmount"));
|
||||
PrecipitationContainer.Add(snowAmountElement);
|
||||
|
||||
PropertyField snowMeltElement = new PropertyField();
|
||||
snowMeltElement.BindProperty(serializedObject.FindProperty("snowMeltSpeed"));
|
||||
PrecipitationContainer.Add(snowMeltElement);
|
||||
|
||||
PropertyField groundwaterAmountElement = new PropertyField();
|
||||
groundwaterAmountElement.BindProperty(serializedObject.FindProperty("groundwaterAmount"));
|
||||
PrecipitationContainer.Add(groundwaterAmountElement);
|
||||
|
||||
PropertyField dryingSpeedElement = new PropertyField();
|
||||
dryingSpeedElement.BindProperty(serializedObject.FindProperty("dryingSpeed"));
|
||||
PrecipitationContainer.Add(dryingSpeedElement);
|
||||
|
||||
|
||||
InspectorElement inspector = new InspectorElement(climateModule.climateProfile);
|
||||
inspector.style.display = serializedObject.FindProperty("controlMethod").intValue == 0 ? DisplayStyle.None : DisplayStyle.Flex;
|
||||
inspector.AddToClassList("p-0");
|
||||
root.Add(inspector);
|
||||
inspector.RegisterCallback<PointerMoveEvent>((PointerMoveEvent) =>
|
||||
{
|
||||
|
||||
});
|
||||
|
||||
controlMethodElement.RegisterCallback<ChangeEvent<string>>((ChangeEvent<string> evt) =>
|
||||
{
|
||||
inspector.style.display = serializedObject.FindProperty("controlMethod").intValue == 0 ? DisplayStyle.None : DisplayStyle.Flex;
|
||||
profile.style.display = serializedObject.FindProperty("controlMethod").intValue == 0 ? DisplayStyle.None : DisplayStyle.Flex;
|
||||
nativeSettingsContainer.style.display = serializedObject.FindProperty("controlMethod").intValue == 0 ? DisplayStyle.Flex : DisplayStyle.None;
|
||||
});
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void UpdateTemperatureWidget()
|
||||
{
|
||||
CurrentTemperatureWidget.Q<Label>("value").text = $"Temperature: {Mathf.Round(climateModule.currentTemperature)}°F";
|
||||
CurrentTemperatureWidget.Q<VisualElement>("graph").Clear();
|
||||
CurrentTemperatureWidget.Q<VisualElement>("graph").Add(DrawLineGraph(ClimateProfileEditor.temperatureGradient, Mathf.Clamp01(climateModule.currentTemperature / 100)));
|
||||
}
|
||||
public void UpdateHumidityWidget()
|
||||
{
|
||||
CurrentHumidityWidget.Q<Label>("value").text = $"Humidity: {Mathf.Round(climateModule.currentPrecipitation)}%";
|
||||
CurrentHumidityWidget.Q<VisualElement>("graph").Clear();
|
||||
CurrentHumidityWidget.Q<VisualElement>("graph").Add(DrawLineGraph(ClimateProfileEditor.humidityGradient, Mathf.Clamp01(climateModule.currentPrecipitation / 100)));
|
||||
}
|
||||
|
||||
public VisualElement DrawLineGraph(Gradient gradient, float currentValue)
|
||||
{
|
||||
VisualElement element = new VisualElement();
|
||||
element.AddToClassList("graph-section");
|
||||
|
||||
element.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = element.contentRect.width;
|
||||
float height = element.contentRect.height;
|
||||
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.lineWidth = 8;
|
||||
painter.strokeGradient = gradient;
|
||||
painter.lineCap = LineCap.Round;
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(0, height * 0.5f));
|
||||
painter.LineTo(new Vector2(width, height * 0.5f));
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.strokeColor = Color.white;
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width * currentValue, height * 0.5f), 1, 0, 360, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
};
|
||||
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0b219e89cf3cb84894ffae80fa89155
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyClimateModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,83 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyDebugModule))]
|
||||
public class CozyDebugModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyDebugModule debugModule;
|
||||
public override ModuleCategory Category => ModuleCategory.utility;
|
||||
public override string ModuleTitle => "Debug";
|
||||
public override string ModuleSubtitle => "System Debug Helper";
|
||||
public override string ModuleTooltip => "Aids in debugging and testing the COZY system.";
|
||||
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("current-settings-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
debugModule = (CozyDebugModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = "Debug all modules";
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
foreach (CozyModuleEditor module in weatherEditor.moduleEditors)
|
||||
{
|
||||
Label label = new Label(module.ModuleTitle);
|
||||
label.AddToClassList("h1");
|
||||
Label desc = new Label(module.ModuleSubtitle);
|
||||
desc.AddToClassList("h2");
|
||||
|
||||
|
||||
|
||||
IMGUIContainer container = new IMGUIContainer();
|
||||
container.onGUIHandler += () =>
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.Space(10);
|
||||
module.GetDebugInformation();
|
||||
EditorGUILayout.Space(10);
|
||||
EditorGUI.indentLevel--;
|
||||
};
|
||||
container.AddToClassList("section-bg");
|
||||
|
||||
root.Add(label);
|
||||
root.Add(desc);
|
||||
root.Add(container);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/debug-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e483bd9b6cece1448fe8d797fd878cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyDebugModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,195 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyEventModule))]
|
||||
public class CozyEventModuleEditor : CozyBiomeModuleEditor
|
||||
{
|
||||
|
||||
CozyEventModule eventModule;
|
||||
public override ModuleCategory Category => ModuleCategory.utility;
|
||||
public override string ModuleTitle => "Events";
|
||||
public override string ModuleSubtitle => "Correlation Module";
|
||||
public override string ModuleTooltip => "Setup Unity events that directly integrate into the COZY system.";
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("current-settings-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
SerializedProperty onDawn;
|
||||
SerializedProperty onMorning;
|
||||
SerializedProperty onDay;
|
||||
SerializedProperty onAfternoon;
|
||||
SerializedProperty onEvening;
|
||||
SerializedProperty onTwilight;
|
||||
SerializedProperty onNight;
|
||||
SerializedProperty onNewMinute;
|
||||
SerializedProperty onNewHour;
|
||||
SerializedProperty onNewDay;
|
||||
SerializedProperty onNewYear;
|
||||
SerializedProperty onWeatherProfileChange;
|
||||
SerializedProperty cozyEvents;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
eventModule = (CozyEventModule)target;
|
||||
|
||||
onDawn = serializedObject.FindProperty("onDawn");
|
||||
onMorning = serializedObject.FindProperty("onMorning");
|
||||
onDay = serializedObject.FindProperty("onDay");
|
||||
onAfternoon = serializedObject.FindProperty("onAfternoon");
|
||||
onEvening = serializedObject.FindProperty("onEvening");
|
||||
onTwilight = serializedObject.FindProperty("onTwilight");
|
||||
onNight = serializedObject.FindProperty("onNight");
|
||||
onNewMinute = serializedObject.FindProperty("onNewMinute");
|
||||
onNewHour = serializedObject.FindProperty("onNewHour");
|
||||
onNewDay = serializedObject.FindProperty("onNewDay");
|
||||
onNewYear = serializedObject.FindProperty("onNewYear");
|
||||
onWeatherProfileChange = serializedObject.FindProperty("onWeatherProfileChange");
|
||||
cozyEvents = serializedObject.FindProperty("cozyEvents");
|
||||
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = "";
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
|
||||
Label timeBlocksTitle = new Label()
|
||||
{
|
||||
text = "Time Blocks"
|
||||
};
|
||||
timeBlocksTitle.AddToClassList("h1");
|
||||
root.Add(timeBlocksTitle);
|
||||
|
||||
VisualElement timeBlocksCategory = new VisualElement();
|
||||
timeBlocksCategory.AddToClassList("section-bg");
|
||||
|
||||
PropertyField dawnProperty = new PropertyField();
|
||||
dawnProperty.BindProperty(onDawn);
|
||||
timeBlocksCategory.Add(dawnProperty);
|
||||
|
||||
PropertyField morningProperty = new PropertyField();
|
||||
morningProperty.BindProperty(onMorning);
|
||||
timeBlocksCategory.Add(morningProperty);
|
||||
|
||||
PropertyField dayProperty = new PropertyField();
|
||||
dayProperty.BindProperty(onDay);
|
||||
timeBlocksCategory.Add(dayProperty);
|
||||
|
||||
PropertyField afternoonProperty = new PropertyField();
|
||||
afternoonProperty.BindProperty(onAfternoon);
|
||||
timeBlocksCategory.Add(afternoonProperty);
|
||||
|
||||
PropertyField eveningProperty = new PropertyField();
|
||||
eveningProperty.BindProperty(onEvening);
|
||||
timeBlocksCategory.Add(eveningProperty);
|
||||
|
||||
PropertyField twilightProperty = new PropertyField();
|
||||
twilightProperty.BindProperty(onTwilight);
|
||||
timeBlocksCategory.Add(twilightProperty);
|
||||
|
||||
PropertyField nightProperty = new PropertyField();
|
||||
nightProperty.BindProperty(onNight);
|
||||
timeBlocksCategory.Add(nightProperty);
|
||||
|
||||
root.Add(timeBlocksCategory);
|
||||
|
||||
Label timeElapsedTitle = new Label()
|
||||
{
|
||||
text = "Time Elapsed Events"
|
||||
};
|
||||
timeElapsedTitle.AddToClassList("h1");
|
||||
root.Add(timeElapsedTitle);
|
||||
|
||||
VisualElement timeElapsedCategory = new VisualElement();
|
||||
timeElapsedCategory.AddToClassList("section-bg");
|
||||
|
||||
PropertyField newMinuteProperty = new PropertyField();
|
||||
newMinuteProperty.BindProperty(onNewMinute);
|
||||
timeElapsedCategory.Add(newMinuteProperty);
|
||||
|
||||
PropertyField newHourProperty = new PropertyField();
|
||||
newHourProperty.BindProperty(onNewHour);
|
||||
timeElapsedCategory.Add(newHourProperty);
|
||||
|
||||
PropertyField newDayProperty = new PropertyField();
|
||||
newDayProperty.BindProperty(onNewDay);
|
||||
timeElapsedCategory.Add(newDayProperty);
|
||||
|
||||
PropertyField newYearProperty = new PropertyField();
|
||||
newYearProperty.BindProperty(onNewYear);
|
||||
timeElapsedCategory.Add(newYearProperty);
|
||||
|
||||
root.Add(timeElapsedCategory);
|
||||
|
||||
Label weatherTitle = new Label()
|
||||
{
|
||||
text = "Weather Events"
|
||||
};
|
||||
weatherTitle.AddToClassList("h1");
|
||||
root.Add(weatherTitle);
|
||||
|
||||
VisualElement weatherEventsCategory = new VisualElement();
|
||||
weatherEventsCategory.AddToClassList("section-bg");
|
||||
|
||||
|
||||
PropertyField weatherProfileChangeProperty = new PropertyField();
|
||||
weatherProfileChangeProperty.BindProperty(onWeatherProfileChange);
|
||||
weatherEventsCategory.Add(weatherProfileChangeProperty);
|
||||
|
||||
PropertyField cozyEventsProperty = new PropertyField();
|
||||
cozyEventsProperty.BindProperty(cozyEvents);
|
||||
weatherEventsCategory.Add(cozyEventsProperty);
|
||||
|
||||
root.Add(weatherEventsCategory);
|
||||
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override VisualElement DisplayBiomeUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
PropertyField onEnterBiome = new PropertyField();
|
||||
onEnterBiome.BindProperty(serializedObject.FindProperty("onEnterBiome"));
|
||||
root.Add(onEnterBiome);
|
||||
|
||||
PropertyField whileInBiome = new PropertyField();
|
||||
whileInBiome.BindProperty(serializedObject.FindProperty("whileInBiome"));
|
||||
root.Add(whileInBiome);
|
||||
|
||||
PropertyField onExitBiome = new PropertyField();
|
||||
onExitBiome.BindProperty(serializedObject.FindProperty("onExitBiome"));
|
||||
root.Add(onExitBiome);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/events-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e8bf7cd51892d94f950c1af69b23bd3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyEventModuleEditor.cs
|
||||
uploadId: 939148
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using DistantLands.Cozy.Data;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyInteractionsModule))]
|
||||
public class CozyInteractionsModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyInteractionsModule interactionsModule;
|
||||
public override ModuleCategory Category => ModuleCategory.ecosystem;
|
||||
public override string ModuleTitle => "Interactions";
|
||||
public override string ModuleSubtitle => "Global Modification Module";
|
||||
public override string ModuleTooltip => "Modifies and transforms the world based on the COZY system.";
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("profile-container");
|
||||
public VisualElement ProfileUIContainer => root.Q<VisualElement>("profile-ui");
|
||||
SerializedProperty profile;
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
interactionsModule = (CozyInteractionsModule)target;
|
||||
profile = serializedObject.FindProperty("profile");
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = $"{interactionsModule.profile.modulatedValues.Length} Values";
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/interactions-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
PropertyField profileField = new PropertyField();
|
||||
profileField.BindProperty(profile);
|
||||
profileField.RegisterCallback<ChangeEvent<MaterialManagerProfile>>((ChangeEvent<MaterialManagerProfile> evt) =>
|
||||
{
|
||||
RefreshProfileUI();
|
||||
});
|
||||
Container.Add(profileField);
|
||||
|
||||
RefreshProfileUI();
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void RefreshProfileUI()
|
||||
{
|
||||
ProfileUIContainer.Clear();
|
||||
|
||||
if (interactionsModule.profile)
|
||||
ProfileUIContainer.Add(new InspectorElement(interactionsModule.profile));
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/interactions-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5ace4b4e77328b4b95394bbecf35688
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyInteractionsModuleEditor.cs
|
||||
uploadId: 939148
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyMicrosplatModule))]
|
||||
public class CozyMicrosplatModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyMicrosplatModule microsplatModule;
|
||||
public override ModuleCategory Category => ModuleCategory.integration;
|
||||
public override string ModuleTitle => "MicroSplat";
|
||||
public override string ModuleSubtitle => "MicroSplat Integration";
|
||||
public override string ModuleTooltip => "Directly integrate with MicroSplat by Jason Booth.";
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("settings-container");
|
||||
public VisualElement UpdateContainer => root.Q<VisualElement>("update-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
microsplatModule = (CozyMicrosplatModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = "";
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/microsplat-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
PropertyField updateWetness = new PropertyField();
|
||||
updateWetness.BindProperty(serializedObject.FindProperty("updateWetness"));
|
||||
Container.Add(updateWetness);
|
||||
|
||||
VisualElement paddedContainer = new VisualElement();
|
||||
paddedContainer.AddToClassList("pl-4");
|
||||
|
||||
PropertyField minWetness = new PropertyField();
|
||||
minWetness.BindProperty(serializedObject.FindProperty("minWetness"));
|
||||
paddedContainer.Add(minWetness);
|
||||
|
||||
PropertyField maxWetness = new PropertyField();
|
||||
maxWetness.BindProperty(serializedObject.FindProperty("maxWetness"));
|
||||
paddedContainer.Add(maxWetness);
|
||||
|
||||
Container.Add(paddedContainer);
|
||||
|
||||
PropertyField updateRainRipples = new PropertyField();
|
||||
updateRainRipples.BindProperty(serializedObject.FindProperty("updateRainRipples"));
|
||||
Container.Add(updateRainRipples);
|
||||
|
||||
PropertyField updatePuddles = new PropertyField();
|
||||
updatePuddles.BindProperty(serializedObject.FindProperty("updatePuddles"));
|
||||
Container.Add(updatePuddles);
|
||||
|
||||
PropertyField updateStreams = new PropertyField();
|
||||
updateStreams.BindProperty(serializedObject.FindProperty("updateStreams"));
|
||||
Container.Add(updateStreams);
|
||||
|
||||
PropertyField updateSnow = new PropertyField();
|
||||
updateSnow.BindProperty(serializedObject.FindProperty("updateSnow"));
|
||||
Container.Add(updateSnow);
|
||||
|
||||
PropertyField updateWindStrength = new PropertyField();
|
||||
updateWindStrength.BindProperty(serializedObject.FindProperty("updateWindStrength"));
|
||||
Container.Add(updateWindStrength);
|
||||
|
||||
PropertyField updateFrequency = new PropertyField();
|
||||
updateFrequency.BindProperty(serializedObject.FindProperty("updateFrequency"));
|
||||
UpdateContainer.Add(updateFrequency);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/microsplat-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 000fdcd3391288147b24b6acf4b92830
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyMicrosplatModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,200 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Reflection;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyModule))]
|
||||
public class CozyModuleEditor : Editor
|
||||
{
|
||||
|
||||
public virtual string ModuleTitle => "Custom Control";
|
||||
public virtual string ModuleTooltip => "Extend this class to create your own custom modules";
|
||||
public virtual string ModuleSubtitle => "User Generated COZY Module";
|
||||
public Texture2D ModuleIcon => Resources.Load<Texture2D>($"Icons/Modules/{ModuleTitle}");
|
||||
public Texture2D BannerBackground => Resources.Load<Texture2D>($"Banners/{ModuleTitle}");
|
||||
|
||||
public CozyWeatherEditor weatherEditor;
|
||||
|
||||
public enum ModuleCategory
|
||||
{
|
||||
atmosphere,
|
||||
time,
|
||||
ecosystem,
|
||||
utility,
|
||||
survival,
|
||||
integration,
|
||||
other
|
||||
}
|
||||
|
||||
public virtual ModuleCategory Category => ModuleCategory.other;
|
||||
|
||||
|
||||
public virtual void GetDebugInformation()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
SerializedProperty iterator = serializedObject.GetIterator();
|
||||
iterator.NextVisible(true);
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (iterator == null)
|
||||
break;
|
||||
|
||||
EditorGUILayout.PropertyField(iterator, true);
|
||||
if (iterator.hasChildren)
|
||||
{
|
||||
if (!iterator.NextVisible(false))
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!iterator.NextVisible(true))
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
public virtual void GetReportsInformation()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void RemoveModule()
|
||||
{
|
||||
CozyWeather.instance.DeintitializeModule((CozyModule)target);
|
||||
weatherEditor.RepaintUI();
|
||||
}
|
||||
|
||||
public void ResetModule()
|
||||
{
|
||||
CozyWeather.instance.ResetModule((CozyModule)target);
|
||||
}
|
||||
|
||||
public void EditScript()
|
||||
{
|
||||
MonoScript script = MonoScript.FromMonoBehaviour((MonoBehaviour)target);
|
||||
AssetDatabase.OpenAsset(script, 1);
|
||||
}
|
||||
|
||||
public void OpenContextMenu()
|
||||
{
|
||||
|
||||
GenericMenu menu = new GenericMenu();
|
||||
AddContextMenuItems(menu);
|
||||
menu.AddItem(new GUIContent("Documentation"), false, OpenDocumentationURL);
|
||||
menu.AddSeparator("");
|
||||
menu.AddItem(new GUIContent("Reset"), false, ResetModule);
|
||||
menu.AddItem(new GUIContent("Remove Module"), false, RemoveModule);
|
||||
menu.AddItem(new GUIContent("Edit Script"), false, EditScript);
|
||||
|
||||
menu.ShowAsContext();
|
||||
|
||||
}
|
||||
|
||||
public virtual void AddContextMenuItems(GenericMenu menu)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual Button DisplayWidget()
|
||||
{
|
||||
return SmallWidget();
|
||||
}
|
||||
|
||||
public Button SmallWidget()
|
||||
{
|
||||
VisualElement root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Components/UXML/small-widget.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
Button widget = root.Q<Button>("widget-button");
|
||||
widget.AddToClassList("module-widget");
|
||||
widget.RegisterCallback<ClickEvent>(OpenModuleUI);
|
||||
widget.RegisterCallback<ContextClickEvent>((ContextClickEvent) => { OpenContextMenu(); });
|
||||
widget.tooltip = ModuleTooltip;
|
||||
|
||||
Image icon = new Image
|
||||
{
|
||||
image = ModuleIcon,
|
||||
name = "icon"
|
||||
};
|
||||
|
||||
widget.Q("icon").Add(icon);
|
||||
|
||||
Label title = widget.Q<Label>("title");
|
||||
title.text = ModuleTitle;
|
||||
title.tooltip = ModuleTooltip;
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
public Button LargeWidget()
|
||||
{
|
||||
VisualElement root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Components/UXML/large-widget.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
Button widget = root.Q<Button>("widget-button");
|
||||
widget.AddToClassList("module-widget");
|
||||
widget.RegisterCallback<ClickEvent>(OpenModuleUI);
|
||||
widget.RegisterCallback<ContextClickEvent>((ContextClickEvent) => { OpenContextMenu(); });
|
||||
widget.tooltip = ModuleTooltip;
|
||||
|
||||
Image icon = new Image
|
||||
{
|
||||
image = ModuleIcon,
|
||||
name = "icon"
|
||||
};
|
||||
|
||||
widget.Q("icon").Add(icon);
|
||||
|
||||
Label title = widget.Q<Label>("title");
|
||||
title.text = ModuleTitle;
|
||||
title.tooltip = ModuleTooltip;
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
public virtual VisualElement DisplayUI()
|
||||
{
|
||||
VisualElement root = new VisualElement();
|
||||
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void OpenModuleUI(ClickEvent evt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07eab9f21db5d654a9ddf7d70c17eb42
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyModuleEditor.cs
|
||||
uploadId: 939148
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyReflectionsModule))]
|
||||
public class CozyReflectionsModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyReflectionsModule module;
|
||||
public override ModuleCategory Category => ModuleCategory.atmosphere;
|
||||
public override string ModuleTitle => "Reflection";
|
||||
public override string ModuleSubtitle => "Probe Management Module";
|
||||
public override string ModuleTooltip => "Sets up a cubemap for reflections with COZY.";
|
||||
|
||||
|
||||
public VisualElement UpdateContainer => root.Q<VisualElement>("update");
|
||||
public VisualElement RenderingContainer => root.Q<VisualElement>("rendering");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
module = (CozyReflectionsModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
switch (module.updateFrequency)
|
||||
{
|
||||
case CozyReflectionsModule.UpdateFrequency.everyFrame:
|
||||
status.text = "Every Frame";
|
||||
break;
|
||||
case CozyReflectionsModule.UpdateFrequency.onAwake:
|
||||
status.text = "On Awake";
|
||||
break;
|
||||
case CozyReflectionsModule.UpdateFrequency.onHour:
|
||||
status.text = "Every Hour";
|
||||
break;
|
||||
case CozyReflectionsModule.UpdateFrequency.viaScripting:
|
||||
status.text = "Stand by";
|
||||
break;
|
||||
}
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/reflections-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
PropertyField framesBetweenRenders = new PropertyField();
|
||||
|
||||
PropertyField updateFrequency = new PropertyField();
|
||||
updateFrequency.BindProperty(serializedObject.FindProperty("updateFrequency"));
|
||||
updateFrequency.RegisterCallback<ChangeEvent<CozyReflectionsModule.UpdateFrequency>>((ChangeEvent<CozyReflectionsModule.UpdateFrequency> evt) =>
|
||||
{
|
||||
if (evt.newValue == CozyReflectionsModule.UpdateFrequency.everyFrame)
|
||||
framesBetweenRenders.SetEnabled(true);
|
||||
else
|
||||
framesBetweenRenders.SetEnabled(false);
|
||||
});
|
||||
UpdateContainer.Add(updateFrequency);
|
||||
|
||||
framesBetweenRenders.AddToClassList("pl-4");
|
||||
framesBetweenRenders.BindProperty(serializedObject.FindProperty("framesBetweenRenders"));
|
||||
UpdateContainer.Add(framesBetweenRenders);
|
||||
|
||||
PropertyField refreshOnSceneChange = new PropertyField();
|
||||
refreshOnSceneChange.BindProperty(serializedObject.FindProperty("refreshOnSceneChange"));
|
||||
UpdateContainer.Add(refreshOnSceneChange);
|
||||
|
||||
|
||||
PropertyField reflectionCubemap = new PropertyField();
|
||||
reflectionCubemap.BindProperty(serializedObject.FindProperty("reflectionCubemap"));
|
||||
reflectionCubemap.AddToClassList("mb-md");
|
||||
RenderingContainer.Add(reflectionCubemap);
|
||||
|
||||
PropertyField layerMask = new PropertyField();
|
||||
layerMask.BindProperty(serializedObject.FindProperty("layerMask"));
|
||||
RenderingContainer.Add(layerMask);
|
||||
|
||||
PropertyField automaticallySetLayer = new PropertyField();
|
||||
automaticallySetLayer.BindProperty(serializedObject.FindProperty("automaticallySetLayer"));
|
||||
automaticallySetLayer.AddToClassList("mb-md");
|
||||
RenderingContainer.Add(automaticallySetLayer);
|
||||
|
||||
#if COZY_URP
|
||||
PropertyField rendererOverride = new PropertyField();
|
||||
rendererOverride.BindProperty(serializedObject.FindProperty("rendererOverride"));
|
||||
RenderingContainer.Add(rendererOverride);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
PopupField<string> qLevel = new PopupField<string>("Minimum Quality Level", QualitySettings.names.ToList(), module.minimumQualityLevel);
|
||||
qLevel.RegisterValueChangedCallback((ChangeEvent<string> evt) =>
|
||||
{
|
||||
module.minimumQualityLevel = QualitySettings.names.ToList().IndexOf(evt.newValue);
|
||||
});
|
||||
qLevel.AddToClassList("unity-base-field__aligned");
|
||||
RenderingContainer.Add(qLevel);
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/reflections-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de5fbf4ca36fd464281878d39c719ac3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyReflectionsModuleEditor.cs
|
||||
uploadId: 939148
|
||||
+268
@@ -0,0 +1,268 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using DistantLands.Cozy.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozySatelliteModule))]
|
||||
public class CozySatelliteModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozySatelliteModule satelliteModule;
|
||||
public override ModuleCategory Category => ModuleCategory.atmosphere;
|
||||
public override string ModuleTitle => "Satellite";
|
||||
public override string ModuleSubtitle => "Moon Module";
|
||||
public override string ModuleTooltip => "Manage satellites and moons within the COZY system.";
|
||||
|
||||
public VisualElement CurrentSatellitesContainer => root.Q<VisualElement>("current-satellites-container");
|
||||
public VisualElement SatellitesContainer => root.Q<VisualElement>("satellite-inspector-container");
|
||||
public VisualElement SatelliteGraph => root.Q<VisualElement>("satellite-graph");
|
||||
public VisualElement OrbitGraph => root.Q<VisualElement>("orbit-graph");
|
||||
public VisualElement OrbitGraphKey => root.Q<VisualElement>("orbit-graph-key");
|
||||
public VisualElement MoonPhaseGraph => root.Q<VisualElement>("moon-phase-graph");
|
||||
public VisualElement PhaseGraph => root.Q<VisualElement>("moon-graph");
|
||||
public Label MoonName => root.Q<Label>("moon-name");
|
||||
public Label PhaseName => root.Q<Label>("phase-name");
|
||||
public Label PhaseTime => root.Q<Label>("phase-time");
|
||||
public Label Illumination => root.Q<Label>("illumination");
|
||||
public Label Declination => root.Q<Label>("declination");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
static Gradient OrbitColors = new Gradient()
|
||||
{
|
||||
colorKeys = new GradientColorKey[5] {
|
||||
new GradientColorKey(Branding.deepBlue,0),
|
||||
new GradientColorKey(Branding.red,0.25f),
|
||||
new GradientColorKey(Branding.blue,0.5f),
|
||||
new GradientColorKey(Branding.green,0.75f),
|
||||
new GradientColorKey(Branding.charcoal,1)
|
||||
}
|
||||
};
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
satelliteModule = (CozySatelliteModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
|
||||
status.text = satelliteModule.GetMoonPhaseName();
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/satellite-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
root.RegisterCallback((PointerMoveEvent evt) =>
|
||||
{
|
||||
RefreshPhaseGraph();
|
||||
RefreshOrbitGraph();
|
||||
});
|
||||
|
||||
|
||||
RefreshPhaseGraph();
|
||||
RefreshOrbitGraph();
|
||||
RefreshSatelliteList();
|
||||
|
||||
PropertyField satellites = new PropertyField();
|
||||
satellites.BindProperty(serializedObject.FindProperty("satellites"));
|
||||
satellites.RegisterCallback<ChangeEvent<SatelliteProfile[]>>((ChangeEvent<SatelliteProfile[]> evt) =>
|
||||
{
|
||||
RefreshSatelliteList();
|
||||
});
|
||||
CurrentSatellitesContainer.Add(satellites);
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void RefreshPhaseGraph()
|
||||
{
|
||||
|
||||
if (satelliteModule.satellites.Length == 0)
|
||||
return;
|
||||
|
||||
SatelliteProfile satelliteProfile = satelliteModule.satellites[satelliteModule.mainMoon];
|
||||
float globalDay = satelliteModule.weatherSphere.timeModule.AbsoluteDay - satelliteProfile.rotationPeriodOffset;
|
||||
float cyclePercentage = globalDay % satelliteProfile.rotationPeriod / satelliteProfile.rotationPeriod;
|
||||
float phase = (cyclePercentage - .5f) * 2;
|
||||
// Debug.Log(phase);
|
||||
|
||||
|
||||
Shader.SetGlobalFloat("CZY_UI_MOONPHASE", phase);
|
||||
|
||||
|
||||
PhaseName.text = satelliteProfile.name;
|
||||
MoonName.text = satelliteModule.GetMoonPhaseName();
|
||||
PhaseTime.text = $"{satelliteProfile.rotationPeriod - (satelliteModule.weatherSphere.timeModule.AbsoluteDay + satelliteProfile.rotationPeriodOffset % satelliteProfile.rotationPeriod)} Days for Next Cycle";
|
||||
Illumination.text = $"{Mathf.Round((Vector3.Dot(satelliteModule.weatherSphere.sunTransform.forward, satelliteModule.weatherSphere.moonDirection) + 1) * 50)}% Illumination";
|
||||
|
||||
float dec = satelliteProfile.declination * Mathf.Sin(Mathf.PI * 2 * ((satelliteModule.weatherSphere.modifiedDayPercentage + (float)(satelliteModule.weatherSphere.timeModule.currentDay + satelliteProfile.rotationPeriodOffset + satelliteModule.weatherSphere.timeModule.DaysPerYear * satelliteModule.weatherSphere.timeModule.currentYear) % satelliteProfile.declinationPeriod) / satelliteProfile.declinationPeriod));
|
||||
Declination.text = $"Current Declination of {Mathf.Round(dec)}°";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void RefreshOrbitGraph()
|
||||
{
|
||||
if (satelliteModule.satellites.Length == 0)
|
||||
return;
|
||||
|
||||
OrbitGraphKey.Clear();
|
||||
|
||||
VisualElement infoHolder = new VisualElement();
|
||||
infoHolder.AddToClassList("pl-4");
|
||||
OrbitGraphKey.Add(infoHolder);
|
||||
|
||||
VisualElement sunContainer = new VisualElement();
|
||||
sunContainer.AddToClassList("swatch");
|
||||
|
||||
VisualElement sunSwatch = new VisualElement();
|
||||
sunSwatch.style.backgroundColor = Branding.yellow;
|
||||
sunContainer.Add(sunSwatch);
|
||||
|
||||
Label sunLabel = new Label
|
||||
{
|
||||
text = "Sun"
|
||||
};
|
||||
sunLabel.AddToClassList("font-bold");
|
||||
sunContainer.Add(sunLabel);
|
||||
|
||||
infoHolder.Add(sunContainer);
|
||||
|
||||
for (int i = 0; i < satelliteModule.satellites.Length; i++)
|
||||
{
|
||||
VisualElement container = new VisualElement();
|
||||
container.AddToClassList("swatch");
|
||||
|
||||
VisualElement swatch = new VisualElement();
|
||||
swatch.style.backgroundColor = OrbitColors.Evaluate((float)i / satelliteModule.satellites.Length);
|
||||
container.Add(swatch);
|
||||
|
||||
Label timeLabel = new Label
|
||||
{
|
||||
text = satelliteModule.satellites[i].name
|
||||
};
|
||||
timeLabel.AddToClassList("font-bold");
|
||||
container.Add(timeLabel);
|
||||
|
||||
infoHolder.Add(container);
|
||||
|
||||
}
|
||||
|
||||
OrbitGraph.Clear();
|
||||
|
||||
VisualElement graphHolder = new VisualElement();
|
||||
graphHolder.AddToClassList("graph-section");
|
||||
|
||||
graphHolder.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = graphHolder.contentRect.width;
|
||||
float height = graphHolder.contentRect.height;
|
||||
|
||||
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.lineWidth = 2;
|
||||
painter.strokeColor = Branding.lightGreyAccent;
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(0, height / 2));
|
||||
painter.LineTo(new Vector2(width, height / 2));
|
||||
painter.Stroke();
|
||||
|
||||
painter.lineWidth = 2;
|
||||
painter.strokeColor = Branding.yellow;
|
||||
float sunAngle = satelliteModule.weatherSphere.modifiedDayPercentage * 360 + 90;
|
||||
float sunRadius = height * 0.45f;
|
||||
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2), sunRadius,
|
||||
sunAngle + 7,
|
||||
sunAngle + 353,
|
||||
ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2) + new Vector2(Mathf.Cos(Mathf.Deg2Rad * sunAngle) * sunRadius, Mathf.Sin(Mathf.Deg2Rad * sunAngle) * sunRadius),
|
||||
(2 * Mathf.PI * sunRadius / 360) * 4.5f, 0, 360, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
|
||||
|
||||
for (int i = 0; i < satelliteModule.satellites.Length; i++)
|
||||
{
|
||||
|
||||
SatelliteProfile sat = satelliteModule.satellites[i];
|
||||
|
||||
painter.strokeColor = OrbitColors.Evaluate((float)i / satelliteModule.satellites.Length);
|
||||
float satAngle = 180 + sat.satelliteRotation;
|
||||
|
||||
float satRadius = height * 0.45f - ((i + 1) * 15);
|
||||
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2), satRadius,
|
||||
Mathf.Repeat(satAngle + 7, 360),
|
||||
Mathf.Repeat(satAngle + 353, 360),
|
||||
ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2) + new Vector2(Mathf.Cos(Mathf.Deg2Rad * satAngle) * satRadius, Mathf.Sin(Mathf.Deg2Rad * satAngle) * satRadius),
|
||||
2 * Mathf.PI * satRadius / 360 * 4.5f, 0, 360, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
OrbitGraph.Add(graphHolder);
|
||||
|
||||
}
|
||||
|
||||
public void RefreshSatelliteList()
|
||||
{
|
||||
|
||||
for (int i = 0; i < satelliteModule.satellites.Length; i++)
|
||||
{
|
||||
Label label = new Label();
|
||||
label.text = satelliteModule.satellites[i].name;
|
||||
label.AddToClassList("h2");
|
||||
SatellitesContainer.Add(label);
|
||||
|
||||
VisualElement container = new VisualElement();
|
||||
container.AddToClassList("section-bg");
|
||||
SatellitesContainer.Add(container);
|
||||
|
||||
InspectorElement inspector = new InspectorElement(satelliteModule.satellites[i]);
|
||||
inspector.AddToClassList("p-0");
|
||||
container.Add(inspector);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/satellite-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fd6a69bbd992654cb490531ee1368ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozySatelliteModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,91 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozySaveLoadModule))]
|
||||
public class CozySaveLoadModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozySaveLoadModule saveLoadModule;
|
||||
public override ModuleCategory Category => ModuleCategory.utility;
|
||||
public override string ModuleTitle => "Save & Load";
|
||||
public override string ModuleSubtitle => "Data Management Module";
|
||||
public override string ModuleTooltip => "Manage save and load commands within the COZY system.";
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("current-settings-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
saveLoadModule = (CozySaveLoadModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = "";
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override void AddContextMenuItems(GenericMenu menu)
|
||||
{
|
||||
menu.AddItem(new GUIContent("Save"), false, saveLoadModule.Save);
|
||||
menu.AddItem(new GUIContent("Load"), false, saveLoadModule.Load);
|
||||
menu.AddSeparator("");
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
Label label = new Label("Commands");
|
||||
label.AddToClassList("h1");
|
||||
root.Add(label);
|
||||
|
||||
VisualElement container = new VisualElement();
|
||||
container.AddToClassList("section-bg");
|
||||
PopupField<int> popup = new PopupField<int>("Save Slot", new List<int>() { 0, 1, 2, 3, 4 }, 0);
|
||||
container.Add(popup);
|
||||
|
||||
VisualElement buttonHolder = new VisualElement();
|
||||
// buttonHolder.AddToClassList("flex-row");
|
||||
Button saveButton = new Button();
|
||||
saveButton.text = "Save";
|
||||
saveButton.RegisterCallback<ClickEvent>((ClickEvent) => {
|
||||
saveLoadModule.Save(popup.value);
|
||||
});
|
||||
Button loadButton = new Button();
|
||||
loadButton.text = "Load";
|
||||
loadButton.RegisterCallback<ClickEvent>((ClickEvent) => {
|
||||
saveLoadModule.Load(popup.value);
|
||||
});
|
||||
buttonHolder.Add(saveButton);
|
||||
buttonHolder.Add(loadButton);
|
||||
container.Add(buttonHolder);
|
||||
|
||||
root.Add(container);
|
||||
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/save-and-load-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56b2af6699a4a51418796d46d2c0b240
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozySaveLoadModuleEditor.cs
|
||||
uploadId: 939148
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using DistantLands.Cozy.Data;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(SystemTimeModule))]
|
||||
public class CozySystemTimeModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
SystemTimeModule timeModule;
|
||||
public override ModuleCategory Category => ModuleCategory.time;
|
||||
public override string ModuleTitle => "System Time";
|
||||
public override string ModuleSubtitle => "Time Management Module";
|
||||
public override string ModuleTooltip => "Manage your in-game time in terms of the users system time.";
|
||||
public VisualElement ProfileContainer => root.Q<VisualElement>("profile-container");
|
||||
public VisualElement Container => root.Q<VisualElement>("current-settings-container");
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
timeModule = (SystemTimeModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
Button widget = LargeWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = timeModule.currentTime;
|
||||
VisualElement lowerContainer = widget.Q<VisualElement>("lower-container");
|
||||
|
||||
lowerContainer.Add(new Label()
|
||||
{
|
||||
text = $"Currently it is {timeModule.currentTime.ToString()}"
|
||||
});
|
||||
Label dayYearLabel = new Label()
|
||||
{
|
||||
text = $"Day {timeModule.currentDay} of year {timeModule.currentYear}"
|
||||
};
|
||||
lowerContainer.Add(dayYearLabel);
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/system-time-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
root.Bind(serializedObject);
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void PauseTime(object check)
|
||||
{
|
||||
timeModule.pauseTime = (bool)check;
|
||||
}
|
||||
|
||||
public override void AddContextMenuItems(GenericMenu menu)
|
||||
{
|
||||
menu.AddItem(new GUIContent("Pause Time"), false, PauseTime, true);
|
||||
menu.AddItem(new GUIContent("Unpause Time"), false, PauseTime, false);
|
||||
menu.AddSeparator("");
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/system-time-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9165d65e1a96134ab0d8620d1fdb300
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozySystemTimeModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,164 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyTVEModule))]
|
||||
public class CozyTVEModuleEditor : CozyModuleEditor
|
||||
{
|
||||
CozyTVEModule tveModule;
|
||||
public override ModuleCategory Category => ModuleCategory.integration;
|
||||
public override string ModuleTitle => "TVE";
|
||||
public override string ModuleSubtitle => "The Visual Engine Integration";
|
||||
public override string ModuleTooltip => "Directly integrate with The Visual Engine by Boxophobic.";
|
||||
|
||||
public VisualElement Container => root.Q<VisualElement>("current-settings-container");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
tveModule = (CozyTVEModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
#if THE_VISUAL_ENGINE
|
||||
status.text = "The Visual Engine";
|
||||
#elif THE_VEGETATION_ENGINE
|
||||
status.text = "The Vegetation Engine";
|
||||
#else
|
||||
status.text = "TVE not installed";
|
||||
#endif
|
||||
return widget;
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/tve-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
#if THE_VEGETATION_ENGINE
|
||||
if (!tveModule.globalControl || !tveModule.globalMotion)
|
||||
{
|
||||
HelpBox globalControlWarning = new HelpBox("Make sure that you have active TVE Global Motion and TVE Global Control objects in your scene!", HelpBoxMessageType.Warning);
|
||||
Container.Add(globalControlWarning);
|
||||
return root;
|
||||
}
|
||||
|
||||
PropertyField updateFrequency = new PropertyField();
|
||||
updateFrequency.BindProperty(serializedObject.FindProperty("updateFrequency"));
|
||||
Container.Add(updateFrequency);
|
||||
|
||||
// Add Control Toggle Settings
|
||||
Container.Add(CreateControlsHeader());
|
||||
|
||||
PropertyField enableMotion = new PropertyField();
|
||||
enableMotion.BindProperty(serializedObject.FindProperty("enableMotionControl"));
|
||||
Container.Add(enableMotion);
|
||||
|
||||
PropertyField enableSeason = new PropertyField();
|
||||
enableSeason.BindProperty(serializedObject.FindProperty("enableSeasonControl"));
|
||||
Container.Add(enableSeason);
|
||||
|
||||
PropertyField enableWetness = new PropertyField();
|
||||
enableWetness.BindProperty(serializedObject.FindProperty("enableWetnessControl"));
|
||||
Container.Add(enableWetness);
|
||||
|
||||
PropertyField enableSnow = new PropertyField();
|
||||
enableSnow.BindProperty(serializedObject.FindProperty("enableSnowControl"));
|
||||
Container.Add(enableSnow);
|
||||
|
||||
// Add TVE References
|
||||
Container.Add(CreateReferencesHeader());
|
||||
|
||||
PropertyField globalControl = new PropertyField();
|
||||
globalControl.BindProperty(serializedObject.FindProperty("globalControl"));
|
||||
Container.Add(globalControl);
|
||||
|
||||
PropertyField globalMotion = new PropertyField();
|
||||
globalMotion.BindProperty(serializedObject.FindProperty("globalMotion"));
|
||||
Container.Add(globalMotion);
|
||||
|
||||
#elif THE_VISUAL_ENGINE
|
||||
if (!tveModule.visualManager)
|
||||
{
|
||||
HelpBox globalControlWarning = new HelpBox("Make sure that you have active TVE Visual Manager in your scene!", HelpBoxMessageType.Warning);
|
||||
Container.Add(globalControlWarning);
|
||||
return root;
|
||||
}
|
||||
|
||||
PropertyField updateFrequency = new PropertyField();
|
||||
updateFrequency.BindProperty(serializedObject.FindProperty("updateFrequency"));
|
||||
Container.Add(updateFrequency);
|
||||
|
||||
// Add Control Toggle Settings
|
||||
Container.Add(CreateControlsHeader());
|
||||
|
||||
PropertyField enableMotion = new PropertyField();
|
||||
enableMotion.BindProperty(serializedObject.FindProperty("enableMotionControl"));
|
||||
Container.Add(enableMotion);
|
||||
|
||||
PropertyField enableSeason = new PropertyField();
|
||||
enableSeason.BindProperty(serializedObject.FindProperty("enableSeasonControl"));
|
||||
Container.Add(enableSeason);
|
||||
|
||||
PropertyField enableWetness = new PropertyField();
|
||||
enableWetness.BindProperty(serializedObject.FindProperty("enableWetnessControl"));
|
||||
Container.Add(enableWetness);
|
||||
|
||||
PropertyField enableSnow = new PropertyField();
|
||||
enableSnow.BindProperty(serializedObject.FindProperty("enableSnowControl"));
|
||||
Container.Add(enableSnow);
|
||||
|
||||
// Add TVE References
|
||||
Container.Add(CreateReferencesHeader());
|
||||
|
||||
PropertyField visualManager = new PropertyField();
|
||||
visualManager.BindProperty(serializedObject.FindProperty("visualManager"));
|
||||
Container.Add(visualManager);
|
||||
|
||||
#else
|
||||
HelpBox vegetationEngineWarning = new HelpBox("The Visual Engine is not currently in this project! Please make sure that it has been properly downloaded before using this module.", HelpBoxMessageType.Warning);
|
||||
Container.Add(vegetationEngineWarning);
|
||||
#endif
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private Label CreateControlsHeader()
|
||||
{
|
||||
Label header = new Label("Control Settings");
|
||||
header.style.unityFontStyleAndWeight = FontStyle.Bold;
|
||||
header.style.marginTop = 10;
|
||||
header.style.marginBottom = 5;
|
||||
return header;
|
||||
}
|
||||
|
||||
private Label CreateReferencesHeader()
|
||||
{
|
||||
Label header = new Label("TVE References");
|
||||
header.style.unityFontStyleAndWeight = FontStyle.Bold;
|
||||
header.style.marginTop = 10;
|
||||
header.style.marginBottom = 5;
|
||||
return header;
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/tve-module");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 18fb27456e582c54e98b3c2c235fb895
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyTVEModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,114 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using DistantLands.Cozy.Data;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyTimeModule))]
|
||||
public class CozyTimeModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyTimeModule timeModule;
|
||||
public override ModuleCategory Category => ModuleCategory.time;
|
||||
public override string ModuleTitle => "Time";
|
||||
public override string ModuleSubtitle => "Time Management Module";
|
||||
public override string ModuleTooltip => "Setup time settings, simple calendars, and manage current settings.";
|
||||
public VisualElement ProfileContainer => root.Q<VisualElement>("profile-container");
|
||||
public VisualElement Container => root.Q<VisualElement>("current-settings-container");
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
timeModule = (CozyTimeModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
Button widget = LargeWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = timeModule.currentTime;
|
||||
VisualElement lowerContainer = widget.Q<VisualElement>("lower-container");
|
||||
|
||||
lowerContainer.Add(new Label()
|
||||
{
|
||||
text = $"Currently it is {timeModule.currentTime.ToString()}"
|
||||
});
|
||||
Label dayYearLabel = new Label()
|
||||
{
|
||||
text = $"Day {timeModule.currentDay} of year {timeModule.currentYear}"
|
||||
};
|
||||
lowerContainer.Add(dayYearLabel);
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/time-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
CozyProfileField<PerennialProfile> profile = new CozyProfileField<PerennialProfile>(serializedObject.FindProperty("perennialProfile"));
|
||||
ProfileContainer.Add(profile);
|
||||
|
||||
PropertyField dayPercentage = new PropertyField();
|
||||
dayPercentage.BindProperty(serializedObject.FindProperty("currentTime"));
|
||||
dayPercentage.label = "Time";
|
||||
Container.Add(dayPercentage);
|
||||
|
||||
SliderInt currentDay = new SliderInt("Day", 0, timeModule.DaysPerYear - 1, SliderDirection.Horizontal, 0);
|
||||
currentDay.SetEnabled(!timeModule.overrideDate);
|
||||
currentDay.showInputField = true;
|
||||
currentDay.AddToClassList("unity-base-field__aligned");
|
||||
currentDay.BindProperty(serializedObject.FindProperty("currentDay"));
|
||||
Container.Add(currentDay);
|
||||
|
||||
PropertyField currentYear = new PropertyField();
|
||||
currentYear.BindProperty(serializedObject.FindProperty("currentYear"));
|
||||
currentYear.SetEnabled(!timeModule.overrideDate);
|
||||
Container.Add(currentYear);
|
||||
|
||||
InspectorElement inspector = new InspectorElement(timeModule.perennialProfile);
|
||||
inspector.AddToClassList("p-0");
|
||||
root.Add(inspector);
|
||||
inspector.RegisterCallback<PointerMoveEvent>((PointerMoveEvent) =>
|
||||
{
|
||||
currentDay.highValue = timeModule.DaysPerYear - 1;
|
||||
});
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void SetTime(object time)
|
||||
{
|
||||
timeModule.currentTime = (float)time;
|
||||
}
|
||||
|
||||
public override void AddContextMenuItems(GenericMenu menu)
|
||||
{
|
||||
menu.AddItem(new GUIContent("Set Time to Morning"), false, SetTime, 0.25f);
|
||||
menu.AddItem(new GUIContent("Set Time to Day"), false, SetTime, 0.5f);
|
||||
menu.AddItem(new GUIContent("Set Time to Evening"), false, SetTime, 0.75f);
|
||||
menu.AddItem(new GUIContent("Set Time to Night"), false, SetTime, 0f);
|
||||
menu.AddSeparator("");
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/time-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 436e3197b176a31438fa06d8b6995a59
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyTimeModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,644 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyTransitModule))]
|
||||
public class CozyTransitModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyTransitModule transitModule;
|
||||
public override ModuleCategory Category => ModuleCategory.time;
|
||||
public override string ModuleTitle => "Transit";
|
||||
public override string ModuleSubtitle => "Sun Movement Module";
|
||||
public override string ModuleTooltip => "Control the sun movement through the sky";
|
||||
|
||||
|
||||
public VisualElement Graph => root.Q<VisualElement>("current-curve-graph");
|
||||
public VisualElement TransitGraph => root.Q<VisualElement>("transit-wheel-graph");
|
||||
public VisualElement TransitGraphInfo => root.Q<VisualElement>("transit-wheel-graph-info");
|
||||
public VisualElement BlocksGraph => root.Q<VisualElement>("time-blocks-graph");
|
||||
public VisualElement BlocksGraphContext => root.Q<VisualElement>("time-blocks-graph-context");
|
||||
public VisualElement SunTransitContainer => root.Q<VisualElement>("sun-transit-container");
|
||||
public VisualElement SeasonalVariationContainer => root.Q<VisualElement>("seasonal-variation-container");
|
||||
public VisualElement TimeBlocksContainer => root.Q<VisualElement>("time-blocks-container");
|
||||
|
||||
public VisualElement Night1 => BlocksGraph.Q<VisualElement>("night1");
|
||||
public VisualElement Dawn => BlocksGraph.Q<VisualElement>("dawn");
|
||||
public VisualElement Morning => BlocksGraph.Q<VisualElement>("morning");
|
||||
public VisualElement Day => BlocksGraph.Q<VisualElement>("day");
|
||||
public VisualElement Afternoon => BlocksGraph.Q<VisualElement>("afternoon");
|
||||
public VisualElement Evening => BlocksGraph.Q<VisualElement>("evening");
|
||||
public VisualElement Twilight => BlocksGraph.Q<VisualElement>("twilight");
|
||||
public VisualElement Night2 => BlocksGraph.Q<VisualElement>("night2");
|
||||
|
||||
static Gradient TransitDayColors = new Gradient()
|
||||
{
|
||||
colorKeys = new GradientColorKey[5] {
|
||||
new GradientColorKey(Branding.charcoal,0),
|
||||
new GradientColorKey(Branding.red,0.25f),
|
||||
new GradientColorKey(Branding.blue,0.5f),
|
||||
new GradientColorKey(Branding.orange,0.75f),
|
||||
new GradientColorKey(Branding.charcoal,1)
|
||||
}
|
||||
};
|
||||
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
transitModule = (CozyTransitModule)target;
|
||||
transitModule.GetModifiedDayPercent();
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = LargeWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
|
||||
switch (transitModule.GetTimeBlock())
|
||||
{
|
||||
case CozyTransitModule.TimeBlockName.dawn:
|
||||
status.text = "Dawn";
|
||||
break;
|
||||
case CozyTransitModule.TimeBlockName.morning:
|
||||
status.text = "Morning";
|
||||
break;
|
||||
case CozyTransitModule.TimeBlockName.day:
|
||||
status.text = "Day";
|
||||
break;
|
||||
case CozyTransitModule.TimeBlockName.afternoon:
|
||||
status.text = "Afternoon";
|
||||
break;
|
||||
case CozyTransitModule.TimeBlockName.evening:
|
||||
status.text = "Evening";
|
||||
break;
|
||||
case CozyTransitModule.TimeBlockName.twilight:
|
||||
status.text = "Twilight";
|
||||
break;
|
||||
case CozyTransitModule.TimeBlockName.night:
|
||||
status.text = "Night";
|
||||
break;
|
||||
}
|
||||
|
||||
VisualElement lowerContainer = widget.Q<VisualElement>("lower-container");
|
||||
|
||||
lowerContainer.Add(new TransitGraph(transitModule.weatherSphere.modifiedDayPercentage));
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public void DisplayBlockEditor(string blockName)
|
||||
{
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty(blockName).FindPropertyRelative("start"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty(blockName).FindPropertyRelative("end"));
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
transitModule.GetModifiedDayPercent();
|
||||
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/transit-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
root.RegisterCallback<PointerMoveEvent>((PointerMoveEvent evt) =>
|
||||
{
|
||||
RefreshTransitWheelGraph();
|
||||
RefreshTransitGraph();
|
||||
RefreshTimeBlocksGraph();
|
||||
transitModule.GetModifiedDayPercent();
|
||||
});
|
||||
|
||||
RefreshTransitWheelGraph();
|
||||
RefreshTransitGraph();
|
||||
RefreshTimeBlocksGraph();
|
||||
|
||||
PropertyField timeCurveSettings = new PropertyField();
|
||||
timeCurveSettings.BindProperty(serializedObject.FindProperty("timeCurveSettings"));
|
||||
SunTransitContainer.Add(timeCurveSettings);
|
||||
|
||||
VisualElement timeBasedWeights = new VisualElement();
|
||||
|
||||
void RedrawTimeBasedWeights()
|
||||
{
|
||||
timeBasedWeights.Clear();
|
||||
if (transitModule.timeCurveSettings == CozyTransitModule.TimeCurveSettings.linearDay) return;
|
||||
|
||||
timeBasedWeights.Add(TimeCurveVertex(serializedObject.FindProperty("sunriseWeight"), "Sunrise"));
|
||||
timeBasedWeights.Add(TimeCurveVertex(serializedObject.FindProperty("dayWeight"), "Day"));
|
||||
timeBasedWeights.Add(TimeCurveVertex(serializedObject.FindProperty("sunsetWeight"), "Sunset"));
|
||||
timeBasedWeights.Add(TimeCurveVertex(serializedObject.FindProperty("nightWeight"), "Night"));
|
||||
}
|
||||
|
||||
SunTransitContainer.Add(timeBasedWeights);
|
||||
timeCurveSettings.RegisterValueChangeCallback(evt =>
|
||||
{
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
serializedObject.Update();
|
||||
RedrawTimeBasedWeights();
|
||||
});
|
||||
|
||||
PropertyField springDayLengthOffset = new PropertyField();
|
||||
springDayLengthOffset.BindProperty(serializedObject.FindProperty("springDayLengthOffset"));
|
||||
SeasonalVariationContainer.Add(springDayLengthOffset);
|
||||
|
||||
PropertyField summerDayLengthOffset = new PropertyField();
|
||||
summerDayLengthOffset.BindProperty(serializedObject.FindProperty("summerDayLengthOffset"));
|
||||
SeasonalVariationContainer.Add(summerDayLengthOffset);
|
||||
|
||||
PropertyField fallDayLengthOffset = new PropertyField();
|
||||
fallDayLengthOffset.BindProperty(serializedObject.FindProperty("fallDayLengthOffset"));
|
||||
SeasonalVariationContainer.Add(fallDayLengthOffset);
|
||||
|
||||
PropertyField winterDayLengthOffset = new PropertyField();
|
||||
winterDayLengthOffset.BindProperty(serializedObject.FindProperty("winterDayLengthOffset"));
|
||||
SeasonalVariationContainer.Add(winterDayLengthOffset);
|
||||
|
||||
|
||||
TimeBlocksContainer.Add(TimeBlockElement(serializedObject.FindProperty("dawnBlock"), "Dawn"));
|
||||
TimeBlocksContainer.Add(TimeBlockElement(serializedObject.FindProperty("morningBlock"), "Morning"));
|
||||
TimeBlocksContainer.Add(TimeBlockElement(serializedObject.FindProperty("dayBlock"), "Day"));
|
||||
TimeBlocksContainer.Add(TimeBlockElement(serializedObject.FindProperty("afternoonBlock"), "Afternoon"));
|
||||
TimeBlocksContainer.Add(TimeBlockElement(serializedObject.FindProperty("eveningBlock"), "Evening"));
|
||||
TimeBlocksContainer.Add(TimeBlockElement(serializedObject.FindProperty("twilightBlock"), "Twilight"));
|
||||
TimeBlocksContainer.Add(TimeBlockElement(serializedObject.FindProperty("nightBlock"), "Night"));
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void RefreshTransitWheelGraph()
|
||||
{
|
||||
TransitGraphInfo.Clear();
|
||||
|
||||
Label infoLabel = new Label();
|
||||
infoLabel.text = "Sun Angle";
|
||||
infoLabel.AddToClassList("h1");
|
||||
TransitGraphInfo.Add(infoLabel);
|
||||
|
||||
VisualElement infoHolder = new VisualElement();
|
||||
infoHolder.AddToClassList("pl-4");
|
||||
TransitGraphInfo.Add(infoHolder);
|
||||
|
||||
for (int i = 0; i < 8; i += 1)
|
||||
{
|
||||
VisualElement container = new VisualElement();
|
||||
container.AddToClassList("swatch");
|
||||
|
||||
VisualElement swatch = new VisualElement();
|
||||
swatch.style.backgroundColor = TransitDayColors.Evaluate(transitModule.ModifyDayPercentage((i * 2 + 1) / 16f) / 360);
|
||||
container.Add(swatch);
|
||||
|
||||
|
||||
Label timeLabel = new Label
|
||||
{
|
||||
text = $"{((MeridiemTime)(i / 8f)).ToString()} - {Mathf.Round(transitModule.sunMovementCurve.Evaluate(i / 8f))}°"
|
||||
};
|
||||
timeLabel.AddToClassList("font-bold");
|
||||
container.Add(timeLabel);
|
||||
|
||||
infoHolder.Add(container);
|
||||
|
||||
}
|
||||
|
||||
VisualElement lastContainer = new VisualElement();
|
||||
lastContainer.AddToClassList("swatch");
|
||||
|
||||
VisualElement lastSwatch = new VisualElement();
|
||||
lastSwatch.style.backgroundColor = TransitDayColors.Evaluate(1);
|
||||
lastContainer.Add(lastSwatch);
|
||||
|
||||
|
||||
Label lastTimeLabel = new Label
|
||||
{
|
||||
text = $"{((MeridiemTime)1).ToString()} - {Mathf.Round(transitModule.sunMovementCurve.Evaluate(1))}°"
|
||||
};
|
||||
lastTimeLabel.AddToClassList("font-bold");
|
||||
lastContainer.Add(lastTimeLabel);
|
||||
|
||||
infoHolder.Add(lastContainer);
|
||||
|
||||
|
||||
TransitGraph.Clear();
|
||||
|
||||
VisualElement graphHolder = new VisualElement();
|
||||
graphHolder.AddToClassList("graph-section");
|
||||
|
||||
graphHolder.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = graphHolder.contentRect.width;
|
||||
float height = graphHolder.contentRect.height;
|
||||
|
||||
var painter = context.painter2D;
|
||||
painter.lineWidth = 24;
|
||||
|
||||
int spokes = 120;
|
||||
|
||||
|
||||
for (int i = 0; i < spokes; i++)
|
||||
{
|
||||
painter.strokeColor = TransitDayColors.Evaluate(transitModule.ModifyDayPercentage(i / (float)spokes) / 360);
|
||||
float start = 90 + (i / (float)spokes) * 360;
|
||||
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2), height / 3, start, start + 2f, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
}
|
||||
|
||||
painter.lineWidth = 3;
|
||||
painter.strokeColor = Branding.white;
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2), height / 3 + 18, 90 + transitModule.weatherSphere.dayPercentage * 360, 90 + transitModule.weatherSphere.dayPercentage * 360 + 3f, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Label label = new Label();
|
||||
label.text = transitModule.weatherSphere.timeModule.currentTime.ToString();
|
||||
label.AddToClassList("h1");
|
||||
graphHolder.Add(label);
|
||||
|
||||
Label block = new Label();
|
||||
block.text = transitModule.GetTimeBlock().ToString();
|
||||
block.AddToClassList("h2");
|
||||
graphHolder.Add(block);
|
||||
|
||||
TransitGraph.Add(graphHolder);
|
||||
|
||||
}
|
||||
|
||||
public void RefreshTransitGraph()
|
||||
{
|
||||
Graph.Clear();
|
||||
|
||||
VisualElement graphHolder = new VisualElement();
|
||||
graphHolder.AddToClassList("graph-section");
|
||||
|
||||
graphHolder.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = graphHolder.contentRect.width;
|
||||
float height = graphHolder.contentRect.height;
|
||||
|
||||
var painter = context.painter2D;
|
||||
|
||||
for (int i = 0; i < 23; i++)
|
||||
{
|
||||
if (i % 6 == 0)
|
||||
painter.strokeColor = Branding.whiteAccent;
|
||||
else
|
||||
painter.strokeColor = Branding.lightGreyAccent;
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * i / 24, 0));
|
||||
painter.LineTo(new Vector2(width * i / 24, height));
|
||||
painter.Stroke();
|
||||
}
|
||||
|
||||
painter.strokeColor = Branding.whiteAccent;
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(0, height / 2));
|
||||
painter.LineTo(new Vector2(width, height / 2));
|
||||
painter.Stroke();
|
||||
|
||||
|
||||
|
||||
float offset = transitModule.yearWeightsCurve.Evaluate(transitModule.weatherSphere.timeModule.yearPercentage) / 5;
|
||||
|
||||
void DrawGraph(Color color, float lineWidth, float offset)
|
||||
{
|
||||
painter.strokeColor = color;
|
||||
painter.lineWidth = lineWidth;
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(0, height));
|
||||
|
||||
switch (transitModule.timeCurveSettings)
|
||||
{
|
||||
case CozyTransitModule.TimeCurveSettings.linearDay:
|
||||
painter.LineTo(
|
||||
new Vector2(width * (transitModule.sunriseWeight.time - offset), height * (1 - transitModule.sunriseWeight.sunHeight / 180))
|
||||
);
|
||||
painter.LineTo(
|
||||
new Vector2(width * transitModule.dayWeight.time, height * (1 - transitModule.dayWeight.sunHeight / 180))
|
||||
);
|
||||
painter.LineTo(
|
||||
new Vector2(width * (transitModule.sunsetWeight.time + offset), height * (1 - (transitModule.sunsetWeight.sunHeight > 180 ? 360 - transitModule.sunsetWeight.sunHeight : transitModule.sunsetWeight.sunHeight) / 180))
|
||||
);
|
||||
painter.LineTo(
|
||||
new Vector2(width, height)
|
||||
);
|
||||
break;
|
||||
case CozyTransitModule.TimeCurveSettings.simpleCurve:
|
||||
painter.BezierCurveTo(
|
||||
new Vector2(width * transitModule.nightWeight.weight * 0.25f, height),
|
||||
new Vector2((width * (0.25f - offset)) - width * transitModule.sunriseWeight.weight * 0.25f, height * 0.5f),
|
||||
new Vector2(width * (0.25f - offset), height * 0.5f)
|
||||
);
|
||||
painter.BezierCurveTo(
|
||||
new Vector2((width * (0.25f - offset)) + width * transitModule.sunriseWeight.weight * 0.25f, height * 0.5f),
|
||||
new Vector2((width * 0.5f) - width * transitModule.dayWeight.weight * 0.25f, 0),
|
||||
new Vector2(width * 0.5f, 0)
|
||||
);
|
||||
painter.BezierCurveTo(
|
||||
new Vector2((width * 0.5f) + width * transitModule.dayWeight.weight * 0.25f, 0),
|
||||
new Vector2((width * (0.75f + offset)) - width * transitModule.sunsetWeight.weight * 0.25f, height * 0.5f),
|
||||
new Vector2(width * (0.75f + offset), height * 0.5f)
|
||||
);
|
||||
painter.BezierCurveTo(
|
||||
new Vector2((width * (0.75f + offset)) + width * transitModule.sunsetWeight.weight * 0.25f, height * 0.5f),
|
||||
new Vector2(width - width * transitModule.nightWeight.weight * 0.25f, height),
|
||||
new Vector2(width, height)
|
||||
);
|
||||
break;
|
||||
default:
|
||||
painter.BezierCurveTo(
|
||||
new Vector2(width * transitModule.nightWeight.weight * 0.25f, height),
|
||||
new Vector2((width * (transitModule.sunriseWeight.time - offset)) - width * transitModule.sunriseWeight.weight * 0.25f, height * (1 - transitModule.sunriseWeight.sunHeight / 180)),
|
||||
new Vector2(width * (transitModule.sunriseWeight.time - offset), height * (1 - transitModule.sunriseWeight.sunHeight / 180))
|
||||
);
|
||||
painter.BezierCurveTo(
|
||||
new Vector2((width * (transitModule.sunriseWeight.time - offset)) + width * transitModule.sunriseWeight.weight * 0.25f, height * (1 - transitModule.sunriseWeight.sunHeight / 180)),
|
||||
new Vector2((width * transitModule.dayWeight.time) - width * transitModule.dayWeight.weight * 0.25f, height * (1 - transitModule.dayWeight.sunHeight / 180)),
|
||||
new Vector2(width * transitModule.dayWeight.time, height * (1 - transitModule.dayWeight.sunHeight / 180))
|
||||
);
|
||||
painter.BezierCurveTo(
|
||||
new Vector2((width * transitModule.dayWeight.time) + width * transitModule.dayWeight.weight * 0.25f, height * (1 - transitModule.dayWeight.sunHeight / 180)),
|
||||
new Vector2((width * (transitModule.sunsetWeight.time + offset)) - width * transitModule.sunsetWeight.weight * 0.25f, height * (1 - (transitModule.sunsetWeight.sunHeight > 180 ? 360 - transitModule.sunsetWeight.sunHeight : transitModule.sunsetWeight.sunHeight) / 180)),
|
||||
new Vector2(width * (transitModule.sunsetWeight.time + offset), height * (1 - (transitModule.sunsetWeight.sunHeight > 180 ? 360 - transitModule.sunsetWeight.sunHeight : transitModule.sunsetWeight.sunHeight) / 180))
|
||||
);
|
||||
painter.BezierCurveTo(
|
||||
new Vector2((width * (transitModule.sunsetWeight.time + offset)) + width * transitModule.sunsetWeight.weight * 0.25f, height * (1 - (transitModule.sunsetWeight.sunHeight > 180 ? 360 - transitModule.sunsetWeight.sunHeight : transitModule.sunsetWeight.sunHeight) / 180)),
|
||||
new Vector2(width - width * transitModule.nightWeight.weight * 0.25f, height),
|
||||
new Vector2(width, height)
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
painter.Stroke();
|
||||
|
||||
}
|
||||
|
||||
DrawGraph(Branding.white, 2, 0);
|
||||
|
||||
float springOffset = transitModule.springDayLengthOffset / 5;
|
||||
if (springOffset != 0)
|
||||
{
|
||||
DrawGraph(Branding.green, 1, springOffset);
|
||||
}
|
||||
|
||||
float summerOffset = transitModule.summerDayLengthOffset / 5;
|
||||
if (summerOffset != 0)
|
||||
{
|
||||
DrawGraph(Branding.yellow, 1, summerOffset);
|
||||
}
|
||||
|
||||
float fallOffset = transitModule.fallDayLengthOffset / 5;
|
||||
if (fallOffset != 0)
|
||||
{
|
||||
DrawGraph(Branding.orange, 1, fallOffset);
|
||||
}
|
||||
|
||||
float winterOffset = transitModule.winterDayLengthOffset / 5;
|
||||
if (winterOffset != 0)
|
||||
{
|
||||
DrawGraph(Branding.blue, 1, winterOffset);
|
||||
}
|
||||
};
|
||||
|
||||
Graph.Add(graphHolder);
|
||||
|
||||
}
|
||||
|
||||
public void RefreshTimeBlocksGraph()
|
||||
{
|
||||
|
||||
BlocksGraphContext.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = BlocksGraphContext.contentRect.width;
|
||||
float height = BlocksGraphContext.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.fillColor = Branding.whiteAccent;
|
||||
painter.strokeColor = Branding.whiteAccent;
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * transitModule.weatherSphere.dayPercentage, height));
|
||||
painter.LineTo(new Vector2(width * transitModule.weatherSphere.dayPercentage - 5, 0));
|
||||
painter.LineTo(new Vector2(width * transitModule.weatherSphere.dayPercentage + 5, 0));
|
||||
painter.ClosePath();
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Night1.style.backgroundColor = new StyleColor(Branding.charcoal);
|
||||
Night1.style.flexGrow = (float)transitModule.dawnBlock.start;
|
||||
|
||||
Dawn.style.backgroundColor = new StyleColor(Branding.purple);
|
||||
Dawn.style.flexGrow = transitModule.morningBlock.start - transitModule.dawnBlock.start;
|
||||
Dawn.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = Dawn.contentRect.width;
|
||||
float height = Dawn.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.strokeColor = Branding.white;
|
||||
float percentage = (transitModule.dawnBlock.end - transitModule.dawnBlock.start) / (transitModule.morningBlock.start - transitModule.dawnBlock.start);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * percentage, 0));
|
||||
painter.LineTo(new Vector2(width * percentage, height));
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Morning.style.backgroundColor = new StyleColor(Branding.red);
|
||||
Morning.style.flexGrow = transitModule.dayBlock.start - transitModule.morningBlock.start;
|
||||
Morning.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = Morning.contentRect.width;
|
||||
float height = Morning.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.strokeColor = Branding.white;
|
||||
float percentage = (transitModule.morningBlock.end - transitModule.morningBlock.start) / (transitModule.dayBlock.start - transitModule.morningBlock.start);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * percentage, 0));
|
||||
painter.LineTo(new Vector2(width * percentage, height));
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Day.style.backgroundColor = new StyleColor(Branding.blue);
|
||||
Day.style.flexGrow = transitModule.afternoonBlock.start - transitModule.dayBlock.start;
|
||||
Day.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = Morning.contentRect.width;
|
||||
float height = Morning.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.strokeColor = Branding.white;
|
||||
float percentage = (transitModule.dayBlock.end - transitModule.dayBlock.start) / (transitModule.afternoonBlock.start - transitModule.dayBlock.start);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * percentage, 0));
|
||||
painter.LineTo(new Vector2(width * percentage, height));
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Afternoon.style.backgroundColor = new StyleColor(Branding.green);
|
||||
Afternoon.style.flexGrow = transitModule.eveningBlock.start - transitModule.afternoonBlock.start;
|
||||
Afternoon.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = Morning.contentRect.width;
|
||||
float height = Morning.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.strokeColor = Branding.white;
|
||||
float percentage = (transitModule.afternoonBlock.end - transitModule.afternoonBlock.start) / (transitModule.eveningBlock.start - transitModule.afternoonBlock.start);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * percentage, 0));
|
||||
painter.LineTo(new Vector2(width * percentage, height));
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Evening.style.backgroundColor = new StyleColor(Branding.yellow);
|
||||
Evening.style.flexGrow = transitModule.twilightBlock.start - transitModule.eveningBlock.start;
|
||||
Evening.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = Morning.contentRect.width;
|
||||
float height = Morning.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.strokeColor = Branding.white;
|
||||
float percentage = (transitModule.eveningBlock.end - transitModule.eveningBlock.start) / (transitModule.twilightBlock.start - transitModule.eveningBlock.start);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * percentage, 0));
|
||||
painter.LineTo(new Vector2(width * percentage, height));
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Twilight.style.backgroundColor = new StyleColor(Branding.orange);
|
||||
Twilight.style.flexGrow = transitModule.nightBlock.start - transitModule.twilightBlock.start;
|
||||
Twilight.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = Morning.contentRect.width;
|
||||
float height = Morning.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.strokeColor = Branding.white;
|
||||
float percentage = (transitModule.twilightBlock.end - transitModule.twilightBlock.start) / (transitModule.nightBlock.start - transitModule.twilightBlock.start);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * percentage, 0));
|
||||
painter.LineTo(new Vector2(width * percentage, height));
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
Night2.style.backgroundColor = new StyleColor(Branding.charcoal);
|
||||
Night2.style.flexGrow = 1 - transitModule.nightBlock.start;
|
||||
Night2.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = Morning.contentRect.width;
|
||||
float height = Morning.contentRect.height;
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.strokeColor = Branding.white;
|
||||
float percentage = (transitModule.nightBlock.end - transitModule.nightBlock.start) / (1 - transitModule.nightBlock.start);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width * percentage, 0));
|
||||
painter.LineTo(new Vector2(width * percentage, height));
|
||||
painter.Stroke();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
public VisualElement TimeCurveVertex(SerializedProperty property, string title)
|
||||
{
|
||||
VisualElement container = new VisualElement();
|
||||
|
||||
Label label = new Label();
|
||||
label.text = title;
|
||||
label.AddToClassList("h2");
|
||||
container.Add(label);
|
||||
|
||||
VisualElement indentedContainer = new VisualElement();
|
||||
indentedContainer.AddToClassList("pl-4");
|
||||
|
||||
if (transitModule.timeCurveSettings == CozyTransitModule.TimeCurveSettings.advancedCurve)
|
||||
{
|
||||
PropertyField time = new PropertyField();
|
||||
time.BindProperty(property.FindPropertyRelative("time"));
|
||||
time.RegisterValueChangeCallback(evt =>
|
||||
{
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
property.serializedObject.Update();
|
||||
transitModule.GetModifiedDayPercent();
|
||||
});
|
||||
indentedContainer.Add(time);
|
||||
|
||||
PropertyField sunHeight = new PropertyField();
|
||||
sunHeight.BindProperty(property.FindPropertyRelative("sunHeight"));
|
||||
sunHeight.RegisterValueChangeCallback(evt =>
|
||||
{
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
property.serializedObject.Update();
|
||||
transitModule.GetModifiedDayPercent();
|
||||
});
|
||||
indentedContainer.Add(sunHeight);
|
||||
}
|
||||
|
||||
PropertyField weight = new PropertyField();
|
||||
weight.BindProperty(property.FindPropertyRelative("weight"));
|
||||
weight.RegisterValueChangeCallback(evt =>
|
||||
{
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
property.serializedObject.Update();
|
||||
transitModule.GetModifiedDayPercent();
|
||||
});
|
||||
indentedContainer.Add(weight);
|
||||
|
||||
container.Add(indentedContainer);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
public VisualElement TimeBlockElement(SerializedProperty property, string title)
|
||||
{
|
||||
VisualElement container = new VisualElement();
|
||||
|
||||
Label label = new Label();
|
||||
label.text = title;
|
||||
label.AddToClassList("h2");
|
||||
container.Add(label);
|
||||
|
||||
VisualElement indentedContainer = new VisualElement();
|
||||
indentedContainer.AddToClassList("pl-4");
|
||||
|
||||
PropertyField start = new PropertyField();
|
||||
start.BindProperty(property.FindPropertyRelative("start"));
|
||||
indentedContainer.Add(start);
|
||||
|
||||
PropertyField end = new PropertyField();
|
||||
end.BindProperty(property.FindPropertyRelative("end"));
|
||||
indentedContainer.Add(end);
|
||||
|
||||
container.Add(indentedContainer);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/transit-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: efe212e882e0eca40ba9373f45ef9371
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyTransitModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,202 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Linq;
|
||||
using DistantLands.Cozy.Data;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyWeatherModule))]
|
||||
public class CozyWeatherModuleEditor : CozyBiomeModuleEditor
|
||||
{
|
||||
|
||||
CozyWeatherModule weatherModule;
|
||||
public override ModuleCategory Category => ModuleCategory.ecosystem;
|
||||
public override string ModuleTitle => "Weather";
|
||||
public override string ModuleSubtitle => "Forecast Module";
|
||||
public override string ModuleTooltip => "Manage weather, forecast and playback options.";
|
||||
|
||||
public VisualElement SelectionContainer => root.Q<VisualElement>("selection-container");
|
||||
public VisualElement DynamicSettings => root.Q<VisualElement>("dynamic-settings");
|
||||
public VisualElement SettingsContainer => root.Q<VisualElement>("settings-container");
|
||||
|
||||
static Gradient WeatherKeyColors = new Gradient()
|
||||
{
|
||||
colorKeys = new GradientColorKey[8] {
|
||||
new GradientColorKey(Branding.deepBlue,0f/7f),
|
||||
new GradientColorKey(Branding.red,1f/7f),
|
||||
new GradientColorKey(Branding.yellow,2f/7f),
|
||||
new GradientColorKey(Branding.green,3f/7f),
|
||||
new GradientColorKey(Branding.purple,4f/7f),
|
||||
new GradientColorKey(Branding.blue,5f/7f),
|
||||
new GradientColorKey(Branding.orange,6f/7f),
|
||||
new GradientColorKey(Branding.deepBlue,1f)
|
||||
}
|
||||
};
|
||||
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
weatherModule = (CozyWeatherModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.text = weatherModule.ecosystem.currentWeather.name;
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/weather-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
|
||||
|
||||
PropertyField weatherSelectionMode = new PropertyField();
|
||||
weatherSelectionMode.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("weatherSelectionMode"));
|
||||
weatherSelectionMode.RegisterValueChangeCallback(evt =>
|
||||
{
|
||||
GetCurrentSettings();
|
||||
});
|
||||
SelectionContainer.Insert(0, weatherSelectionMode);
|
||||
|
||||
|
||||
GetCurrentSettings();
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayBiomeUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
PropertyField weatherSelectionMode = new PropertyField();
|
||||
weatherSelectionMode.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("weatherSelectionMode"));
|
||||
weatherSelectionMode.RegisterValueChangeCallback((evt) =>
|
||||
{
|
||||
GetBiomeSettings();
|
||||
});
|
||||
root.Add(weatherSelectionMode);
|
||||
|
||||
VisualElement dynamicSettings = new VisualElement();
|
||||
dynamicSettings.name = "dynamic-settings";
|
||||
root.Add(dynamicSettings);
|
||||
|
||||
|
||||
VisualElement settingsContainer = new VisualElement();
|
||||
settingsContainer.name = "settings-container";
|
||||
root.Add(settingsContainer);
|
||||
|
||||
GetCurrentSettings();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public void GetCurrentSettings()
|
||||
{
|
||||
DynamicSettings.Clear();
|
||||
switch ((CozyEcosystem.EcosystemStyle)serializedObject.FindProperty("ecosystem").FindPropertyRelative("weatherSelectionMode").enumValueIndex)
|
||||
{
|
||||
case CozyEcosystem.EcosystemStyle.automatic:
|
||||
PropertyField currentWeather = new PropertyField();
|
||||
currentWeather.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("currentWeather"));
|
||||
currentWeather.RegisterValueChangeCallback(evt =>
|
||||
{
|
||||
RenderSingleWeatherInspector();
|
||||
});
|
||||
DynamicSettings.Add(currentWeather);
|
||||
RenderSingleWeatherInspector();
|
||||
break;
|
||||
case CozyEcosystem.EcosystemStyle.manual:
|
||||
SettingsContainer.Clear();
|
||||
PropertyField weightedWeatherProfiles = new PropertyField();
|
||||
weightedWeatherProfiles.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("weightedWeatherProfiles"));
|
||||
DynamicSettings.Add(weightedWeatherProfiles);
|
||||
break;
|
||||
default:
|
||||
PropertyField previewWeather = new PropertyField();
|
||||
previewWeather.label = "Preview Weather";
|
||||
previewWeather.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("currentWeather"));
|
||||
DynamicSettings.Add(previewWeather);
|
||||
PropertyField forecastProfile = new PropertyField();
|
||||
forecastProfile.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("forecastProfile"));
|
||||
forecastProfile.RegisterValueChangeCallback(evt =>
|
||||
{
|
||||
RenderForecastInspector();
|
||||
});
|
||||
|
||||
DynamicSettings.Add(forecastProfile);
|
||||
|
||||
RenderForecastInspector();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void GetBiomeSettings()
|
||||
{
|
||||
DynamicSettings.Clear();
|
||||
switch ((CozyEcosystem.EcosystemStyle)serializedObject.FindProperty("ecosystem").FindPropertyRelative("weatherSelectionMode").enumValueIndex)
|
||||
{
|
||||
case CozyEcosystem.EcosystemStyle.automatic:
|
||||
PropertyField currentWeather = new PropertyField();
|
||||
currentWeather.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("currentWeather"));
|
||||
DynamicSettings.Add(currentWeather);
|
||||
break;
|
||||
case CozyEcosystem.EcosystemStyle.manual:
|
||||
PropertyField weightedWeatherProfiles = new PropertyField();
|
||||
weightedWeatherProfiles.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("weightedWeatherProfiles"));
|
||||
DynamicSettings.Add(weightedWeatherProfiles);
|
||||
break;
|
||||
default:
|
||||
PropertyField forecastProfile = new PropertyField();
|
||||
forecastProfile.BindProperty(serializedObject.FindProperty("ecosystem").FindPropertyRelative("forecastProfile"));
|
||||
DynamicSettings.Add(forecastProfile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void RenderForecastInspector()
|
||||
{
|
||||
SettingsContainer.Clear();
|
||||
InspectorElement inspector = new InspectorElement(weatherModule.ecosystem.forecastProfile);
|
||||
inspector.AddToClassList("p-0");
|
||||
SettingsContainer.Add(inspector);
|
||||
}
|
||||
|
||||
public void RenderSingleWeatherInspector()
|
||||
{
|
||||
SettingsContainer.Clear();
|
||||
InspectorElement inspector = new InspectorElement(weatherModule.ecosystem.currentWeather);
|
||||
inspector.AddToClassList("p-0");
|
||||
SettingsContainer.Add(inspector);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/weather-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7048696745c817a46ab0744f61b6c173
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyWeatherModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,279 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
#if ZEPHYR
|
||||
using DistantLands.Zephyr;
|
||||
#endif
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(CozyWindModule))]
|
||||
public class CozyWindModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
CozyWindModule windModule;
|
||||
public override ModuleCategory Category => ModuleCategory.ecosystem;
|
||||
public override string ModuleTitle => "Wind";
|
||||
public override string ModuleSubtitle => "Wind Zone Module";
|
||||
public override string ModuleTooltip => "Control wind within the COZY system.";
|
||||
|
||||
public VisualElement GraphContainer => root.Q<VisualElement>("graph-container");
|
||||
public VisualElement GraphInformationContainer => root.Q<VisualElement>("graph-information-container");
|
||||
public VisualElement SelectionContainer => root.Q<VisualElement>("selection-container");
|
||||
public VisualElement GlobalSettingsContainer => root.Q<VisualElement>("global-settings-container");
|
||||
|
||||
public Label Direction => root.Q<Label>("direction");
|
||||
public Label MainWind => root.Q<Label>("main-wind");
|
||||
public Label PulseMagnitude => root.Q<Label>("pulse-magnitude");
|
||||
public Label PulseFrequency => root.Q<Label>("pulse-frequency");
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
windModule = (CozyWindModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = LargeWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
|
||||
Vector3 north = Vector3.Cross(windModule.weatherSphere.sunTransform.parent.forward, Vector3.up);
|
||||
Vector3 west = windModule.weatherSphere.sunTransform.parent.forward;
|
||||
Vector3 windDirInCardinalDirection = north * windModule.WindDirection.x + west * windModule.WindDirection.y;
|
||||
string compassDirection;
|
||||
if (Mathf.Abs(windDirInCardinalDirection.x) > Mathf.Abs(windDirInCardinalDirection.z))
|
||||
compassDirection = windDirInCardinalDirection.x > 0 ? "N" : "S";
|
||||
else
|
||||
compassDirection = windDirInCardinalDirection.z > 0 ? "E" : "W";
|
||||
|
||||
string statusString = $"Wind: {Mathf.Round(windModule.WindSpeedInKnots * 10f) / 10f} {compassDirection}";
|
||||
|
||||
#if ZEPHYR
|
||||
statusString += "\nZephyr Enabled";
|
||||
#endif
|
||||
|
||||
status.text = statusString;
|
||||
|
||||
VisualElement lowerContainer = widget.Q<VisualElement>("lower-container");
|
||||
lowerContainer.Add(Weathervane());
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public VisualElement Weathervane()
|
||||
{
|
||||
VisualElement element = new VisualElement();
|
||||
element.AddToClassList("half-graph-section");
|
||||
|
||||
element.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = element.contentRect.width;
|
||||
float height = element.contentRect.height;
|
||||
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.lineWidth = 2;
|
||||
painter.strokeColor = new Color(1, 1, 1, 0.25f);
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2), width / 3, 0, 360f, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.fillColor = new Color(1, 1, 1, 1);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2 - (width / 3 - 6), height / 2));
|
||||
painter.LineTo(new Vector2(width / 2 - (width / 3), height / 2));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2, height / 2 + (width / 3 - 6)));
|
||||
painter.LineTo(new Vector2(width / 2, height / 2 + (width / 3)));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2 + (width / 3 - 6), height / 2));
|
||||
painter.LineTo(new Vector2(width / 2 + (width / 3), height / 2));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2, height / 2 - (width / 3 - 6)));
|
||||
painter.LineTo(new Vector2(width / 2, height / 2 - (width / 3)));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
Vector2 compassWindDir = new Vector2(windModule.WindDirection.x, -windModule.WindDirection.z);
|
||||
|
||||
painter.strokeColor = Color.red;
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2, height / 2) + compassWindDir.normalized * (width / 3));
|
||||
painter.LineTo(new Vector2(width / 2, height / 2) + compassWindDir.normalized * (width / 4));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
};
|
||||
|
||||
Label label = new Label();
|
||||
label.text = $"{Mathf.Round(windModule.WindSpeedInKnots * 10f) / 10f} kn";
|
||||
label.AddToClassList("h2");
|
||||
|
||||
element.Add(label);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/wind-module-editor.uxml"
|
||||
);
|
||||
|
||||
asset.CloneTree(root);
|
||||
DrawGraph();
|
||||
|
||||
root.RegisterCallback<PointerMoveEvent>((PointerMoveEvent evt) =>
|
||||
{
|
||||
DrawGraph();
|
||||
});
|
||||
|
||||
|
||||
PropertyField defaultWindProfile = new PropertyField();
|
||||
defaultWindProfile.BindProperty(serializedObject.FindProperty("defaultWindProfile"));
|
||||
SelectionContainer.Add(defaultWindProfile);
|
||||
PropertyField windZone = new PropertyField();
|
||||
windZone.BindProperty(serializedObject.FindProperty("windZone"));
|
||||
SelectionContainer.Add(windZone);
|
||||
|
||||
|
||||
#if ZEPHYR
|
||||
if (ZephyrWind.Instance){
|
||||
HelpBox zephyrInfo = new HelpBox("Zephyr found in the scene! Wind settings will be managed by COZY automatically through this module.", HelpBoxMessageType.Info);
|
||||
SelectionContainer.Add(zephyrInfo);
|
||||
}
|
||||
#endif
|
||||
|
||||
PropertyField windMultiplier = new PropertyField();
|
||||
windMultiplier.BindProperty(serializedObject.FindProperty("windMultiplier"));
|
||||
GlobalSettingsContainer.Add(windMultiplier);
|
||||
PropertyField useWindzone = new PropertyField();
|
||||
useWindzone.BindProperty(serializedObject.FindProperty("useWindzone"));
|
||||
GlobalSettingsContainer.Add(useWindzone);
|
||||
PropertyField useShaderWind = new PropertyField();
|
||||
useShaderWind.BindProperty(serializedObject.FindProperty("useShaderWind"));
|
||||
GlobalSettingsContainer.Add(useShaderWind);
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
public void DrawGraph()
|
||||
{
|
||||
GraphContainer.Clear();
|
||||
|
||||
if (windModule.windZone)
|
||||
{
|
||||
Direction.text = $"Wind Direction: {windModule.windZone.transform.forward}";
|
||||
MainWind.text = $"Main Wind Amount: {windModule.windZone.windMain}";
|
||||
PulseMagnitude.text = $"Pulse Magnitude: {windModule.windZone.windPulseMagnitude}";
|
||||
PulseFrequency.text = $"Pulse Frequency: {windModule.windZone.windPulseFrequency}";
|
||||
}
|
||||
else
|
||||
{
|
||||
Direction.text = "No WindZone Detected";
|
||||
MainWind.text = "--";
|
||||
PulseMagnitude.text = "--";
|
||||
PulseFrequency.text = "--";
|
||||
}
|
||||
|
||||
VisualElement element = new VisualElement();
|
||||
element.AddToClassList("half-graph-section");
|
||||
|
||||
element.generateVisualContent += (MeshGenerationContext context) =>
|
||||
{
|
||||
float width = element.contentRect.width;
|
||||
float height = element.contentRect.height;
|
||||
|
||||
var painter = context.painter2D;
|
||||
|
||||
painter.lineWidth = 2;
|
||||
painter.strokeColor = new Color(1, 1, 1, 0.25f);
|
||||
painter.BeginPath();
|
||||
painter.Arc(new Vector2(width / 2, height / 2), height / 2, 0, 360f, ArcDirection.Clockwise);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.fillColor = new Color(1, 1, 1, 1);
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2 - (height / 2 - 6), height / 2));
|
||||
painter.LineTo(new Vector2(width / 2 - (height / 2), height / 2));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2, height / 2 + (height / 2 - 6)));
|
||||
painter.LineTo(new Vector2(width / 2, height / 2 + (height / 2)));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2 + (height / 2 - 6), height / 2));
|
||||
painter.LineTo(new Vector2(width / 2 + (height / 2), height / 2));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2, height / 2 - (height / 2 - 6)));
|
||||
painter.LineTo(new Vector2(width / 2, height / 2 - (height / 2)));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
Vector2 compassWindDir = new Vector2(windModule.WindDirection.x, -windModule.WindDirection.z);
|
||||
|
||||
painter.strokeColor = Color.red;
|
||||
painter.BeginPath();
|
||||
painter.MoveTo(new Vector2(width / 2, height / 2) + compassWindDir.normalized * (height / 2));
|
||||
painter.LineTo(new Vector2(width / 2, height / 2) + compassWindDir.normalized * (height / 3));
|
||||
painter.Fill(FillRule.NonZero);
|
||||
painter.Stroke();
|
||||
painter.ClosePath();
|
||||
|
||||
};
|
||||
|
||||
Label label = new Label();
|
||||
label.text = $"{Mathf.Round(windModule.windSpeed * windModule.windMultiplier * 10f) / 10f} - {Mathf.Round(windModule.windSpeed * windModule.windMultiplier * 10f) / 10f + windModule.windGusting} kn";
|
||||
label.AddToClassList("h1");
|
||||
|
||||
element.Add(label);
|
||||
|
||||
GraphContainer.Add(element);
|
||||
|
||||
}
|
||||
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/wind-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82712dd188cd53c41a71901927207be7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
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/Editor/UI/Modules/C#/CozyWindModuleEditor.cs
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a026d9aa58e8a854da2ada617b7302ad
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<Graph>
|
||||
<Graph name="distribution-map" style="height: 250px;" />
|
||||
<Graph name="distribution-map-key" style="flex-direction: row; flex-wrap: wrap;" />
|
||||
<Tooltip message="Shows the chances that each profile will play based on the current information. To edit these chances, use the <a href="https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/weighted-random-chance-wrc">WRC system</a> on the ambience profiles." />
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Profiles to Forecast" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="profiles-forecast-container" class="section-bg">
|
||||
<ui:ListView show-add-remove-footer="true" reorderable="true" selection-type="Multiple" reorder-mode="Animated" show-alternating-row-backgrounds="ContentOnly" show-border="true" binding-path="ambienceProfiles" name="ambience-profile-list" show-bound-collection-size="true" class="hide-element-title" />
|
||||
</ui:VisualElement>
|
||||
<ui:Label tabindex="-1" text="Current Information" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="current-information-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5e274647e033bc488059dbf7124114d
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/ambience-module-editor.uxml
|
||||
uploadId: 939148
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Profile" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Label" class="h1" />
|
||||
<Tooltip message="Select a profile to set the atmsophere. The below parameters are editing the global parameters of the profile and will impact other scenes." />
|
||||
<ui:VisualElement name="profile-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48960c371404dfd4bae4aaa9e5ed6507
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/atmosphere-module-editor.uxml
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,5 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Current Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="settings-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8bff3fc9dbb7ed489b2b74a15d8ab7a
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/buto-module-editor.uxml
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,20 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<Graph>
|
||||
<ui:Label tabindex="-1" text="Current Information" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement style="flex-direction: row; justify-content: space-around;">
|
||||
<ui:VisualElement name="current-temperature-widget" class="section-bg" style="height: 65px; flex-grow: 1;">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="value" class="h2" />
|
||||
<ui:VisualElement name="graph" style="flex-grow: 1; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px;" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="current-humidity-widget" class="section-bg" style="height: 65px; flex-grow: 1;">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="value" class="h2" />
|
||||
<ui:VisualElement name="graph" style="flex-grow: 1; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Profile" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="profile-container" class="section-bg" />
|
||||
<ui:Label tabindex="-1" text="Precipitation" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="precipitation-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5387d54fcb1efef44a2e2ff247006cd1
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/climate-module-editor.uxml
|
||||
uploadId: 939148
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Current Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<Tooltip message="Select a profile to set the interactions. The below parameters are editing the global parameters of the profile and will impact other scenes." />
|
||||
<ui:VisualElement name="profile-container" class="section-bg" />
|
||||
<ui:VisualElement name="profile-ui" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 164c13950a46eff4783eadf50039892b
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/interactions-module-editor.uxml
|
||||
uploadId: 939148
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="settings-container" class="section-bg" />
|
||||
<ui:Label tabindex="-1" text="Update Rules" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="update-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7f3342726e095b4a95d973c2946f889
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/microsplat-module-editor.uxml
|
||||
uploadId: 939148
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Selection" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement class="section-bg">
|
||||
<uie:PropertyField binding-path="updateFrequency" />
|
||||
</ui:VisualElement>
|
||||
<ui:Label tabindex="-1" text="Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement class="section-bg">
|
||||
<ui:Label tabindex="-1" text="Base Wind" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
|
||||
<uie:PropertyField binding-path="baseWindPower" />
|
||||
<uie:PropertyField binding-path="baseWindSpeed" />
|
||||
<ui:Label tabindex="-1" text="Wind Bursts" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
|
||||
<uie:PropertyField binding-path="burstsPower" />
|
||||
<uie:PropertyField binding-path="burstsSpeed" />
|
||||
<uie:PropertyField binding-path="burstsScale" />
|
||||
<ui:Label tabindex="-1" text="Micro Wind" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
|
||||
<uie:PropertyField binding-path="microPower" />
|
||||
<uie:PropertyField binding-path="microSpeed" />
|
||||
<uie:PropertyField binding-path="microFrequency" />
|
||||
<ui:Label tabindex="-1" text="Grass" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
|
||||
<uie:PropertyField binding-path="renderDistance" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 18249196652d60e4b95d348c8b43ab2c
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/pure-nature-module-editor.uxml
|
||||
uploadId: 939148
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Update Method" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="update" class="section-bg" />
|
||||
<ui:Label tabindex="-1" text="Rendering" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="rendering" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a99df7c7a8843148bb544c018100977
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/reflections-module-editor.uxml
|
||||
uploadId: 939148
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<ui:Template name="moon-phase-graph" src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Components/UXML/moon-phase-graph.uxml?fileID=9197481963319205126&guid=c9f3cc1dbb9168447bde2fc6f04b6fa2&type=3#moon-phase-graph" />
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<Graph>
|
||||
<ui:Instance template="moon-phase-graph" name="moon-phase-graph" />
|
||||
<ui:VisualElement name="satellite-graph-key" style="flex-grow: 0; height: auto;" />
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Satellite Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="current-satellites-container" class="section-bg" />
|
||||
<Graph>
|
||||
<ui:VisualElement name="orbit-graph" style="flex-grow: 0; height: 250px;" />
|
||||
<ui:VisualElement name="orbit-graph-key" style="flex-grow: 0; height: auto;" />
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Satellites" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="satellite-inspector-container" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c742b22760f38343844abf6676d6645
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/satellite-module-editor.uxml
|
||||
uploadId: 939148
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Current Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement class="section-bg">
|
||||
<uie:PropertyField binding-path="pauseTime" class="mb-md" />
|
||||
<uie:PropertyField binding-path="timeGatherMode" />
|
||||
<uie:PropertyField binding-path="hourOffset" />
|
||||
<uie:PropertyField binding-path="timeMultiplier" />
|
||||
<uie:PropertyField binding-path="dateMultiplier" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4e9c6c970e80a44aae16f8e0506309c
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/system-time-module-editor.uxml
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,7 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Profile" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="profile-container" class="section-bg" />
|
||||
<ui:Label tabindex="-1" text="Current Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="current-settings-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1facb2d045790984ea35d351bff8c2b3
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/time-module-editor.uxml
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,34 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<Graph>
|
||||
<ui:VisualElement name="VisualElement" style="flex-grow: 1; flex-direction: row; flex-shrink: 0;">
|
||||
<ui:VisualElement name="transit-wheel-graph" style="height: 250px; margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0; flex-grow: 1; width: 50%;" />
|
||||
<ui:VisualElement name="transit-wheel-graph-info" style="height: auto; margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0; flex-grow: 1; width: 50%; justify-content: center; align-items: center;" />
|
||||
</ui:VisualElement>
|
||||
<Tooltip message="Relates the sun angle to a specific time. The left chart shows where in the circle of time we are currently, and the right chart shows what time of day each sun position is." style="flex-shrink: 0;" />
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Sun Transit" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="sun-transit-container" class="section-bg" />
|
||||
<Graph>
|
||||
<ui:VisualElement name="current-curve-graph" style="height: 150px; margin-top: 15px; margin-bottom: 15px;" />
|
||||
<Tooltip message="Shows the sun's transit throughout the year. The white line is the current path and the colored paths are the solstices and equinoxes." style="flex-shrink: 0;" />
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Seasonal Variation" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="seasonal-variation-container" class="section-bg" />
|
||||
<Graph>
|
||||
<ui:VisualElement name="time-blocks-graph-context" style="flex-grow: 0; height: 10px; margin-right: 15px; margin-left: 15px; margin-top: 15px; margin-bottom: 5px; flex-shrink: 1;" />
|
||||
<ui:VisualElement name="time-blocks-graph" style="height: 70px; margin-top: 0; margin-bottom: 15px; flex-direction: row; margin-right: 15px; margin-left: 15px; flex-shrink: 1; flex-grow: 0;">
|
||||
<ui:VisualElement name="night1" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
<ui:VisualElement name="dawn" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
<ui:VisualElement name="morning" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
<ui:VisualElement name="day" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
<ui:VisualElement name="afternoon" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
<ui:VisualElement name="evening" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
<ui:VisualElement name="twilight" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
<ui:VisualElement name="night2" style="flex-grow: 1; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px;" />
|
||||
</ui:VisualElement>
|
||||
<Tooltip message="Showcases the time blocks. Each colored band represents a different time block. The darker lines are the end point of the transition into each block." style="flex-shrink: 0;" />
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Time Blocks" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="time-blocks-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99610c0007b753e439ca96f649f59285
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/transit-module-editor.uxml
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,5 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Current Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="current-settings-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9bc33c858cecb21419ebe247ad044f85
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/tve-module-editor.uxml
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,8 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Selection" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="selection-container" class="section-bg">
|
||||
<ui:VisualElement name="dynamic-settings" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="settings-container" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f687d833a514e5b42b6f906e99e07d64
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/weather-module-editor.uxml
|
||||
uploadId: 939148
|
||||
@@ -0,0 +1,24 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<Graph>
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row;">
|
||||
<ui:VisualElement name="graph-container" style="height: 200px; flex-direction: row; align-items: center; justify-content: center; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; width: 50%;" />
|
||||
<ui:VisualElement name="graph-information-container" style="flex-grow: 1; width: 50%;">
|
||||
<ui:VisualElement class="section-bg" style="flex-grow: 1;">
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row; align-items: center; justify-content: flex-start;">
|
||||
<ui:VisualElement style="flex-grow: 0; width: 20px; height: 20px; margin-top: 3px; margin-right: 3px; margin-bottom: 3px; margin-left: 3px; background-image: resource('Icons/Modules/Wind'); flex-shrink: 0;" />
|
||||
<ui:Label tabindex="-1" text="Wind Zone" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
|
||||
</ui:VisualElement>
|
||||
<ui:Label tabindex="-1" text="Direction" parse-escape-sequences="true" display-tooltip-when-elided="true" name="direction" class="p" style="height: 15px;" />
|
||||
<ui:Label tabindex="-1" text="Main Wind" parse-escape-sequences="true" display-tooltip-when-elided="true" name="main-wind" class="p" />
|
||||
<ui:Label tabindex="-1" text="Pulse Magnitude" parse-escape-sequences="true" display-tooltip-when-elided="true" name="pulse-magnitude" class="p" />
|
||||
<ui:Label tabindex="-1" text="Pulse Frequency" parse-escape-sequences="true" display-tooltip-when-elided="true" name="pulse-frequency" class="p" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</Graph>
|
||||
<ui:Label tabindex="-1" text="Selection" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="selection-container" class="section-bg" />
|
||||
<ui:Label tabindex="-1" text="Global Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="global-settings-container" class="section-bg" />
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c26662474cc2fe7429cc02e4a138dd79
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 271742
|
||||
packageName: 'COZY: Stylized Weather 3'
|
||||
packageVersion: 3.6.20
|
||||
assetPath: Packages/com.distantlands.cozy.core/Editor/UI/Modules/UXML/wind-module-editor.uxml
|
||||
uploadId: 939148
|
||||
Reference in New Issue
Block a user