Dear,
I have a class DBConn, which have 2 functions JoystickFound() and GetData():
public void JoystickFound(string JoystickName)
{
print ("Qr Found : "+JoystickName);
StartCoroutine(GetData(JoystickName));
}
IEnumerator GetData(string JoystickName)
{
WWWForm sendJoystickInfo = new WWWForm();
sendJoystickInfo.AddField("DBJoystickName",JoystickName);
WWW getdata = new WWW(GetUrlsPhp,sendJoystickInfo );
yield return getdata;
string[] split = getdata.text.Split("|"[0]);
JoystickName = split[0];
ProfileName = split[1];
LevellName = split[2];
}
When I run the project, i see an error that the StartCoroutine function should be called from Start function, when I do it it works perfectly.
However, I need to be able to run this function from inside a function Joystick Found, and not from start, any idea how to do that?