StationObscurum/Assets/Scripts/Enemies/DummyComponent.cs

22 lines
478 B
C#
Raw Normal View History

2023-04-04 06:04:34 +02:00
using UnityEngine;
public class DummyComponent : MonoBehaviour
{
private Animator anim;
2023-06-01 17:03:48 +02:00
2023-04-04 06:04:34 +02:00
// Start is called before the first frame update
2023-06-01 17:03:48 +02:00
private void Start()
2023-04-04 06:04:34 +02:00
{
2023-06-01 17:03:48 +02:00
anim = GetComponentInParent<Animator>();
2023-04-04 06:04:34 +02:00
}
// Update is called once per frame
2023-06-01 17:03:48 +02:00
private void Update()
2023-04-04 06:04:34 +02:00
{
}
private void OnCollisionEnter(Collision collision)
{
2023-06-01 17:03:48 +02:00
if (collision.gameObject.GetComponent<BulletComponent>() != null) anim.Play("DummyFall");
2023-04-04 06:04:34 +02:00
}
2023-06-01 17:03:48 +02:00
}