- Home /
What can I do Invoke this way ?
If method have argument that How to call by Invoke ?
ex)
void MyMethod( GameObject myObject, int nCount) { myObject.xxxx; nCount = xxxx; }
void start () { Invoke("MyMethod", 2) <------ ???? }
How to send to MyMethod's argument(param)
rite now passing parameter is not supported... you can expect it soon.. still there are some scripts in wiki which could help u!!
Answer by luizgpa · Jan 19, 2012 at 12:30 PM
You will need a parameterless function that calls MyMethod. Eg:
var myGO : GameObject;
var count : int;
function InvokeMyMethod() {
MyMethod(myGO, count);
}
...
void Start() {
Invoke("InvokeMyMethod", 2);
}
haha smart..... ins$$anonymous$$d of doin this you dont even need to pass a parameter !! think of it you would get how funny it is !
lol, that's true. But this way you could Invoke methods on other objetcs.
ya upto an extend where there are restrictions it would help too! :D
Your answer
Follow this Question
Related Questions
Invoke() and InvokeRepeating() not working on webplayer? 1 Answer
Call a function once from OnGUI 2 Answers
Loading spinner freezez for a while 1 Answer
Custom Method Selection? 0 Answers
Jump Button needs to do two things 1 Answer