From 0fdb81ffb2af8c39cfd611f485d46f3341206832 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 9 Nov 2020 16:03:45 +0800 Subject: * HitManager --- Assets/Scripts/Avatar/Hurtbox.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Assets/Scripts/Avatar/Hurtbox.cs (limited to 'Assets/Scripts/Avatar/Hurtbox.cs') diff --git a/Assets/Scripts/Avatar/Hurtbox.cs b/Assets/Scripts/Avatar/Hurtbox.cs new file mode 100644 index 00000000..b5bd738f --- /dev/null +++ b/Assets/Scripts/Avatar/Hurtbox.cs @@ -0,0 +1,33 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Hurtbox : MonoBehaviour +{ + [SerializeField] + private PhysicsBox m_BoxCollider; + public PhysicsBox Collider + { + get { + return m_BoxCollider; + } + } + + [SerializeField] + private MonoBehaviour m_Host; + + public IInteractable Host + { + get + { + return m_Host as IInteractable; + } + } + + private void Awake() + { + HitManager.Instance.AddHurtBox(this); + } + + +} -- cgit v1.1-26-g67d0