コード例 #1
0
ファイル: AttackComponent.cs プロジェクト: Huxellberger/Cell
        public bool CanAttack(GameObject inTarget)
        {
            if (inTarget != null)
            {
                var currentHoldable = _heldItem.GetHeldItem();
                if (currentHoldable != null)
                {
                    var weaponInterface = currentHoldable.GetHoldableObject().GetComponent <IWeaponInterface>();
                    if (weaponInterface != null)
                    {
                        return(weaponInterface.CanUseWeapon(inTarget));
                    }
                }
            }

            return(false);
        }
コード例 #2
0
 private bool NotHoldingAnything(IHeldItemInterface inHeldItemInterface)
 {
     return(inHeldItemInterface == null || inHeldItemInterface.GetHeldItem() == null);
 }