Cozy Wather + buld systeme

This commit is contained in:
2026-07-07 16:43:51 +02:00
parent 031ac42e5d
commit 6b26ae3376
2140 changed files with 3482825 additions and 2252 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 025f222efa07fb4449f7d8bdf1344d29
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,334 @@
using System;
using System.IO;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
#if COZY_URP
using UnityEngine.Rendering.Universal;
#endif
using UnityEngine.UIElements;
namespace DistantLands.Cozy.EditorScripts
{
public class CozySetupWizard : EditorWindow
{
private VisualElement RenderPipelinePackagesElement => rootVisualElement.Q<VisualElement>("render-pipeline-packages");
private VisualElement ProjectSetupElement => rootVisualElement.Q<VisualElement>("project-setup");
private Button DocumentationElement => rootVisualElement.Q<Button>("documentation");
private Button FaqsElement => rootVisualElement.Q<Button>("faqs");
private Button SupportElement => rootVisualElement.Q<Button>("support");
public CozyWeatherEditor editorWindow;
public static void ShowSetupWizard(CozyWeatherEditor _editorWindow)
{
CozySetupWizard wnd = GetWindow<CozySetupWizard>();
wnd.editorWindow = _editorWindow;
wnd.titleContent = new GUIContent("Project Setup Wizard");
}
public void CreateGUI()
{
// Each editor window contains a root VisualElement object
VisualElement root = rootVisualElement;
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
"Packages/com.distantlands.cozy.core/Editor/UI/Window/UXML/cozy-setup-wizard.uxml"
);
asset.CloneTree(root);
RefreshSetupUI();
RefreshPipelineUI();
DocumentationElement.RegisterCallback((ClickEvent evt) =>
{
CozySceneTools.OpenDocs();
});
SupportElement.RegisterCallback((ClickEvent evt) =>
{
CozySceneTools.OpenDiscord();
});
FaqsElement.RegisterCallback((ClickEvent evt) =>
{
CozySceneTools.OpenFAQs();
});
}
void RefreshPipelineUI()
{
RenderPipelinePackagesElement.Clear();
if (EditorPrefs.GetString("CZY_RP", "") == "")
{
HelpBox help = new HelpBox("Please import a render pipeline support package", HelpBoxMessageType.Warning);
RenderPipelinePackagesElement.Add(help);
}
SetupCheck urpPackage = new SetupCheck("Universal Render Pipeline", "Import", true,
() =>
{
return EditorPrefs.GetString("CZY_RP", "") == "URP";
},
() =>
{
string relativePath = AssetInformation.INTEGRATION_PATH + "Import for URP.unitypackage";
string absolutePath = Path.GetFullPath(relativePath);
Application.OpenURL(absolutePath);
Debug.Log($"Successfully installed COZY v{AssetInformation.INSTALLED_VERSION} for the Universal Render Pipeline.");
EditorPrefs.SetString("CZY_SemVersion", AssetInformation.INSTALLED_VERSION.ToString());
EditorPrefs.SetString("CZY_RP", "URP");
RefreshPipelineUI();
}
);
RenderPipelinePackagesElement.Add(urpPackage);
SetupCheck birpPackage = new SetupCheck("Built-in Render Pipeline", "Import", true,
() =>
{
return EditorPrefs.GetString("CZY_RP", "") == "BiRP";
},
() =>
{
string relativePath = AssetInformation.INTEGRATION_PATH + "Import for BiRP.unitypackage";
string absolutePath = Path.GetFullPath(relativePath);
Application.OpenURL(absolutePath);
Debug.Log($"Successfully installed COZY v{AssetInformation.INSTALLED_VERSION} for the Built-in Render Pipeline.");
EditorPrefs.SetString("CZY_SemVersion", AssetInformation.INSTALLED_VERSION.ToString());
EditorPrefs.SetString("CZY_RP", "BiRP");
RefreshPipelineUI();
}
);
RenderPipelinePackagesElement.Add(birpPackage);
SetupCheck hdrpPackage = new SetupCheck("High Definition Render Pipeline", "Import", true,
() =>
{
return EditorPrefs.GetString("CZY_RP", "") == "HDRP";
},
() =>
{
string relativePath = AssetInformation.INTEGRATION_PATH + "Import for HDRP.unitypackage";
string absolutePath = Path.GetFullPath(relativePath);
Application.OpenURL(absolutePath);
Debug.Log($"Successfully installed COZY v{AssetInformation.INSTALLED_VERSION} for the High Definition Render Pipeline.");
EditorPrefs.SetString("CZY_SemVersion", AssetInformation.INSTALLED_VERSION.ToString());
EditorPrefs.SetString("CZY_RP", "HDRP");
RefreshPipelineUI();
}
);
RenderPipelinePackagesElement.Add(hdrpPackage);
CozyWeatherEditor.instance.UpdateStatusIcon();
}
void RefreshSetupUI()
{
ProjectSetupElement.Clear();
SetupCheck linearColorspace = new SetupCheck("Linear Colorspace", "Resolve",
() =>
{
return PlayerSettings.colorSpace == ColorSpace.Linear;
},
() =>
{
PlayerSettings.colorSpace = ColorSpace.Linear;
RefreshSetupUI();
}
);
ProjectSetupElement.Add(linearColorspace);
#if COZY_URP
SetupCheck depthTexture = new SetupCheck("Depth Texture", "Resolve",
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
if (pipeline.supportsCameraDepthTexture == false)
{
return false;
}
}
return true;
},
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
pipeline.supportsCameraDepthTexture = true;
EditorUtility.SetDirty(pipeline);
}
RefreshSetupUI();
}
);
ProjectSetupElement.Add(depthTexture);
SetupCheck opaqueTexture = new SetupCheck("Opaque Texture", "Resolve",
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
if (pipeline.supportsCameraOpaqueTexture == false)
{
return false;
}
}
return true;
},
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
pipeline.supportsCameraOpaqueTexture = true;
EditorUtility.SetDirty(pipeline);
}
RefreshSetupUI();
}
);
ProjectSetupElement.Add(opaqueTexture);
SetupCheck opaqueDownsampling = new SetupCheck("Opaque Downsampling", "Resolve",
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
if (!(pipeline.opaqueDownsampling == Downsampling.None))
{
return false;
}
}
return true;
},
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
// Loop through all configured render pipelines
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset))
continue;
// Cast the pipeline to the correct type
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
// Get the type of the UniversalRenderPipelineAsset class
Type t = typeof(UniversalRenderPipelineAsset);
// Get the private field using reflection and BindingFlags
FieldInfo fieldInfo = t.GetField("m_OpaqueDownsampling", BindingFlags.NonPublic | BindingFlags.Instance);
// Check if the field was found
if (fieldInfo != null)
{
// Set the value of the private field
fieldInfo.SetValue(pipeline, Downsampling.None);
}
else
{
Debug.LogError("Field 'm_OpaqueDownsampling' not found!");
}
EditorUtility.SetDirty(pipeline);
}
RefreshSetupUI();
}
);
ProjectSetupElement.Add(opaqueDownsampling);
SetupCheck hdrDisabled = new SetupCheck("HDR Enabled", "Resolve",
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
if (!(pipeline.supportsHDR == true))
{
return false;
}
}
return true;
},
() =>
{
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
pipeline.supportsHDR = true;
EditorUtility.SetDirty(pipeline);
}
RefreshSetupUI();
}
);
ProjectSetupElement.Add(hdrDisabled);
#endif
CozyWeatherEditor.instance.UpdateStatusIcon();
}
public static bool CheckStatus
{
get
{
if (EditorPrefs.GetString("CZY_RP", "") == "")
return false;
if (PlayerSettings.colorSpace != ColorSpace.Linear)
return false;
#if COZY_URP
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
if (GraphicsSettings.allConfiguredRenderPipelines[i].GetType() != typeof(UniversalRenderPipelineAsset)) continue;
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
if (pipeline.supportsCameraDepthTexture == false)
{
return false;
}
if (pipeline.supportsCameraOpaqueTexture == false)
{
return false;
}
if (!(pipeline.opaqueDownsampling == Downsampling.None))
{
return false;
}
if (!(pipeline.supportsHDR == true))
{
return false;
}
}
#endif
return true;
}
}
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 6c2f03cb9593ac44487dc29a060649c9
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/Window/C#/CozySetupWizard.cs
uploadId: 939148
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ef902d503cede6b4185af6acbf060604
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -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&amp;guid=60b39676bc45100478c0c8a083850788&amp;type=3#Globals" />
<ui:VisualElement>
<ui:Label tabindex="-1" text="Biomes" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
<ui:VisualElement class="mb-md">
<ui:Button text="New Local Biome" parse-escape-sequences="true" display-tooltip-when-elided="true" name="local-biome" style="flex-grow: 1;" />
<ui:Button text="New Global Biome" parse-escape-sequences="true" display-tooltip-when-elided="true" name="global-biome" style="flex-grow: 1;" />
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement class="mb-md">
<ui:Label tabindex="-1" text="FX Culling" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
<ui:VisualElement>
<ui:Button text="New Fog Culling Zone" parse-escape-sequences="true" display-tooltip-when-elided="true" name="fog-culling" style="flex-grow: 1;" />
<ui:Button text="New FX Block Zone" parse-escape-sequences="true" display-tooltip-when-elided="true" name="fx-block" style="flex-grow: 1;" />
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement>
<ui:Label tabindex="-1" text="Volumes" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
<ui:Button text="New COZY Volume" parse-escape-sequences="true" display-tooltip-when-elided="true" name="volume" style="flex-grow: 1;" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: a60eb4f2916c0554582a5d9a12cdda4c
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/Window/UXML/cozy-scene-tools.uxml
uploadId: 939148
@@ -0,0 +1,18 @@
<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="banner-simple" src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Components/UXML/banner-simple.uxml?fileID=9197481963319205126&amp;guid=874c8018201cb1a4f85a5f0961f429a3&amp;type=3#banner-simple" />
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&amp;guid=60b39676bc45100478c0c8a083850788&amp;type=3#Globals" />
<ui:VisualElement style="flex-grow: 1; background-color: rgb(30, 30, 30);">
<ui:Instance template="banner-simple" name="banner-simple" />
<ui:ScrollView style="flex-grow: 1;">
<ui:Label tabindex="-1" text="Render Pipeline Setup" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
<ui:VisualElement name="render-pipeline-packages" class="pl-4" />
<ui:Label tabindex="-1" text="Project Setup" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
<ui:VisualElement name="project-setup" class="pl-4" />
</ui:ScrollView>
<ui:VisualElement style="flex-grow: 0; flex-direction: row; height: 40px;">
<ui:Button text="Documentation" parse-escape-sequences="true" display-tooltip-when-elided="true" name="documentation" style="flex-grow: 1;" />
<ui:Button text="Support" parse-escape-sequences="true" display-tooltip-when-elided="true" name="support" style="flex-grow: 1;" />
<ui:Button text="FAQs" parse-escape-sequences="true" display-tooltip-when-elided="true" name="faqs" style="flex-grow: 1;" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: e220674ac7682c04c9af0ee75e3dd044
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/Window/UXML/cozy-setup-wizard.uxml
uploadId: 939148
@@ -0,0 +1,12 @@
<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&amp;guid=60b39676bc45100478c0c8a083850788&amp;type=3#Globals" />
<ui:VisualElement>
<ui:Label tabindex="-1" text="Time" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h2" />
<ui:VisualElement class="section-bg" style="flex-grow: 1;">
<ui:Label tabindex="-1" text="Time" parse-escape-sequences="true" display-tooltip-when-elided="true" style="-unity-font-style: bold;" />
<ui:Slider high-value="1" name="time" show-input-field="true" />
<ui:IntegerField label="Day" value="42" name="day" />
<ui:IntegerField label="Year" value="42" name="year" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: e82abc86aeacbc546a9273835c58c369
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/Window/UXML/cozy-time-tools.uxml
uploadId: 939148