Library
The library is where all files are stored, on disk you can find it under Documents/Unbound/Library.Inside your unbound library you can find .ubs files, each file contains a Collection.Collections are containers for entities and all the other things that unbound can store and load, they are used to represent any sort of game scene you might need.
libraryLoadCollection(filePath, callbackOrFilters)
Load a collection from file.
If a .ubs collection file is not found in Documents/Unbound/Library, then the currently running playscript folder will be scanned next.
Arguments
filePath: string, relative path (ex. "library
callbackOrFilters:
Return
Table or IOTask , You get an entity list if no callback is passed, otherwise a handle to the async task if a callback is passed
librarySaveCollection(filePath, entities, callback)
Save a collection to disc.
Arguments
filePath: string, relative path (ex. "library
entities: table, list of entities to be saved.
callback: function(status), async callback invoked once the operation is done.
libraryListCollections(callback)
Get a list of all collections inside Documents/Unbound/Library and subfolders.
Arguments
callback: function(status,results), async callback invoked once the operation is done.
Return
IOTask , A handle to the async task
libraryDeleteCollection(filePath, callback)
Delete a collection .ubs file from the library.
Arguments
filePath: string, relative path (ex. "library
callback: function(status), async callback invoked once the operation is done.
libraryMoveCollection(oldFilePath, newFilePath, callback)
Move a collection .ubs file in the library (also equivalent to renaming the file).
Arguments
oldFilePath: string, relative path (ex. "library
newFilePath: string, relative path (ex. "otherDir/myAssetRenamed.ubs")
callback: function(status), async callback invoked once the operation is done.
libraryCopyCollection(oldFilePath, newFilePath, callback)
Copy a collection .ubs file in the library.
Arguments
oldFilePath: string, relative path (ex. "library
newFilePath: string, relative path (ex. "library
callback: function(status), async callback invoked once the operation is done.