From a9cef4bb0b902e3ec2d3b5510e3de4e885f2be90 Mon Sep 17 00:00:00 2001 From: SmallFox <2806143047@qq.com> Date: Sun, 10 May 2026 11:16:18 +0800 Subject: feat:合并伤害体积 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/DamageVolumeSystem/DamageHost.cs | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Assets/Scripts/DamageVolumeSystem/DamageHost.cs (limited to 'Assets/Scripts/DamageVolumeSystem/DamageHost.cs') 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 generators = new(); + + // 当伤害接收时 + public UnityEvent onDamageReceived; + + // 刚体 + private Rigidbody _rigidbody; + + private void Start() + { + _rigidbody = GetComponent(); + } + } + + public struct Damage + { + // 伤害产生的组 + public int Group; + + // 伤害强度 + public int Force; + + // 伤害方向 + public Vector3 Direction; + } +} -- cgit