Fuck nothing works

This commit is contained in:
juliuse98
2021-11-11 09:08:18 +01:00
parent ea8394bd16
commit 2f530971c0
28 changed files with 3198 additions and 305 deletions

View File

@@ -6,7 +6,7 @@ using Mirror;
public class Shoot : NetworkBehaviour
{
[SerializeField] GameObject muzzle;
[SerializeField] ShootAnimation shootAnim;
[SerializeField] ProcedualAnimationController procedualAnimationController;
[SerializeField] float fireRate;
[SerializeField] GameObject gunHoldPos;
@@ -14,7 +14,7 @@ public class Shoot : NetworkBehaviour
{
if (isLocalPlayer)
{
shootAnim.OnSwitchWeapon(fireRate);
procedualAnimationController.OnSwitchWeapon(fireRate);
}
}
private void Update()
@@ -53,6 +53,7 @@ public class Shoot : NetworkBehaviour
// This code will be executed on the Client.
void shootAnimation()
{
shootAnim.recoil(gunHoldPos,0.1f);
Debug.Log("Shooot animation in shoot script");
procedualAnimationController.Recoil(0.1f);
}
}

View File

@@ -4,6 +4,10 @@ using UnityEngine;
public class ShootAnimation : MonoBehaviour
{
[Header("Step Settings")]
[SerializeField] private float stepAmplitude;
[SerializeField] private float stepFrequency;
private float stepSin;
[Header("GameObjects")]
[SerializeField] private GameObject gun;
@@ -68,7 +72,7 @@ public class ShootAnimation : MonoBehaviour
}
public void recoil(GameObject gun, float force)
public void recoil(float force)
{
//Play the animation
anim.Play("Shoot");