This commit is contained in:
CortexCore
2023-09-01 14:33:54 +08:00
parent 4fadd3a530
commit 8ef5c7ec0a
451 changed files with 1048940 additions and 2028 deletions

View File

@@ -5,14 +5,15 @@ using Unity.Mathematics;
using BITKit;
using System.IO;
using System;
// ReSharper disable UnassignedField.Global
namespace BITFALL
{
[Serializable]
public record ItemWeight : IProperty
{
public float Weight=1;
public static implicit operator float(ItemWeight self)
public double Weight=1;
public static implicit operator double(ItemWeight self)
{
return self.Weight;
}
@@ -31,49 +32,49 @@ namespace BITFALL
{
#region
[Header(Constant.Header.Settings)]
[SerializeField] string displayName;
[SerializeField] string description;
[SerializeField] string adressablePath;
[SerializeField] WorldableItem prefab;
[SerializeField] Texture2D squareIcon;
[SerializeField] Texture2D rectangleIcon;
[SerializeField] ItemQuality quality;
[SerializeField] private string displayName;
[SerializeField] private string description;
[SerializeField] private string addressablePath;
[SerializeField] private WorldableItem prefab;
[SerializeField] private Texture2D squareIcon;
[SerializeField] private Texture2D rectangleIcon;
[SerializeField] private ItemQuality quality;
[Header(Constant.Header.Property)]
[SerializeReference, SubclassSelector] public IProperty[] factoryProperties;
Property property => new(factoryProperties);
private Property property => new(factoryProperties);
#endregion
#region
public int Id => -1;
public ItemQuality Quality => quality;
public string Name => displayName;
public string Description => description;
public string AdressablePath => adressablePath;
public string AddressablePath => addressablePath;
public bool Contains<T>() => property.Contains<T>();
public T GetOrAddProperty<T>(Func<T> addFactory) =>throw new NotImplementedException("资产不支持动态更改");
public T GetOrCreateProperty<T>() => throw new NotImplementedException("资产不支持动态更改");
public object[] GetProperties() => property.GetProperties();
public bool TryGetProperty<T>(out T value) => property.TryGetProperty(out value);
public bool TryRemoveProperty<T>() => throw new NotImplementedException("资产不支持动态更改");
public bool TrySetProperty<T>(T value) => throw new NotImplementedException();
public bool TrySetProperty<T>(T value) => throw new NotImplementedException("资产不支持动态更改");
public void Read(BinaryReader r)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public void Write(BinaryWriter w)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public bool CopyItemsFrom(IBasicItem item)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public bool ClearProperties()
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
public bool CopyPropertiesFrom(IPropertable propertable)
{
throw new NotImplementedException();
throw new NotImplementedException("资产不支持动态更改");
}
#endregion
#region

View File

@@ -10,7 +10,7 @@ namespace BITKit
{
public static AssetableItem GetAssetable(this IBasicItem self)
{
return Addressables.LoadAssetAsync<AssetableItem>(self.AdressablePath).WaitForCompletion();
return Addressables.LoadAssetAsync<AssetableItem>(self.AddressablePath).WaitForCompletion();
}
}
}

View File

@@ -21,7 +21,7 @@ namespace BITFALL
public string Name => asset.name;
public string Description => asset.Description;
public ItemQuality Quality => asset.Quality;
public string AdressablePath => asset.AdressablePath;
public string AddressablePath => asset.AddressablePath;
private readonly Property property = new();
public bool Contains<T>() => property.Contains<T>();
@@ -50,7 +50,7 @@ namespace BITFALL
{
if(item is SerializableItem serializableItem)
{
asset = Addressables.LoadAssetAsync<AssetableItem>(item.AdressablePath).WaitForCompletion();
asset = Addressables.LoadAssetAsync<AssetableItem>(item.AddressablePath).WaitForCompletion();
}
return true;
}