1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user