升级6.4.升级水,升级天气

This commit is contained in:
2026-04-05 00:26:54 +08:00
parent 63bc9b5536
commit 5f7cbfb713
635 changed files with 34718 additions and 22567 deletions

View File

@@ -99,11 +99,22 @@ namespace WaveHarmonic.Crest
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
abstract class Decorator : PropertyAttribute { }
[Conditional(Symbols.k_UnityEditor)]
sealed class Order : Decorator
{
public enum Placement { Heading, Below, Above }
public Order(string target, Placement placement = Placement.Heading) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Layer : Decorator { }
[Conditional(Symbols.k_UnityEditor)]
sealed class Stripped : Decorator { }
sealed class Stripped : Decorator
{
public enum Style { None, PlatformTab, }
public Stripped(Style style = Style.None, bool indent = false) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Delayed : Decorator { }
@@ -111,6 +122,18 @@ namespace WaveHarmonic.Crest
[Conditional(Symbols.k_UnityEditor)]
sealed class Disabled : Decorator { }
[Conditional(Symbols.k_UnityEditor)]
sealed class Required : Attribute { }
[Conditional(Symbols.k_UnityEditor)]
sealed class PlatformTabs : Attribute { }
[Conditional(Symbols.k_UnityEditor)]
sealed class CustomField : Attribute { }
[Conditional(Symbols.k_UnityEditor)]
sealed class CustomLabel : Attribute { }
[Conditional(Symbols.k_UnityEditor)]
sealed class AttachMaterialEditor : Attribute
{
@@ -153,25 +176,25 @@ namespace WaveHarmonic.Crest
{
[Flags]
public enum Clamp { None = 0, Minimum = 1, Maximum = 2, Both = Minimum | Maximum }
public Range(float minimum, float maximum, Clamp clamp = Clamp.Both, float scale = 1f, bool delayed = false, int step = 0, bool power = false) {}
public Range(float minimum, float maximum, Clamp clamp = Clamp.Both, float scale = 1f, bool delayed = false, int step = 0, bool power = false) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Minimum : Decorator
{
public Minimum(float minimum) {}
public Minimum(float minimum) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Maximum : Decorator
{
public Maximum(float maximum) {}
public Maximum(float maximum) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class WarnIfAbove : Decorator
{
public WarnIfAbove(float maximum) {}
public WarnIfAbove(float maximum) { }
}
[Conditional(Symbols.k_UnityEditor)]
@@ -207,12 +230,47 @@ namespace WaveHarmonic.Crest
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Predicated : Decorator
sealed class Show : Decorator
{
public Predicated(Type type, string member, bool inverted = false, bool hide = false) { }
public Predicated(Type type, bool inverted = false, bool hide = false) { }
public Predicated(string property, bool inverted = false, object disableValue = null, bool hide = false) { }
public Predicated(RenderPipeline rp, bool inverted = false, bool hide = false) { }
public Show(Type type, string member, object value) { }
public Show(Type type, string member) { }
public Show(Type type) { }
public Show(string property) { }
public Show(string property, object value) { }
public Show(RenderPipeline rp) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Hide : Decorator
{
public Hide(Type type, string member, object value) { }
public Hide(Type type, string member) { }
public Hide(Type type) { }
public Hide(string property) { }
public Hide(string property, object value) { }
public Hide(RenderPipeline rp) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Enable : Decorator
{
public Enable(Type type, string member, object value) { }
public Enable(Type type, string member) { }
public Enable(Type type) { }
public Enable(string property) { }
public Enable(string property, object value) { }
public Enable(RenderPipeline rp) { }
}
[Conditional(Symbols.k_UnityEditor)]
sealed class Disable : Decorator
{
public Disable(Type type, string member, object value) { }
public Disable(Type type, string member) { }
public Disable(Type type) { }
public Disable(string property) { }
public Disable(string property, object value) { }
public Disable(RenderPipeline rp) { }
}
[Conditional(Symbols.k_UnityEditor)]

View File

@@ -1,9 +1,10 @@
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
#if UNITY_EDITOR
using MonoBehaviour = WaveHarmonic.Crest.Internal.EditorBehaviour;
#else
using MonoBehaviour = UnityEngine.MonoBehaviour;
@@ -14,7 +15,7 @@ namespace WaveHarmonic.Crest.Internal
/// <summary>
/// Implements logic to smooth out Unity's wrinkles.
/// </summary>
public abstract class CustomBehaviour : MonoBehaviour
public abstract partial class CustomBehaviour : MonoBehaviour
{
bool _AfterStart;
@@ -71,11 +72,46 @@ namespace WaveHarmonic.Crest.Internal
[InitializeOnEnterPlayMode]
static void OnEnterPlayModeInEditor(EnterPlayModeOptions options)
{
foreach (var @object in FindObjectsByType<CustomBehaviour>(FindObjectsInactive.Include, FindObjectsSortMode.None))
foreach (var @object in Helpers.FindObjectsByType<CustomBehaviour>(FindObjectsInactive.Include))
{
@object._AfterStart = false;
}
}
#endif
}
partial class CustomBehaviour : ISerializationCallbackReceiver
{
#pragma warning disable 414
[@SerializeField, @HideInInspector]
private protected int _Version;
#pragma warning restore 414
private protected virtual int Version => 0;
private protected CustomBehaviour()
{
// Sets the default version. Overriden by serialized field above.
_Version = Version;
}
private protected virtual void OnMigrate()
{
}
void ISerializationCallbackReceiver.OnBeforeSerialize()
{
if (_Version < Version)
{
OnMigrate();
_Version = Version;
}
}
void ISerializationCallbackReceiver.OnAfterDeserialize()
{
}
}
}

View File

@@ -0,0 +1,50 @@
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
using UnityEngine;
namespace WaveHarmonic.Crest.Internal
{
/// <summary>
/// Implements logic to smooth out Unity's wrinkles.
/// </summary>
public abstract partial class CustomScriptableObject : ScriptableObject
{
}
partial class CustomScriptableObject : ISerializationCallbackReceiver
{
#pragma warning disable 414
[@SerializeField, @HideInInspector]
private protected int _Version;
#pragma warning restore 414
private protected virtual int Version => 0;
private protected CustomScriptableObject()
{
// Sets the default version. Overriden by serialized field above.
_Version = Version;
}
private protected virtual void OnMigrate()
{
}
void ISerializationCallbackReceiver.OnBeforeSerialize()
{
if (_Version < Version)
{
OnMigrate();
_Version = Version;
}
}
void ISerializationCallbackReceiver.OnAfterDeserialize()
{
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9b6e085d4815447e4bb6dc81c0c8e2ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -98,7 +98,7 @@ namespace WaveHarmonic.Crest.Internal
// When singleton, destroy instance objects.
if (enableInEditMode && attribute._Options.HasFlag(ExecuteDuringEditMode.Options.Singleton) &&
FindObjectsByType(GetType(), FindObjectsSortMode.None).Length > 1)
Helpers.FindObjectsByType(GetType()).Length > 1)
{
enableInEditMode = false;
EditorApplication.update -= InternalDestroyNonSaveables;

View File

@@ -61,7 +61,7 @@ namespace WaveHarmonic.Crest.Internal
internal static void AfterScriptReload()
{
Instance = FindFirstObjectByType<T>();
Instance = FindAnyObjectByType<T>();
}
}