started building logics for enemy
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Darkmatter.Domain
|
||||
[Inject] public readonly IPlayerAnim playerAnim;
|
||||
[Inject] public readonly ITargetProvider targetProvider;
|
||||
[Inject] public readonly ICameraService cameraService;
|
||||
[Inject] public readonly IWeapon GunWeapon;
|
||||
[Inject] public readonly IReloadableWeapon currentWeapon;
|
||||
[Inject] public readonly PlayerConfigSO playerConfig;
|
||||
[Inject] public readonly CameraConfigSO cameraConfig;
|
||||
|
||||
@@ -54,23 +54,23 @@ namespace Darkmatter.Domain
|
||||
public void Shoot(bool isShooting)
|
||||
{
|
||||
if (!isShooting) return;
|
||||
if(GunWeapon.canAttack)
|
||||
if(currentWeapon.canAttack)
|
||||
{
|
||||
GunWeapon.Attack();
|
||||
currentWeapon.Attack();
|
||||
}
|
||||
if(GunWeapon.AmmoCount==0)
|
||||
if (currentWeapon.AmmoCount == 0)
|
||||
{
|
||||
playerAnim.PlayReloadAnim(GunWeapon);
|
||||
playerAnim.PlayReloadAnim(currentWeapon);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Reload()
|
||||
{
|
||||
if(GunWeapon.AmmoCount < GunWeapon.maxAmmoCount)
|
||||
if(currentWeapon.AmmoCount<currentWeapon.initialAmmoCount)
|
||||
{
|
||||
playerAnim.PlayReloadAnim(GunWeapon);
|
||||
playerAnim.PlayReloadAnim(currentWeapon);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user