TIMING
This commit is contained in:
1 parent
ea8c059e9e
commit
7bbc213da2
99 files changed
+5879
-673
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class TrackLimits : MonoBehaviour {
|
||||
ShipControls ship;
|
||||
|
||||
float maxDmg = 125f;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void HitTrackLimits() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user