コード例 #1
0
 public override void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.GetComponent <PlayerController>())
     {
         sharedInventory.AddItem(item);
         EventPickUp.Invoke();
         Destroy(this.gameObject);
     }
 }
コード例 #2
0
 public override void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.GetComponent <PlayerController>())
     {
         col.gameObject.GetComponent <PlayerStats>().AddCurrency(Amount);
         EventPickUp.Invoke();
         Destroy(this.gameObject);
     }
 }