Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class UnityExtensions
- {
- public static void DelayAction (this MonoBehaviour mono, float timeDelay, System.Action action)
- {
- mono.StartCoroutine(cr_DelayAction(timeDelay,action));
- }
- private static IEnumerator cr_DelayAction (float timeDelay, System.Action action)
- {
- yield return new WaitForSeconds (timeDelay);
- if (action != null)
- action ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement