-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunity.py
More file actions
29 lines (23 loc) · 1007 Bytes
/
unity.py
File metadata and controls
29 lines (23 loc) · 1007 Bytes
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
class UnityCollider:
pass
class UnityCube(UnityCollider):
def __init__(self, position, rotation, size):
self.position = position
self.rotation = rotation
self.size = size
def __str__(self):
return "Cube\nPos: " + str(self.position) + "\nRot: " + str(self.rotation) + "\nSize: " + str(self.size)
class UnityCapsule(UnityCollider):
def __init__(self, position, rotation, height, radius):
self.position = position
self.rotation = rotation
self.height = height
self.radius = radius
def __str__(self):
return "Capsule (x-axis direction)\nPos: " + str(self.position) + "\nRot: " + str(self.rotation) + "\nHeight: " + str(self.height) + "\nRadius: " + str(self.radius)
class UnitySphere(UnityCollider):
def __init__(self, position, radius):
self.position = position
self.radius = radius
def __str__(self):
return "Sphere\nPos: " + str(self.position) + "\nRadius: " + str(self.radius)