kumakore / kumakore-sdk

Kumakore SDK
http://www.kumakore.com
3 stars 0 forks source link

load/save KumakoreApp by user (not internal) #8

Closed chbfiv closed 10 years ago

chbfiv commented 10 years ago

Saving is currently not saving the user information. Include this in the fix.

chbfiv commented 10 years ago

removed old pref models, and now use JSON and allow the developer to define the path. Kumakore.BuildPrefPath(String filename), builds a path using the platform recommended Paths.

Kumakore ... public static readonly String DEFAULT_PREF_EXT = ".kkp";

if UNITY3D

    public static readonly String DATA_PATH = Application.persistentDataPath;

else

    public static readonly String DATA_PATH = AppDomain.CurrentDomain.BaseDirectory;

endif

    public static String BuildPrefPath(String filename) {
        return Kumakore.DATA_PATH + filename + DEFAULT_PREF_EXT;
    }

Example load/save

_app.load(Kumakore.BuildPrefPath(API_KEY));

_app.save(Kumakore.BuildPrefPath(API_KEY));