Skip to content

Instantly share code, notes, and snippets.

@jmcguirk
Created September 13, 2013 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmcguirk/6553120 to your computer and use it in GitHub Desktop.
Save jmcguirk/6553120 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using Prime31;
using System;
/// <summary>
/// Test popup for error handling
/// </summary>
public class TestErrorPopup: MonoBehaviour
{
void Update() {
if (TriggerReady) {
TriggerError();
}
if (TriggerReady2) {
TriggerError2();
}
}
protected void OnErrorAPressed() {
GameLog.error("Error A pressed");
TriggerReady = true;
}
protected void OnErrorBPressed() {
GameLog.error("Error B pressed");
TriggerError();
}
protected void OnErrorCPressed() {
GameLog.error("Error C pressed");
TriggerReady2 = true;
}
protected void OnErrorDPressed() {
GameLog.error("Error D pressed");
TriggerError2();
}
protected void TriggerError() {
TriggerReady = false;
GameObject npe = null;
npe.GetComponent<AnimationComponent>();
}
protected void TriggerError2() {
TriggerReady2 = false;
try {
GameObject npe = null;
npe.GetComponent<AnimationComponent>();
} catch (Exception ex) {
GameLog.error("Error message 2 exception caught");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment