Search Unity

MacOSX Build Rejected - (Screenshot Script)

Discussion in 'Scripting' started by MrEsquire, Oct 25, 2014.

  1. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Hi guys,

    I was wondering if you can help me with a small script issue. Currently I'm using a 3rd party Screenshot capture plugin within a game. There is a small code issue that prevents Apple approving the application unless a strict path is used to save the screenshots on the users machine. Please see the reply from Apple below and the example code:

    The application accesses the following location(s):
    '~/Pictures/Game_130586419867098100.png'
    Please note, it is acceptable to save screenshots to ~/Pictures, however it would be appropriate to store the screenshots in a folder within ~/Pictures, for example using a valid app-id;~/Pictures/Game/Game_130586419867098100.png


    Code (CSharp):
    1. private string GetFullPath(string path)
    2.         {
    3.             string filename = GetFileName();
    4.             string _path = path;
    5.            
    6.             #if UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_EDITOR
    7.             if(_path == ""){
    8.    
    9.             _path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures)+"/"+filename;
    10.  
    11.             }
    How can I edit the code so it allows for Apple to approve, I was thinking to somehow add a default created folder within the Pictures folder.


    Thank you.
     
    Last edited: Oct 26, 2014