EzDatabase

Support: All platforms

💡 Read full documentation in Xerus Games > EzCloud > Documentation

using XG.EzCloud; //add this directive to import types from EzCloud namespace

🚩 Save Data

Supported types: string, number (long, double), bool, Dictionary<string, Object>, List<Object>, Json

  • Write or replace data to a defined path.

EzDatabase.SetData(path, value, callback, fallback, objectName, isJson);

📄 Playmaker reference

  • Append data to a list in multiuser applications.

EzDatabase.PushData(path, value, callback, fallback, objectName, isJson);

📄 Playmaker reference

  • Update some of the keys for a defined path without replacing all of the data.

EzDatabase.UpdateData(path, update, callback, fallback, objectName, isJson);

📄 Playmaker reference

  • Update must be in Json

🚩 Load Data

You can either use callback normally or get the data snapshot with async/await for more flexibility (mobile and desktop only).

💡 Recommended: create custom class for your data then save/load using JSON serialization

Read data once

  • Read a static snapshot of the contents at a given path once.

EzDatabase.LoadData(path, callback, fallback, objectName);

string result = await EzDatabase.LoadData(path, fallback);

📄 Playmaker reference

  • Query (coming soon)

Listen for updates (Pro only)

On Mobile, Desktop:

EzDatabase.SubscribeListener(subscribe, path, valueChanged, childAdded, childChanged, childRemoved, childMoved);

On WebGL

EzDatabase.SubscribeListener(listen, path, callback, fallback, objectName);

📄 Playmaker reference