Reload animation fertig

This commit is contained in:
pbg2h23akl
2024-08-23 11:38:28 +02:00
parent 6273ebc082
commit bf48815336
9 changed files with 499 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Animations;
using UnityEngine;
public class WeaponScript : MonoBehaviour
@@ -22,9 +23,12 @@ public class WeaponScript : MonoBehaviour
private bool delayOver = true;
public float schussInterval;
private float delay = 0;
public Animator animator;
public void checkReload(){
if(ammo == 0 || Input.GetKeyDown(inputManagerScript.getReload())){
isReloading = true;
animator.Play("Reloadanim");
}
if(isReloading){
time += Time.deltaTime;
@@ -33,6 +37,7 @@ public class WeaponScript : MonoBehaviour
uI_Manager.ammoReset();
time = 0;
isReloading = false;
//animator.SetBool("isReloading",false);
}
}
}