Reload animation speed ist nun abhängig von der Reload time und weiter bugs fixed vom Reloaden davor + Sky box added (schöner)

This commit is contained in:
pbg2h23akl
2024-08-28 12:50:22 +02:00
parent bf48815336
commit 10ce648dda
113 changed files with 4954 additions and 16 deletions

View File

@@ -28,7 +28,6 @@ public class WeaponScript : MonoBehaviour
public void checkReload(){
if(ammo == 0 || Input.GetKeyDown(inputManagerScript.getReload())){
isReloading = true;
animator.Play("Reloadanim");
}
if(isReloading){
time += Time.deltaTime;
@@ -40,6 +39,8 @@ public class WeaponScript : MonoBehaviour
//animator.SetBool("isReloading",false);
}
}
animator.SetFloat("speed",1 / reloadTime);
animator.SetBool("isReloading",isReloading);
}
public void shoot(){
if(!isReloading && delayOver){
@@ -69,6 +70,7 @@ public class WeaponScript : MonoBehaviour
spawnpoint = GameObject.Find("Player/PlayerView/BulletSpawnpoint");
uI_Manager = GameObject.FindGameObjectWithTag("Manager").GetComponent<UI_Manager>();
inputManagerScript = GameObject.Find("InputManager").GetComponent<InputManagerScript>();
}
// Update is called once per frame