diff options
Diffstat (limited to 'Assets/Scripts/DamageVolumeSystem/DamageHost.cs')
| -rw-r--r-- | Assets/Scripts/DamageVolumeSystem/DamageHost.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Assets/Scripts/DamageVolumeSystem/DamageHost.cs b/Assets/Scripts/DamageVolumeSystem/DamageHost.cs new file mode 100644 index 0000000..f208bf8 --- /dev/null +++ b/Assets/Scripts/DamageVolumeSystem/DamageHost.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; + +namespace DamageVolumeSystem +{ + [RequireComponent(typeof(Rigidbody))] + public class DamageHost : MonoBehaviour + { + // 组 + [HideInInspector] public int group; + + // 伤害生成器列表 + [HideInInspector] public List<DamageGenerator> generators = new(); + + // 当伤害接收时 + public UnityEvent<Damage> onDamageReceived; + + // 刚体 + private Rigidbody _rigidbody; + + private void Start() + { + _rigidbody = GetComponent<Rigidbody>(); + } + } + + public struct Damage + { + // 伤害产生的组 + public int Group; + + // 伤害强度 + public int Force; + + // 伤害方向 + public Vector3 Direction; + } +} |
