Skip to content

Instantly share code, notes, and snippets.

@gkngkc
Created March 2, 2017 11:55
Show Gist options
  • Save gkngkc/9d971afbf4a73e392bde45df46b7fb7a to your computer and use it in GitHub Desktop.
Save gkngkc/9d971afbf4a73e392bde45df46b7fb7a to your computer and use it in GitHub Desktop.
#if UNITY_EDITOR
var mockLoginDialog = GameObject.FindObjectOfType<Facebook.Unity.Editor.Dialogs.MockLoginDialog>();
if (mockLoginDialog != null) {
typeof(Facebook.Unity.Editor.Dialogs.MockLoginDialog).GetField("accessToken", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue(mockLoginDialog, "your_access_token");
typeof(Facebook.Unity.Editor.Dialogs.MockLoginDialog).GetMethod("SendSuccessResult", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).Invoke(mockLoginDialog, null);
MonoBehaviour.Destroy(mockLoginDialog);
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment