Prediction: collider materials are now copied too

This commit is contained in:
mischa 2024-01-24 14:48:22 +01:00
parent 42dffbe898
commit 9f8c801795

View File

@ -73,6 +73,7 @@ public static void MoveBoxColliders(GameObject source, GameObject destination)
colliderCopy.center = sourceCollider.center;
colliderCopy.size = sourceCollider.size;
colliderCopy.isTrigger = sourceCollider.isTrigger;
colliderCopy.material = sourceCollider.material;
GameObject.Destroy(sourceCollider);
}
}
@ -92,6 +93,7 @@ public static void MoveSphereColliders(GameObject source, GameObject destination
colliderCopy.center = sourceCollider.center;
colliderCopy.radius = sourceCollider.radius;
colliderCopy.isTrigger = sourceCollider.isTrigger;
colliderCopy.material = sourceCollider.material;
GameObject.Destroy(sourceCollider);
}
}
@ -113,6 +115,7 @@ public static void MoveCapsuleColliders(GameObject source, GameObject destinatio
colliderCopy.height = sourceCollider.height;
colliderCopy.direction = sourceCollider.direction;
colliderCopy.isTrigger = sourceCollider.isTrigger;
colliderCopy.material = sourceCollider.material;
GameObject.Destroy(sourceCollider);
}
}
@ -132,6 +135,7 @@ public static void MoveMeshColliders(GameObject source, GameObject destination)
colliderCopy.sharedMesh = sourceCollider.sharedMesh;
colliderCopy.convex = sourceCollider.convex;
colliderCopy.isTrigger = sourceCollider.isTrigger;
colliderCopy.material = sourceCollider.material;
GameObject.Destroy(sourceCollider);
}
}