From bdf47cf0fd36a5c858575a805cca70ab623868eb Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 29 Oct 2020 19:39:42 +0800 Subject: *misc --- Assets/Scripts/Avatar/Avatar.cs | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Assets/Scripts/Avatar/Avatar.cs (limited to 'Assets/Scripts/Avatar/Avatar.cs') diff --git a/Assets/Scripts/Avatar/Avatar.cs b/Assets/Scripts/Avatar/Avatar.cs new file mode 100644 index 00000000..47d8c4b7 --- /dev/null +++ b/Assets/Scripts/Avatar/Avatar.cs @@ -0,0 +1,62 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +/// +/// 角色,包括player和opponents +/// +public class Avatar : MonoBehaviour, IInteractable +{ + + + public PhysicsBody m_Body; + public PhysicsBox m_BodyCollider; + public PhysicsBox[] m_Hitbox; + public PhysicsBox[] m_Hurtbox; + + public PhysicsPrimitive[] GetAllPrimitive() + { + throw new System.NotImplementedException(); + } + + public PhysicsBox GetHitbox() + { + throw new System.NotImplementedException(); + } + + public PhysicsBox GetHurtbox() + { + throw new System.NotImplementedException(); + } + + public PhysicsPrimitive[] GetAllHit() + { + throw new System.NotImplementedException(); + } + + public bool IsHit() + { + for (int i = 0; i < m_Hitbox.Length; ++i) + { + if (PhysicsWorld.Instance.HasCollision(m_Hitbox[i])) + { + return true; + } + } + return false; + } + + public bool IsHurt() + { + for (int i = 0; i < m_Hitbox.Length; ++i) + { + if (PhysicsWorld.Instance.HasCollision(m_Hurtbox[i])) + { + return true; + } + } + return false; + } + +} -- cgit v1.1-26-g67d0