コード例 #1
0
ファイル: Character.cs プロジェクト: Demy/Forest-View
    private void ReplaceInHand(InventoryItem item)
    {
        EquipmentItem equip = Instantiate(item.wearable, bodyTop).GetComponent <EquipmentItem>();

        if (rightHand != null)
        {
            rightHand.OnHit -= OnWeaponHit;
            rightHand.Drop();
            Destroy(rightHand.gameObject);
        }
        equip.OnHit += OnWeaponHit;
        rightHand    = equip;
    }