1
This commit is contained in:
@@ -77,12 +77,12 @@ namespace BITFALL.Guns
|
||||
{
|
||||
[Header(nameof(AssetableGun))]
|
||||
[SerializeReference, SubclassSelector] protected IFireMode fireMode;
|
||||
|
||||
[SerializeField] private int initialDamage;
|
||||
|
||||
[SerializeField] private int initialBulletForce;
|
||||
[SerializeField] private int initialBulletSpeed = 128;
|
||||
public IFireMode FireMode => fireMode;
|
||||
public int InitialBulletForce => initialBulletForce;
|
||||
public int InitialDamage => initialDamage;
|
||||
public int InitialBulletSpeed => initialBulletSpeed;
|
||||
}
|
||||
}
|
@@ -39,12 +39,14 @@ namespace BITFALL
|
||||
[SerializeField] private Texture2D squareIcon;
|
||||
[SerializeField] private Texture2D rectangleIcon;
|
||||
[SerializeField] private ItemQuality quality;
|
||||
[SerializeField] private bool isImprovised;
|
||||
[Header(Constant.Header.Property)]
|
||||
[SerializeReference, SubclassSelector] public IProperty[] factoryProperties;
|
||||
private Property property => new(factoryProperties);
|
||||
#endregion
|
||||
#region 接口实现
|
||||
public int Id => -1;
|
||||
public bool IsImprovised => isImprovised;
|
||||
public ItemQuality Quality => quality;
|
||||
public string Name => displayName;
|
||||
public string Description => description;
|
||||
|
@@ -8,6 +8,7 @@ namespace BITFALL.Items
|
||||
{
|
||||
[SerializeField] private Transform instance;
|
||||
|
||||
public Transform Prefab => instance;
|
||||
public Transform GetInstance()
|
||||
{
|
||||
return Instantiate(instance);
|
||||
|
@@ -15,8 +15,6 @@ namespace BITFALL
|
||||
#region 本地字段
|
||||
[Header(Constant.Header.Settings)]
|
||||
[SerializeField]private AssetableItem asset;
|
||||
|
||||
private new Rigidbody _rigidbody;
|
||||
#endregion
|
||||
#region 接口实现
|
||||
public int Id => GetInstanceID();
|
||||
@@ -61,30 +59,16 @@ namespace BITFALL
|
||||
#endregion
|
||||
#region 本地方法
|
||||
public AssetableItem Assetable => asset;
|
||||
private void Start()
|
||||
{
|
||||
_rigidbody = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (!_rigidbody.IsSleeping()) return;
|
||||
_rigidbody.isKinematic = true;
|
||||
enabled = false;
|
||||
}
|
||||
public ManagedItem Pick()
|
||||
{
|
||||
var newitem = new ManagedItem();
|
||||
newitem.CopyItemsFrom(this);
|
||||
return newitem;
|
||||
var managedItem = new ManagedItem();
|
||||
managedItem.CopyItemsFrom(this);
|
||||
return managedItem;
|
||||
}
|
||||
public void Picked()
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
|
Reference in New Issue
Block a user