public static String getWorkingDirectory() {
        String home = System.getProperty("user.home", ".");
        File dir;
        String os = System.getProperty("os.name").toLowerCase();
        if (os.contains("linux") || os.contains("unix") || os.contains("sunos") || os.contains("solaris")) {
        	dir = new File(home, (new StringBuilder()).append('.').append(Unity.folder).append('/').toString());
        } else if (os.contains("win")) {
        	String s2 = System.getenv("APPDATA");
            if(s2 != null) {
                dir = new File(s2, (new StringBuilder()).append(".").append(Unity.folder).append('/').toString());
            } else {
                dir = new File(home, (new StringBuilder()).append('.').append(Unity.folder).append('/').toString());
            }
        } else if(os.contains("macos")) {
            dir = new File(home, (new StringBuilder()).append("Library/Application Support/").append(Unity.folder).toString());
        } else {
        	dir = new File(home, (new StringBuilder()).append(Unity.folder).append('/').toString());
        }
        if(!dir.exists() && !dir.mkdirs()) {
            throw new RuntimeException((new StringBuilder()).append("The working directory could not be created: ").append(dir).toString());
        } else {
            return dir.getAbsolutePath();
        }
    }