- Home /
Pragma Strict Question/Problem
Hello my script is working fine but I want to optimize it, so I turned on #pragma strict.
Now I get some compiling errors I dont understand:
First here is the script
private var mysqlconnection : Component; mysqlconnection = gameObject.AddComponent(mysqlconn);
function CreateAccount (networkID : NetworkPlayer, username : String, password : String, email : String) { var result = mysqlconnection.insertAccount(username, password, email); networkView.RPC("CreationStatus", networkID, result); }
Now I get the error "BCE0019: 'insertAccount' is not a member of 'UnityEngine.Component'."
This error happens in line var result = mysqlconnection.insertAccount(....)
Hope you can help, thanks
Answer by Mike 3 · Jun 28, 2010 at 03:30 PM
you have to declare the type for mysqlconnection as the actual type:
private var mysqlconnection : mysqlconn;
Oh.. works :D
$$anonymous$$ike this is the 100' time you are helping me. Thank you very much :)