summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Test/SaionjiScript_Physics.cs
blob: 1b296f43d9168ea7bd73cd32b8743b85f8ef7d6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class SaionjiScript : MonoBehaviour, IInteractable
{
	public PhysicsBox[] m_Hitbox;
	public PhysicsBox[] m_Hurtbox;
	public PhysicsBody m_Body;
    public PhysicsBox m_BodyCollider;

	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;
	}
}