RegisterToDatabase

Takes an existing entry and registers it to a new Databox object. This can be used if you are creating game objects at runtime. The newly created object takes the initial data information from an initial Databox object and registers itself to a runtime save game Databox object. Please see the advanced demo scene example here.

    public bool RegisterToDatabase(DataboxObject _dbToRegister, string _tableID, string _entryID, string _newEntryID)
  • _dbToRegister: The Databox object where we want to add the entry
  • _tableID: The original table name
  • _entryID: The original entry name
  • _newEntryID: The new entry name. You should usually use a unique id for this.

Example

    public DataboxObjectManager manager;

    // Get DataboxObject from DataboxObjectManager
    DataboxObject _fromDB = manager.GetDataboxObject(fromDBId);
    DataboxObject _toDB = manager.GetDataboxObject(toDBId);

    // Get unique Instance id from object for new entry id
    int _objectId = this.gameObject.GetInstanceID().ToString()

    _fromDB.RegisterToDatabase(_toDB, "TableName", "EntryName", _objectId);