コード例 #1
0
    private void OnTriggerEnter(Collider other)
    {
        var findingPickUpItem = other.GetComponent <IPickUpItem>();

        if (findingPickUpItem != null)
        {
            PickUpEvent?.Invoke(findingPickUpItem);
        }
    }
コード例 #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("PickUp") && canPickUp)
     {
         PickUp    pickUpItem     = other.GetComponent <PickUp>();
         ItemGroup extraItemGroup = null;
         backpack.TryPutIn(pickUpItem.itemGroup, out extraItemGroup);
         PickUpEvent?.Invoke(this, new PickUpEventDate(pickUpItem, attrManager.faction));
     }
 }