18 lines
461 B
C#
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;
|
|
}
|
|
}
|