PPReader Native Extension for the Defold Game Engine
This library helps to read Unity PlayerPrefs file as a Lua table.
- If you want to update your Unity game with Defold version of the game and the user's progress is stored in PlayerPrefs.
- iOS
- macOS
- Android
You can use the PPReader extension in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
Or point to the ZIP file of a specific release.
Your Package
name must be the same as your package name in Unity version of the game. Game apk
must be signed with the same Certificate
and Private key
as Unity version of the apk
.
Forum post how to convert your Unity Certificate
and Private key
for using with Defold.
Your Bundle Identifier
must be the same as your bundle identifier in Unity version of the game. For the signing process, you must use the same Code Signing Identity
and Provisioning profile
as for Unity version of the game.
Your Bundle Identifier
must be the same as your bundle identifier in Unity version of the game. For the signing process, you must use the same Code Signing Identity
and Provisioning profile
as for Unity version of the game.
Add next lines to your game.project
file:
[ppreader]
company_name = YourCompanyName
product_name = YourProductName
Where YourCompanyName
is the name of the company from your Unity project (Project Settings
->Player
->Company Name
) and YourProductName
is the name of the product from your Unity project (Project Settings
->Player
->Product Name
).
Returns table with PlayerPrefs values and path to the file:
local ppreader = require("ppreader.ppreader")
local player_prefs, path_to_the_pp_file = ppreader.get()
pprint(player_prefs) -- Example:
--{
-- UnityGraphicsQuality = 3,
-- field = "string",
-- unity.player_sessionid = "your_session_id",
-- scores = 100,
-- unity.cloud_userid = "your_cloud_user_id",
-- New item = "",
-- some_FloatField = 2.3303999900818,
-- unity.player_session_count = "6",
-- SomeIntField = 100,
-- some_string_field = "some_sctring_for example-just-test@"
--}
print(path_to_the_pp_file) -- Example: /Users/your_user_name/Library/Preferences/unity.TestCompany.TestProduct.plist
PPReader library uses XML2LUA.
If you have any issues, questions or suggestions please create an issue or contact me: me@agulev.com Feel free to make a pull request if you know how to improve the code.