Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class BaseClass : MonoBehaviour {
- public void MyInvoke(System.Action method, float delay) {
- StartCoroutine (StartMethodWithDelay (method, delay));
- }
- IEnumerator StartMethodWithDelay(System.Action method, float delay) {
- yield return new WaitForSeconds (delay); method ();
- }
- public void MyInvoke(System.Action<int> method, int parameter, float delay) {
- StartCoroutine (StartMethodWithDelay (method, parameter, delay));
- }
- IEnumerator StartMethodWithDelay(System.Action<int> method, int parameter, float delay) {
- yield return new WaitForSeconds (delay); method (parameter);
- }
- }
Add Comment
Please, Sign In to add comment