started building logics for enemy
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user