junglish
This commit is contained in:
1 parent
5d0abd46cd
commit
d424edf9be
11 files changed
+62936
-115
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ShipPhysics : MonoBehaviour {
|
||||
ShipControls ship;
|
||||
|
||||
float maxDmg = 150f;
|
||||
|
||||
void Awake() {
|
||||
ship = GetComponent<ShipControls>();
|
||||
}
|
||||
|
||||
void OnCollisionEnter(Collision collision) {
|
||||
// Debug-draw all contact points and normals
|
||||
// foreach (ContactPoint contact in collision.contacts) {
|
||||
// Debug.DrawRay(contact.point, contact.normal, Color.white);
|
||||
// }
|
||||
|
||||
if (collision.relativeVelocity.magnitude > maxDmg) {
|
||||
Debug.Log("Ddddestroyed by" + collision.gameObject.name);
|
||||
ship.Respawn();
|
||||
return;
|
||||
}
|
||||
|
||||
if (collision.gameObject.tag == "TrackLimits") {
|
||||
Debug.Log("Track Limits " + collision.gameObject.name);
|
||||
ship.Respawn();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user