void OnTriggerEnter(Collider other) { if (other.CompareTag("Goal")) { TC.StopTimer(); BUIC.FadeOutWin(); } if (other.CompareTag("Death Trigger")) { TC.StopTimer(); BUIC.FadeOutLose(); } }
void Update() { if (impulses.Count > 1) { Vector3[] narr = impulses.ToArray(); for (int i = 0; i < impulses.Count - 1; i++) { for (int j = i + 1; j < impulses.Count; j++) { if (Vector3.Dot(narr[i], narr[j]) < -0.1) { Debug.Log(Vector3.Dot(narr[i], narr[j])); } if (Vector3.Dot(narr[i], narr[j]) < -impulseThreshold) { TC.StopTimer(); BUIC.FadeOutLose(); } } } } impulses.Clear(); }