public static void refreshColliderList() { colliderBaseList = ColliderCon.getColliders(); if (colliderBaseList == null) { colliderBaseList = new ColliderData[0]; colliderNames = new string[0]; } colliderNames = new string[colliderBaseList.Length]; var i = 0; foreach (var coll in colliderBaseList) { colliderNames[i] = coll.name; i++; } }
public static void updateColliders() { colliderSnapshot = ColliderCon.getColliders(); foreach (var col in colliders) { var col1 = getColliderByName(col.first); var col2 = getColliderByName(col.second); if (col1 == null | col2 == null) { continue; } col.tripped = false; col.rfirst = col1; col.rsecond = col2; if (Vector3.Distance(col1.position, col2.position) < (col1.radius + col2.radius)) { col.tripped = true; } } }