Files
Loong/Assets/_Loong/Scripts/DamagePart.cs
2025-07-01 14:54:02 +08:00

18 lines
461 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DamagePart : MonoBehaviour, Damagable
{
public Agent parent;
public void ApplyDamage(float value, int ownerIndex, Vector3 hitPos, Transform sender)
{
Debug.Log("部位受击:" + value);
// 传递伤害
parent.ApplyDamage(value, ownerIndex, hitPos, sender);
// 插在身上
sender.parent = transform.parent;
}
}