@@ -0,0 +1,1161 @@
+package com.ezardlabs.dethsquare;%0A%0Apublic class Physics %7B%0A%0A%09public static RaycastHit raycast(Vector2 origin, Vector2 direction, float distance) %7B%0A%09%09direction.normalise();%0A%09%09Vector2 end = new Vector2(origin.x + direction.x * distance,%0A%09%09%09%09origin.y + direction.y * distance);%0A%09%09RaycastHit raycastHit = null;%0A%09%09for (Collider c : Collider.staticColliders) %7B%0A%09%09%09Vector2 hit = c.bounds.intersect(origin, end);%0A%09%09%09if (hit != null) %7B%0A%09%09%09%09if (raycastHit == null) %7B%0A%09%09%09%09%09raycastHit = new RaycastHit(hit, Vector2.distance(origin, hit), c.transform, c);%0A%09%09%09%09%7D else if (Vector2.distance(origin, hit) %3C raycastHit.distance) %7B%0A%09%09%09%09%09raycastHit.point = hit;%0A%09%09%09%09%09raycastHit.distance = Vector2.distance(origin, hit);%0A%09%09%09%09%09raycastHit.transform = c.transform;%0A%09%09%09%09%09raycastHit.collider = c;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return raycastHit;%0A%09%7D%0A%0A%09public static class RaycastHit %7B%0A%09%09public Collider collider;%0A%09%09public double distance;%0A%09%09public Vector2 point;%0A%09%09public Transform transform;%0A%0A%09%09RaycastHit(Vector2 point, double distance, Transform transform, Collider collider) %7B%0A%09%09%09this.point = point;%0A%09%09%09this.distance = distance;%0A%09%09%09this.transform = transform;%0A%09%09%09this.collider = collider;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add initial raycast implementation