started building logics for enemy

This commit is contained in:
Mausham
2025-12-30 22:51:33 +05:45
parent b59d12631f
commit 3aabc42bf8
76 changed files with 9832 additions and 82084 deletions

View File

@@ -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);
}
}
}