升级6.4.升级水,升级天气
This commit is contained in:
@@ -10,6 +10,9 @@ using WaveHarmonic.Crest.Editor.Settings;
|
||||
|
||||
namespace WaveHarmonic.Crest.Editor
|
||||
{
|
||||
[System.AttributeUsage(System.AttributeTargets.Class)]
|
||||
sealed class GenerateShaderSettings : System.Attribute { }
|
||||
|
||||
static class ShaderSettingsGenerator
|
||||
{
|
||||
[DidReloadScripts]
|
||||
@@ -51,7 +54,7 @@ namespace WaveHarmonic.Crest.Editor
|
||||
|
||||
sealed class AssetPostProcessor : AssetPostprocessor
|
||||
{
|
||||
const string k_SettingsPath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest.hlsl";
|
||||
const string k_SettingsPath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/";
|
||||
|
||||
static async void OnPostprocessAllAssets(string[] imported, string[] deleted, string[] movedTo, string[] movedFrom, bool domainReload)
|
||||
{
|
||||
@@ -61,7 +64,7 @@ namespace WaveHarmonic.Crest.Editor
|
||||
if (EditorApplication.isCompiling)
|
||||
{
|
||||
#if CREST_DEBUG
|
||||
if (imported.Contains(k_SettingsPath))
|
||||
if (imported.Count(x => x.StartsWithNoAlloc(k_SettingsPath)) > 0)
|
||||
{
|
||||
UnityEngine.Debug.Log($"Crest: Settings.Crest.hlsl changed during compilation!");
|
||||
}
|
||||
@@ -72,7 +75,7 @@ namespace WaveHarmonic.Crest.Editor
|
||||
if (EditorApplication.isUpdating)
|
||||
{
|
||||
#if CREST_DEBUG
|
||||
if (imported.Contains(k_SettingsPath))
|
||||
if (imported.Count(x => x.StartsWithNoAlloc(k_SettingsPath)) > 0)
|
||||
{
|
||||
UnityEngine.Debug.Log($"Crest: Settings.Crest.hlsl changed during asset database update!");
|
||||
}
|
||||
@@ -81,7 +84,7 @@ namespace WaveHarmonic.Crest.Editor
|
||||
}
|
||||
|
||||
// Regenerate if file changed like re-importing.
|
||||
if (imported.Contains(k_SettingsPath))
|
||||
if (imported.Count(x => x.StartsWithNoAlloc(k_SettingsPath)) > 0)
|
||||
{
|
||||
#if CREST_DEBUG
|
||||
UnityEngine.Debug.Log($"Crest: Settings.Crest.hlsl changed!");
|
||||
@@ -94,7 +97,7 @@ namespace WaveHarmonic.Crest.Editor
|
||||
}
|
||||
}
|
||||
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings.Crest")]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest")]
|
||||
sealed class ShaderSettings
|
||||
{
|
||||
// These two are here for compute shaders.
|
||||
@@ -126,10 +129,111 @@ namespace WaveHarmonic.Crest.Editor
|
||||
#endif
|
||||
;
|
||||
|
||||
// Active when build target is activated:
|
||||
// https://docs.unity3d.com/6000.3/Documentation/Manual/scripting-symbol-reference.html
|
||||
|
||||
public static int s_CrestPlatformStandalone =
|
||||
#if PLATFORM_STANDALONE
|
||||
1 +
|
||||
#endif
|
||||
0;
|
||||
|
||||
public static int s_CrestPlatformServer =
|
||||
#if PLATFORM_SERVER
|
||||
1 +
|
||||
#endif
|
||||
0;
|
||||
|
||||
public static int s_CrestPlatformAndroid =
|
||||
#if PLATFORM_ANDROID
|
||||
1 +
|
||||
#endif
|
||||
0;
|
||||
|
||||
public static int s_CrestPlatformIOS =
|
||||
#if PLATFORM_IOS
|
||||
1 +
|
||||
#endif
|
||||
0;
|
||||
|
||||
public static int s_CrestPlatformWeb =
|
||||
#if PLATFORM_WEBGL
|
||||
1 +
|
||||
#endif
|
||||
0;
|
||||
|
||||
public static int s_CrestPlatformTVOS =
|
||||
#if PLATFORM_TVOS
|
||||
1 +
|
||||
#endif
|
||||
0;
|
||||
|
||||
public static int s_CrestPlatformVISIONOS =
|
||||
#if PLATFORM_VISIONOS
|
||||
1 +
|
||||
#endif
|
||||
0;
|
||||
|
||||
public static int s_CrestFullPrecisionDisplacement = ProjectSettings.Instance.FullPrecisionDisplacementOnHalfPrecisionPlatforms ? 1 : 0;
|
||||
|
||||
public static int s_CrestDiscardAtmosphericScattering = ProjectSettings.Instance.RenderAtmosphericScatteringWhenUnderWater ? 0 : 1;
|
||||
|
||||
public static int s_CrestLegacyUnderwater = ProjectSettings.Instance.LegacyUnderwater ? 1 : 0;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.Default")]
|
||||
sealed partial class ShaderSettingsDefault
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettings;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.Standalone")]
|
||||
sealed partial class ShaderSettingsStandalone
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettingsDesktop;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.Server")]
|
||||
sealed partial class ShaderSettingsServer
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettingsServer;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.Android")]
|
||||
sealed partial class ShaderSettingsAndroid
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettingsAndroid;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.iOS")]
|
||||
sealed partial class ShaderSettingsIOS
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettingsIOS;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.Web")]
|
||||
sealed partial class ShaderSettingsWeb
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettingsWeb;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.tvOS")]
|
||||
sealed partial class ShaderSettingsTVOS
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettingsTVOS;
|
||||
}
|
||||
|
||||
[@GenerateShaderSettings]
|
||||
[GenerateHLSL(sourcePath = "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Settings/Settings.Crest.visionOS")]
|
||||
sealed partial class ShaderSettingsVisionOS
|
||||
{
|
||||
static PlatformSettings Settings => ProjectSettings.Instance._PlatformSettingsVisionOS;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user