private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Crashable")) { ICrashable c = other.gameObject.GetComponent <ICrashable>(); c.onCrash(); } }
public static void BlockingRunForm(Form form, ICrashable root) { Application.EnableVisualStyles(); sForm = form; sRoot = root; if (!Debugger.IsAttached) { //if (true) { Logger.Info("Listening for crashes."); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); try { Application.Run(form); } catch (Exception e) { Logger.Warn("Exception caught in GUI thread."); HandleException(e); } } else Application.Run(form); }