mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 20:52:10 +01:00
29 lines
601 B
C#
29 lines
601 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ShootAnimation : MonoBehaviour
|
|
{
|
|
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()
|
|
{
|
|
|
|
}
|
|
}
|