Created
February 5, 2020 23:15
-
-
Save hk1ll3r/fe22084ab0df59d84ea58e9fa6466181 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Buff : MonoBehaviour | |
{ | |
public void OnBuff() | |
{ | |
Debug.Log("buffed!"); | |
RunDelayed(2f, () => { | |
Debug.Log("debuffed!"); | |
}); | |
} | |
protected IEnumerator DelayedCoroutine(float delay, System.Action a) | |
{ | |
yield return new WaitForSeconds(delay); | |
a(); | |
} | |
protected Coroutine RunDelayed(float delay, System.Action a) | |
{ | |
return StartCoroutine(DelayedCoroutine(delay, a)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment