Can anyone can translate the idea of this code to c# :
var ArgumentsCollection = ;
var to_TimeOut = null ;
function QueueWorkRunOnce(Argument) {
clearTimeout(to_TimeOut);
ArgumentsCollection.push(Argument) ;
to_TimeOut = setTimeout(/* delegate */ function(){
Worker(ArgumentsCollection);
//Reset ArgumentsCollection
ArgumentsCollection = [] ;
},/*Delay in ms*/ 1000 );
}
function Worker(Collection){
alert(Collection.join(" ")) ;
}
onload = function(){
QueueWorkRunOnce("Hi")
//Some other stuff
QueueWorkRunOnce("There")
//Some other stuff
QueueWorkRunOnce("Hello")
QueueWorkRunOnce("World")
//after Xms + 1000ms Will alert("Hi There Hello World") ;
}()
@foxdanni, It appears that somebody already downvoted you for this, and while I won't do the same, I wanted to let you know why: on UnityAnswers, hijacking someone else's question, and posting a question as an answer, are frowned upon. I would suggest posting a new question, and you'll probably have better luck.
@foxdanni, It appears that somebody already downvoted you for this, and while I won't do the same, I wanted to let you know why: on UnityAnswers, hijacking someone else's question, and posting a question as an answer, are frowned upon. I would suggest posting a new question, and you'll probably have better luck.
– Julien-Lynge