Skip to content

Instantly share code, notes, and snippets.

@jakevsrobots
Created June 16, 2012 04:30
Show Gist options
  • Save jakevsrobots/2939922 to your computer and use it in GitHub Desktop.
Save jakevsrobots/2939922 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class EventsTest : MonoBehaviour {
void Start () {
EventManager.AddEventListener("test-event", delegate() {
Debug.Log("Test event was triggered!");
});
StartCoroutine(TriggerTestEvent());
}
IEnumerator TriggerTestEvent() {
Debug.Log("Waiting 3 seconds and then triggering event");
yield return new WaitForSeconds(3.0f);
EventManager.TriggerEvent("test-event");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment