Sign In Register

How can we help you today?

Start a new topic
Answered

GameSparks Unity SDK base folder

it appears that there are several key code dependencies that expect the GameSparks folder to be in the root of the "Assets" folder.


:(


I'm sure my team is not the only one that often move third party assets down into subfolders....


Any thoughts?


Best Answer

Yeah..the world is not ending - we  ended up 'hardcoding' the hardcoded bits in 3 or 4 places in just a couple of files...

Dunno how you would implement a more 'directory aware' solution that was dynamically changeable - but...


Thanks!!


Hi Jeff,


Sorry to hear that's not ideal for you.

Actually I don't recall anyone objecting to this in recent memory.


I'll take your feedback to the team for consideration.


Thanks,


Oisin

Answer

Yeah..the world is not ending - we  ended up 'hardcoding' the hardcoded bits in 3 or 4 places in just a couple of files...

Dunno how you would implement a more 'directory aware' solution that was dynamically changeable - but...


Thanks!!

We'll keep you in mind for future updates.

Thanks for your patience Jeff. 

That's something I'd like to see, as well.

Would love to see this, also.  I did end up changing all the hardcoded bits like Jeff did, but as soon as I got it working it said my SDK was out of date and after updating I had to make all the changes again.  Super annoying.  To be fair, I've had to make similar changes to a few of the other 3rd party assets we're using, so it's not like you guys were the only ones to not handle this.  However, the others that I've had to change at least consolidated the root path into a single variable at the top of a file somewhere instead of defining it repeatedly and making me find all those different places.

It would be nice if we can move the folder where we want. For my own asset store products I use one of the DLLs to find the "package path". I guess for scripts (not in a DLL) could make calls into the DLL to find the package path or use some Directory parsing to find where the script is located.

The last bit with "assembly/editor" is to get rid of the sub folder the DLL is in so I get the actual "root" of my package.

 

public static string PackagesFullPath
{
   get
   {
     if (_packagePath != null)
     {
       if (Directory.Exists(_packagePath))
       {   // make sure it was not renamed since last detected
         return _packagePath;
       }
     }

     _packagePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
     _packagePath = _packagePath.Replace("\\", "/");
     _packagePath = _packagePath.Replace("assembly/editor", "");
     return _packagePath;
   }
}

 

 

 

 

Login to post a comment