Switch Case help
I'm trying to use 'manager.startHost()' from another c# file, but giving me a error can only be called from the main thread. What can i do to use my switch?
public int switchType(int id) {
switch (id) {
case 1:
findAccount(); <-- I run this first to go to the other C# File
break;
case 2:
manager.StartHost(); <-- Then once im in the other C# file, i call the second case.
break;
}
return id;
}
This give's the error 'can only be called from the main thread'
Comment