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

@@ -0,0 +1,19 @@
using UnityEngine;
namespace Darkmatter.Presentation
{
public class EnemyAnimationController : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2db86e800d68dad4d98796670a91a679

View File

@@ -16,27 +16,27 @@ namespace Darkmatter.Presentation
public TwoBoneIKConstraint HandOnGunIK; //for gunHand Ik
private Coroutine reloadCoroutine;
public void PlayReloadAnim(IWeapon currentWeapon)
public void PlayReloadAnim(IReloadableWeapon reloadableWeapon)
{
if (reloadCoroutine == null)
{
reloadCoroutine = StartCoroutine(ReloadRoutine(currentWeapon));
reloadCoroutine = StartCoroutine(ReloadRoutine(reloadableWeapon));
}
}
IEnumerator ReloadRoutine(IWeapon currentWeapon)
IEnumerator ReloadRoutine(IReloadableWeapon reloadableWeapon)
{
reloadableWeapon.isReloading = true;
yield return BlendLayerWeight(1, 1, 0.2f);
//animator.SetLayerWeight(1,1);
HandOnGunIK.weight = 0f;
animator.SetTrigger(reloadHash);
yield return new WaitForSeconds(3f); //gave the length of the animation very bad practice
// animator.SetLayerWeight(1, 0);
yield return BlendLayerWeight(1, 0, 0.2f);
HandOnGunIK.weight = 1f;
currentWeapon.Reload();
reloadableWeapon.Reload();
reloadableWeapon.isReloading = false;
reloadCoroutine = null;
}