mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 13:07:10 +01:00
Gun holding with inverse kinematics
This commit is contained in:
@@ -4,12 +4,22 @@ using UnityEngine;
|
||||
|
||||
public class ShootAnimation : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
private Animator anim;
|
||||
[SerializeField]private GameObject gun;
|
||||
void Start()
|
||||
{
|
||||
|
||||
anim = gun.GetComponent<Animator>();
|
||||
}
|
||||
|
||||
void OnSwitchWeapon(GameObject newGun)
|
||||
{
|
||||
gun = newGun;
|
||||
anim = gun.GetComponent<Animator>();
|
||||
}
|
||||
public void StartShootAnimation(float timeInSeconds)
|
||||
{
|
||||
anim.PlayInFixedTime("Shoot", 0, timeInSeconds);
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user