Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by moghes · Dec 13, 2016 at 01:09 PM · guiunity5unityeditorfacebook

You cannot show two modal windows at once UnityEngine.GUI:ModalWindow! I do not have UnityEngine.GUI in my Assembly Browser even

Hello everyone,

I'm having trouble with this common error.

You cannot show two modal windows at once UnityEngine.GUI:ModalWindow(Int32, Rect, WindowFunction, String, GUIStyle) Facebook.Unity.Editor.EditorFacebookMockDialog:OnGUI()

I am using Facebook SDK 7.9 (latest) with Unity 5.4.2 .. And this error opens when I tap invite friends button which has the FB.AppRequest() function.

Here's the invite code:

 public void InviteFriends()
     {
         print ("Facebook Manager Invite Friends");
 
         FB.AppRequest ("Join me to play Super Finger Runner!", null, null, null, null, null, "Invite to Super Finger Runner", delegate (IAppRequestResult result) {
             Debug.Log ("haya :  " + result.RawResult);
         });        
         
     }

however I see the print "Facebook Manager Invite Friends", and the error comes after, and Debug.Log ("haya : " + result.RawResult) never prints.

This means FB.AppRequest is not working ..

I search for fb.apprequest not working results and found this link, which was the subject but never solved.

Is there a chance that These 2 versions of facebook sdk and unity 5.4.2f2 will not work and I have to update one or both ??

Anyone experience in this please :)

Thanks

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image superfunapp · Mar 14, 2017 at 09:39 AM 0
Share

i have this problem, and i am not find the solution until now

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Landern · Dec 13, 2016 at 02:43 PM

Pretty sure there is an error in the FB SDK, in the editor it is using the old GUI system and base you're in the editor a mock dialog(see the source here). You can see the OnGUI method execute the ModalWindow on line 49:

 public void OnGUI()
 {
     GUI.ModalWindow(
         this.GetHashCode(),
         this.modalRect,
         this.OnGUIDialog,
         this.DialogTitle,
         this.modalStyle);
 }

This issue should only apply to the editor and not an actual platform build. You can clone the project and change it from a GUI.ModalWindow call to just GUI.Window and that will get ride of the error while executing in the Unity Editor. You will of course have to recompile it from the github source. Or just ignore it and worry about developing the core game. Again this is happening only because of their attempt to place a mock dialog in the editor during design and doesn't affect the platform build.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image moghes · Dec 13, 2016 at 06:34 PM 0
Share

@Landern thanks for the answer, but as I build an apk and install, the invite does not do anything, but it worked properly when I had the project with untiy 4.6.

I know its an editor error, but strange it does not respond to tap on my android device as well.

Also I don't know why I can't find the $$anonymous$$odalWindow in my whole solution

avatar image moghes · Dec 13, 2016 at 06:41 PM 0
Share

@Landern

I just followed the path mentioned in the github link and found the script.

here's the code:

 namespace Facebook.Unity.Editor
 {
     internal abstract class EditorFacebook$$anonymous$$ockDialog : $$anonymous$$onoBehaviour
     {
         //
         // Fields
         //
         private Rect modalRect;
 
         private GUIStyle modalStyle;
 
         //
         // Properties
         //
         public Utilities.Callback<ResultContainer> Callback {
             [CompilerGenerated]
             protected get;
             [CompilerGenerated]
             set;
         }
 
         public string CallbackID {
             [CompilerGenerated]
             protected get;
             [CompilerGenerated]
             set;
         }
 
         protected abstract string DialogTitle {
             get;
         }
 
         //
         // Constructors
         //
         protected EditorFacebook$$anonymous$$ockDialog ();
 
         //
         // $$anonymous$$ethods
         //
         protected abstract void DoGui ();
 
         public void OnGUI ();
 
         private void OnGUIDialog (int windowId);
 
         protected virtual void SendCancelResult ();
 
         protected virtual void SendErrorResult (string error$$anonymous$$essage);
 
         protected abstract void SendSuccessResult ();
 
         public void Start ();
     }
 }

As I see the OnGUI function empty!

Do I paste the content you mentioned above, in there? or this is an another case?

avatar image moghes · Dec 13, 2016 at 06:46 PM 0
Share

alt text

No $$anonymous$$odalWindow in the search!

pic.jpg (41.0 kB)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

102 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 5 GUI crashes android 2 Answers

Unity 5.5.0f3 Facebook Gameroom 1 Answer

Different sizes of jump when Android device 1 Answer

Can anyone give an easy C# code to create a list of rooms in a multiplayer with Photon/PUN 0 Answers

Bullet in editor does not behave the same in build. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges