21 lines
479 B
C#
21 lines
479 B
C#
using DragonLi.Frame;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
public class EnemyIDamagable : MonoBehaviour,IDamagable
|
|
{
|
|
public Enemy curEnemy;
|
|
public Player player;
|
|
public void ApplyDamage(float value, object info, Transform _sender)
|
|
{
|
|
if (player != null)
|
|
{
|
|
player.ApplyDamage(value, info, _sender);
|
|
return;
|
|
}
|
|
curEnemy.ChangeHp(value, info, _sender);
|
|
}
|
|
|
|
public float Health { get; set; }
|
|
}
|