diff options
author | chai <chaifix@163.com> | 2020-10-29 19:39:42 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-29 19:39:42 +0800 |
commit | bdf47cf0fd36a5c858575a805cca70ab623868eb (patch) | |
tree | c93691007f656380decbcb93690292e273d4e217 /Assets/Scripts/Avatar/Avatar.cs | |
parent | 61fbc2cdd8368505c3c8ce893af020463cc2a669 (diff) |
*misc
Diffstat (limited to 'Assets/Scripts/Avatar/Avatar.cs')
-rw-r--r-- | Assets/Scripts/Avatar/Avatar.cs | 62 |
1 files changed, 62 insertions, 0 deletions
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;
+
+
+/// <summary>
+/// 角色,包括player和opponents
+/// </summary>
+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;
+ }
+
+}
|