mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2026-07-31 07:29:02 +02:00
Fuck nothing works
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user