void collider_onCollisionStarted(Colliders.CollisionInfo info) { if (info.Collider1 == collider && info.Collider2.Group.Name == "Blocker") { Move(-curTickMovement); } if (info.Collider2 == collider && info.Collider1.Group.Name == "Blocker") { Move(-curTickMovement); } }
private CollisionInfo RegisterCollision(Collider c1, Collider c2, AABB intersection) { for (int i = 0; i < collisions.Count; i++) { if ((collisions[i].c1 == c1 && collisions[i].c2 == c2) || (collisions[i].c1 == c2 && collisions[i].c2 == c1)) { return(collisions[i]); } } CollisionInfo c = new CollisionInfo(c1, c2, intersection); collisions.Add(c); c1.InvokeCollisionStarted(c); c2.InvokeCollisionStarted(c); if (onCollisionStarted != null) { onCollisionStarted.Invoke(c); } return(c); }
internal void InvokeCollisionStarted(CollisionInfo c) { if (onCollisionStarted != null) onCollisionStarted.Invoke(c); }
internal void InvokeCollisionEnded(CollisionInfo c) { if (onCollidionEnded != null) onCollidionEnded.Invoke(c); }
internal void InvokeColliding(CollisionInfo c) { if (onColliding != null) onColliding.Invoke(c); }
private CollisionInfo RegisterCollision(Collider c1, Collider c2, AABB intersection) { for (int i = 0; i < collisions.Count; i++) { if ((collisions[i].c1 == c1 && collisions[i].c2 == c2) || (collisions[i].c1 == c2 && collisions[i].c2 == c1)) { return collisions[i]; } } CollisionInfo c = new CollisionInfo(c1, c2, intersection); collisions.Add(c); c1.InvokeCollisionStarted(c); c2.InvokeCollisionStarted(c); if (onCollisionStarted != null) onCollisionStarted.Invoke(c); return c; }
void collider_onCollisionStarted(Colliders.CollisionInfo info) { collisions.Add(info); OnCollisionsChanged(); }
void collider_onCollidionEnded(Colliders.CollisionInfo info) { collisions.Remove(info); OnCollisionsChanged(); }