Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Win and Mac Native Dialogs for Unity Pro

Discussion in 'Made With Unity' started by bakno, May 9, 2012.

  1. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    If we sign it with our provisioning profile, I guess you won't be able to submit it either. It has to be signed with your provisioning profile.
     
  2. Batigol

    Batigol

    Joined:
    Oct 17, 2012
    Posts:
    234
    I think it may possible. Because they want to make sure that any one will take responsibility about the plugin
    Could you help us?
     
  3. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    According to this article that is not possible: http://furbo.org/2013/10/17/code-signing-and-mavericks/

    "The trick here is that the identity of the framework needs to match the identity of the app itself"

    In that same article, the author provides a way to build and sign in an order that should work for you. But I guess you will need to create a post-process script for this.
     
  4. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    Cool product, if you use (I use) Unity3D for making applications :=)
     
  5. Wh0lve

    Wh0lve

    Joined:
    May 15, 2013
    Posts:
    3
    Hi, i was wondering if the plugin supports 64bit builds.

    This because i don't seem to be able to get it to work in 64bit builds on either Windows or Mac OS (on Unity5).
     
  6. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    Hi

    We do have 64bit versions that work on Unity 4. Not tested on Unity 5 yet.

    If you write to info at bakno dot com and send us your invoice number, we will validate it and send you the 64bit files.
     
  7. Wh0lve

    Wh0lve

    Joined:
    May 15, 2013
    Posts:
    3
    Thank you for your quick reply. I have send you an e-mail!
     
  8. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    Ready Tim. Please let me know if they work on Unity 5.
     
  9. Wh0lve

    Wh0lve

    Joined:
    May 15, 2013
    Posts:
    3
    Alright my findings so far:

    The initial package works fine in Unity 5 on Mac OSX and Windows standalone 32bit builds. Editor doesn't work due to it being 64bit.

    The package containing the the 64bit build provided by Bakno currently works for me on Mac OSX 64bit builds however the open and save dialogs crash the application after confirming.

    All and all a nice package that struggles with the restrictions of implementing native features not supported by Unity.
     
  10. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    Hi, I purchased the plugin.

    The OpenFileDialog and warning dialogs works perfectly (not in editor but when you compile it for Mac).
    The SaveFileDialog had a Win32 error so I downloaded various CocoaDialog from links provided. Now it works in the editor but not when you compile it for Mac. (It doesn't open the dialog window at all). Is there a fix for this?

    (BTW I am using Unity 4.6 free. Mac version is Mavericks.)
     
    Last edited: Jun 29, 2015
  11. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    Hi yoonitee

    Please try saving the Mac version in 32Bit. If you need the 64Bit plugin for mac, please write me an email with your purchase receipt number. I guess we need to update the plugin in the store.
     
  12. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    Hello. No that's not it.

    I found the problem. It is in the NativePanels.cs file.

    The code after here: //This uses the Bundled file Dialog but its unstable
    is not correct. It does not call ShowSaveFileDialog but does something that only works in the editor. The code here is completely different to how the OpenFileDialog is called

    What I did was change if(isWindows) to if(isWindows || true) and that made the SaveWindow work on a Mac standalone build. I will have to make some more changes so that the correct data is sent to the save window. But I think I've got the general idea.

    Did you write NativePanel.cs yourself? If so, maybe you can fix it. Otherwise I'll have to fix it myself. It should look more like this:
    Code (CSharp):
    1.     public static string SaveFileDialog(string defaultFileName, string extension)
    2.     {
    3.         bool isWindows = Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor;
    4.         isFinished = false;
    5.         StringBuilder filePath = new StringBuilder(255);
    6.         string fName = "";
    7.         string extensionStr = "";
    8.        
    9.         if(string.IsNullOrEmpty(defaultFileName))
    10.             defaultFileName = "Untitled";
    11.            
    12.         if(isWindows )
    13.         {
    14.             if(!string.IsNullOrEmpty(extension))
    15.             {
    16.                 extensionStr = extension.ToUpper() + " File (*." + extension + ")\0*." + extension + "\0";
    17.             }
    18.             else
    19.             {
    20.                 extensionStr = "Text File (*.txt)\0*.txt";
    21.             }
    22.  
    23.         }
    24.         else
    25.         {
    26.             if(extension != null )
    27.             {
    28.            
    29.                     extensionStr = extension;
    30.                    
    31.             }
    32.             else
    33.             {
    34.                 extensionStr = "txt";
    35.             }
    36.  
    37.         }
    38.  
    39.         ShowSaveFileDialog(filePath, defaultFileName, extensionStr);
    40.        
    41.         if(!filePath.ToString().Equals("") && !filePath.ToString().Contains("." + extension))
    42.             filePath.Append("." + extension);
    43.        
    44.         fName = filePath.ToString();
    45.  
    46.         isFinished = true;
    47.         return fName.Trim();
    48.     }
     
    Last edited: Jun 29, 2015
  13. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    P.S. After I did the fix above it worked perfectly. I signed the app using the Mac App Asset (using the "User Selected File Access Read/Write enabled" entitlement). Now I'm submitting it to the Mac App Store . I will let you know if it gets through.

    Thank you very much. Even though I had to do a fix I still think this was well worth the money. Since I wouldn't have known how to do this otherwise.

    I will give it 4 stars out of 5 since it didn't work out of the box.
     
  14. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    P.S. Also can I request that you also include input text boxes too?

    And for an added bonus could you make it to access the native colour picker dialog boxes? (Or even the font dialog boxes!)
     
  15. kmo_win

    kmo_win

    Joined:
    Jun 24, 2015
    Posts:
    1
    Hi Bakno,
    I just purchased your plugin and it works fine with the fix of the files selection from IMD.
    I would like to ask you if possible, can you add the option to open the File selection Dialog with multiple selection of files and return an array of strings with the paths?

    Cheers
     
  16. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    @yoonitee Sorry, I just read your last messages. Thank you for fixing the NativePanel.cs and for providing instructions on how to sign the MacAppStore binary. We will consider the optional input box and multiple file selection (for @kmo_win) for a future version. We do have a native color picker plugin on the asset store. Just search for baKno.