Reload animation fertig
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user