Hi
I have Main class derived from Monobehaviour in which I do api calls(create user,authenticate,logout, etc) and related callback classes derived from App42CallBack. I want to access MainMenuPanel(which is a public gameobject variable) from AuthCallback class in order to make it visible. Can you please guide me how can I do that except making MainMenuPanel a static variable(Since static variables are not visible in unity editor, I dont want that)
public class DefaultController : MonoBehaviour
{
public GameObject mainMenuPanel;
public void GirişYapBtnClick()
{
string kullanıcıAdi = girişYapKA.text;
string pass = girişYapPass.text;
userService = sp.BuildUserService ();
userService.Authenticate(kullanıcıAdi,pass,new AuthCallback());
}
}
public class AuthCallback : App42CallBack
{
public void OnSuccess(object response)
{
Debug.Log("success ok");
User user = (User) response;
PlayerPrefs.SetString ("UserName", user.GetUserName());
PlayerPrefs.SetString ("SessionId", user.GetSessionId ());
Debug.Log ("UserName-A"+ user.GetUserName());
Debug.Log ("SessionId-A"+ user.GetSessionId ());
//HOW DO I ACCESS public gameobject MainMenuPanel HERE?
}
public void OnException(Exception e)
{
Debug.Log("Exception : " + e);
}
}