1
This commit is contained in:
@@ -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