update for unity

This commit is contained in:
Mikhail 2023-12-31 23:26:56 +08:00
parent 16b273d5e4
commit e3c7aa8aac
7 changed files with 40 additions and 6 deletions

8
src/Collections.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e026d1a6d4fd884ea7324b6097703c5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -93,10 +93,10 @@ namespace DCFApixels.DragonECS
#region Object
#pragma warning disable CS0809 // Устаревший член переопределяет неустаревший член
[Obsolete($"Equals() on {nameof(EcsSpan)} will always throw an exception. Use the equality operator instead.")]
[Obsolete("Equals() on EcsSpan will always throw an exception. Use the equality operator instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => throw new NotSupportedException();
[Obsolete($"GetHashCode() on {nameof(EcsSpan)} will always throw an exception.")]
[Obsolete("GetHashCode() on EcsSpan will always throw an exception.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => throw new NotSupportedException();
#pragma warning restore CS0809 // Устаревший член переопределяет неустаревший член

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2356ad2f91cd0a84db3d572a9f3c33f5
guid: 55c6215b2c0f45849b191532a01e1dfe
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -340,13 +340,13 @@ namespace DCFApixels.DragonECS
#region ReflectionExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool TryGetCustomAttribute<T>(this Type self, out T attribute) where T : Attribute
public static bool TryGetCustomAttribute<T>(this Type self, out T attribute) where T : Attribute
{
attribute = self.GetCustomAttribute<T>();
return attribute != null;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool TryGetCustomAttribute<T>(this MemberInfo self, out T attribute) where T : Attribute
public static bool TryGetCustomAttribute<T>(this MemberInfo self, out T attribute) where T : Attribute
{
attribute = self.GetCustomAttribute<T>();
return attribute != null;

View File

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

View File

@ -10,7 +10,7 @@ namespace DCFApixels.DragonECS
public byte R => color.r;
public byte G => color.g;
public byte B => color.b;
public float FloatT => R / (float)byte.MaxValue;
public float FloatR => R / (float)byte.MaxValue;
public float FloatG => G / (float)byte.MaxValue;
public float FloatB => B / (float)byte.MaxValue;
public MetaColorAttribute(byte r, byte g, byte b) => color = new MetaColor(r, g, b, 255);
@ -69,6 +69,10 @@ namespace DCFApixels.DragonECS
[FieldOffset(2)] public readonly byte g;
[FieldOffset(1)] public readonly byte b;
[FieldOffset(0)] public readonly byte a;
public float FloatR => r / (float)byte.MaxValue;
public float FloatG => g / (float)byte.MaxValue;
public float FloatB => b / (float)byte.MaxValue;
public float FloatA => a / (float)byte.MaxValue;
public MetaColor(byte r, byte g, byte b) : this()
{
this.r = r;

View File

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