I am attempting to set up the Facebook SDK in Unity, but am running into a problem.
Upon firing the FB.Login() function, I am greeted with two errors.
One states I can not have two modal windows at once. If I pay close attention, I can see one window is opened onto of another. I have looked on Google but bo clear solution is posted. Any ideas?
You cannot show two modal windows at once UnityEngine.GUI:ModalWindow(Int32, Rect, WindowFunction, String) EditorFacebookAccessToken:OnGUI() (at Assets/Facebook/Scripts/EditorFacebookAccessToken.cs:53)
Of note: I placed a Debug.log() above said error in script, to see if it is called twice, then the error occurs, however, the function is called once and then the error occurs.
The second error states...
ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint Aborting
Any help is greatly appreciated.
答案 0 :(得分:1)
我自己刚遇到这个错误。如果您转到生成错误的代码,您可以更改:
GUI.ModalWindow(...
到
GUI.Window(...
它似乎摆脱了错误。这只会在编辑器中运行时影响游戏,所以IMO并不是什么大不了的事。
答案 1 :(得分:1)
........
发生这种情况是因为模拟对话框与活动面板冲突,他认为它是一个开放的ModelWindow ...解决这个问题你有2个选项
选项no.1) - 将模拟对话框GUI更改为窗口...
双击错误,它会直接移动到代码行>>>替换
>>>GUI.ModelWindow<<< with >>>GUI.Window<<<
或者你可以在&lt;&lt;中找到它Assist / FacebookSdK / Sdk / scripts / platform editor / EditorFacebookMockDialog 根据Gui的功能。
选项2) - 在使用模拟对话框时关闭所有活动面板,然后在
之后重新激活它答案 2 :(得分:0)
这似乎是facebook sdk中的一个bug希望所以它会在以后的版本中解决而且这个错误只是在编辑器中它会在发布后正常工作,因为在EditorFacebookAccessToken脚本中它显示了一个GUI.ModelWindow有属性,只有一个模型窗口可以有人看过一次。您可以通过将GUI.ModelWindow替换为GUI.Window来解决此问题 或者只需替换EditorFacebookAccessToken脚本中的代码。使用Ctrl + F
查找代码GUI.ModelWindow(GetHashCode(), new Rect(windowLeft, windowTop, windowWidth, windowHeight), OnGUIDialog, "Unity Editor Facebook Login");
替换为
GUI.Window(GetHashCode(), new Rect(windowLeft, windowTop, windowWidth, windowHeight), OnGUIDialog, "Unity Editor Facebook Login");
答案 3 :(得分:0)
如果您使用的是facebook sdk 7.4和unity 5+,那么只需在EditorFacebookMockDialog脚本中将GUI.ModelWindow更改为GUI.Window。