Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Start () {
- yield WaitForSeconds(1.0);
- yield DoFunctionForTime( FunctionA, 1.0 );
- yield DoFunctionForTime( FunctionB, 1.0 );
- }
- function FunctionA() {
- Debug.Log("Function A!");
- }
- function FunctionB() {
- Debug.Log("Function B!");
- }
- function DoFunctionForTime(delegateFunction, time : float) : IEnumerator
- {
- var finishTime = Time.time + time;
- while (Time.time < finishTime)
- {
- delegateFunction();
- yield;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment