Implement enemies getting to a finish, enemy dying

This commit is contained in:
2024-08-13 16:46:46 +02:00
parent 3f715b2bbc
commit 5c6c425d9a
18 changed files with 514 additions and 461 deletions

View File

@@ -0,0 +1,36 @@
using Sirenix.OdinInspector;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class EnemyComponent : MonoBehaviour
{
[SerializeField]
[Required]
[OnValueChanged("Setup")]
private Enemy enemy;
[ReadOnly]
[SerializeField]
private bool isDead;
[SerializeField]
private UnityEvent<int> updateInitialHealth;
private void Start()
{
Setup();
}
private void Setup()
{
updateInitialHealth.Invoke(enemy.health);
}
public void Destroy()
{
Destroy(gameObject, 3);
}
}