This commit is contained in:
CortexCore
2023-12-03 17:35:43 +08:00
parent ba342d6627
commit ba9f4eda80
702 changed files with 162078 additions and 21050 deletions

View File

@@ -17,7 +17,13 @@ namespace BITFALL
bool TryUse(IBasicItem item);
void OnUse(IBasicItem item);
}
/// <summary>
/// 计数器
/// </summary>
public interface ICount
{
int Count { get; }
}
[Serializable]
public record ItemWeight : IProperty
{
@@ -57,7 +63,8 @@ namespace BITFALL
/// </summary>
[SerializeField] private bool allowUseWhileKnocked;
[Header(Constant.Header.Property)]
[SerializeReference, SubclassSelector] public IProperty[] factoryProperties;
[SerializeReference, SubclassSelector] private IProperty[] factoryProperties;
[SerializeReference, SubclassSelector] private IProperty[] runtimeProperties;
private Property property => new(factoryProperties);
#endregion
#region
@@ -101,6 +108,19 @@ namespace BITFALL
public WorldItem GetPrefab() => prefab;
public Texture2D SquareIcon => squareIcon;
public Texture2D RectangleIcon=>rectangleIcon;
public IProperty[] RuntimeProperties => runtimeProperties;
#endregion
public object Clone()
{
var item = new ManagedItem();
item.CopyItemsFrom(this);
item.Id = Guid.NewGuid().GetHashCode();
foreach (var x in runtimeProperties)
{
item.GetOrAddProperty(()=>x);
}
return item;
}
}
}