diff options
| author | SmallFox <2806143047@qq.com> | 2026-05-10 11:16:18 +0800 |
|---|---|---|
| committer | SmallFox <2806143047@qq.com> | 2026-05-10 11:16:18 +0800 |
| commit | a9cef4bb0b902e3ec2d3b5510e3de4e885f2be90 (patch) | |
| tree | 05bcb55df0ffc5be1f4d02c2cba6c5ad831614cd /Assets/Scripts/DamageVolumeSystem/DamageHost.cs | |
| parent | d9fac68e24306673ff27e9f1c909a6f600d8dee0 (diff) | |
feat:合并伤害体积
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; + } +} |
