This commit is contained in:
CortexCore
2023-10-29 15:27:13 +08:00
parent c5f638d9d2
commit c7b6ddbf70
73 changed files with 2158 additions and 494 deletions

View File

@@ -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