Giter Club home page Giter Club logo

ppreader's Introduction

PPReader

PPReader Native Extension for the Defold Game Engine

This library helps to read Unity PlayerPrefs file as a Lua table.

Build Status

Possible use cases:

  • If you want to update your Unity game with Defold version of the game and the user's progress is stored in PlayerPrefs.

Platforms

  • iOS
  • macOS
  • Android

Setup

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:

https://github.com/AGulev/ppreader/archive/master.zip

Or point to the ZIP file of a specific release.

Android

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.

iOS

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.

macOS

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).

API

ppreader.get()

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

Special thanks

PPReader library uses XML2LUA.

Issues and suggestions

If you have any issues, questions or suggestions please create an issue or contact me: [email protected] Feel free to make a pull request if you know how to improve the code.

ppreader's People

Contributors

agulev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.