This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Режимы вывода изображения
Физика
Браузер SDK 2
Лицензирование и типы лицензий
Дополнения (Add-Ons)
Демонстрационные проекты
API Samples
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
Унифицированный язык шейдеров UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.AsyncQueue Class

Loading of files/meshes/images/nodes on demand is performed in a separate system thread, in addition to asynchronous content streaming. This class is used to control asynchronous data loading. It is possible to control loading queue by organizing files in groups and setting individual weights inside these groups.

To load files on demand, call the functions in the following order:

  1. First LoadFile() function is called to place the file in the queue for loading and obtain an ID, that will be used to identify a resource in subsequent operations.
  2. After that, different operations can be performed:
    • ForceFile() to load the file immediately.
    • RemoveFile() to remove the file from the queue in case there is no need to load it any more of to remove a file from the list of loaded files if it was loaded but no longer needed.
    • CheckFile() to check if the given file was requested to be loaded via loadFile() or if it has already been loaded.

The same algorithm is true for:

To get a loaded resource (image, mesh, or node) the following 2 groups of methods can be used:

For example:

Source code (C#)
// specify relative paths to resources to be loaded to a queue
static string[] meshes = {
	"meshes/box.mesh",
	"meshes/capsule.mesh",
	"meshes/cbox.mesh",
};

struct AsyncLoadRequest
{
	public string name;
	public int id;
};

List<AsyncLoadRequest> mesh_load_requests;

private void Init()
{

	mesh_load_requests = new List<AsyncLoadRequest>();

	// enqueue meshes to load
	for (int i = 0; i < meshes.Length; ++i)
	{
		string name = meshes[i];
		AsyncLoadRequest request;
		request.name = name;
		request.id = AsyncQueue.LoadMesh(name);
		mesh_load_requests.Add(request);
	}

}

private void Update()
{
	// check mesh load requests
	for (int i = 0; i < mesh_load_requests.Count; ++i)
	{
		var r = mesh_load_requests[i];

		if (AsyncQueue.CheckMesh(r.id) == 0)
			continue;

		// remove the mesh from the list of the loaded meshes and print a message
		AsyncQueue.RemoveMesh(r.id);
		Unigine.Log.Message("Loaded mesh {0}\n", r.name);

		mesh_load_requests.Remove(r);
	}

}

Handling Events#

You can add "resource loaded" event handlers for files, images, meshes or nodes and perform certain actions as a resource is loaded. The example below shows how to add a "loaded" event handler for image resource, that reports the name and id of the loaded image.

Notice
Do not call take-methods inside a handler function unless you are absolutely sure, that the resource is yours, otherwise internal engine managers will be forced to load it again and again every time. In such cases it is recommended to use get-methods.
Source code (C#)
// specify relative paths to resources to be loaded to a queue
static string[] textures = {
	"textures/black_d.texture",
	"textures/blue_d.texture",
	"textures/green_d.texture",
	"textures/orange_d.texture",
	"textures/red_d.texture",
	"textures/white_d.texture",
	"textures/yellow_d.texture",
};

private void Init()
{

	// enqueue textures to load
	for (int i = 0; i < textures.Length; ++i)
	AsyncQueue.LoadImage(textures[i]);
	// subscribing for the ImageLoaded event 
	AsyncQueue.EventImageLoaded.Connect(image_loaded);

}

// an image loaded event handler function
private void image_loaded(string name, int id)
	{
		AsyncQueue.RemoveImage(id);
		Log.Message("Image {0} loaded, ID: {0}\n", name, id);
	}
Notice
This class is a singleton.

See Also#

A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/systems/ folder:

  • async_02
  • stream_00

AsyncQueue Class

Properties

int NumLoadedResources#

The total number of currently loaded resources.

int NumLoadedNodes#

The total number of loaded nodes.

int NumLoadedMeshes#

The total number of loaded meshes.

int NumLoadedImages#

The total number of loaded images.

int NumLoadedFiles#

The total number of loaded files.

int NumLoadedData#

The total number of loaded data segments.

int NumQueuedResources#

The total number of queued resources waiting for background loading.

int NumQueuedNodes#

The total number of queued nodes waiting for the background loading.

int NumQueuedMeshes#

The total number of queued meshes waiting for the background loading.

int NumQueuedImages#

The total number of queued images waiting for the background loading.

int NumQueuedFiles#

The total number of queued files waiting for the background loading.

int NumQueuedData#

The total number of queued data segments waiting for the background loading.

float TotalTime#

The total time it took to process the loading queue.

Event<string, int> EventNodeLoaded#

The event triggered when the node is loaded. You can subscribe to events via Connect()  and unsubscribe via Disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(string name, int id)

Usage Example

Source code (C#)
// implement the NodeLoaded event handler
void nodeloaded_event_handler(string name,  int id)
{
	Log.Message("\Handling NodeLoaded event\n");
}

//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an EventConnections instance
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections nodeloaded_event_connections = new EventConnections();


// link to this instance when subscribing to an event (subscription to various events can be linked)
AsyncQueue.EventNodeLoaded.Connect(nodeloaded_event_connections, nodeloaded_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
AsyncQueue.EventNodeLoaded.Connect(nodeloaded_event_connections, (string name,  int id) => { 
		Log.Message("Handling NodeLoaded event lambda\n");
		}
	);

// later all of these linked subscriptions can be removed with a single line
nodeloaded_event_connections.DisconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the NodeLoaded event with a handler function
AsyncQueue.EventNodeLoaded.Connect(nodeloaded_event_handler);


// remove subscription to the NodeLoaded event later by the handler function
AsyncQueue.EventNodeLoaded.Disconnect(nodeloaded_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////

// define a connection to be used to unsubscribe later
EventConnection nodeloaded_event_connection;

// subscribe to the NodeLoaded event with a lambda handler function and keeping the connection
nodeloaded_event_connection = AsyncQueue.EventNodeLoaded.Connect((string name,  int id) => { 
		Log.Message("Handling NodeLoaded event lambda\n");
	}
);

// ...

// you can temporarily disable a particular event connection 
nodeloaded_event_connection.Enabled = false;

// ... perform certain actions

// and enable it back when necessary
nodeloaded_event_connection.Enabled = true;

// ...

// remove the subscription later using the saved connection
nodeloaded_event_connection.Disconnect();

//////////////////////////////////////////////////////////////////////////////
//   4. Ignoring NodeLoaded events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
AsyncQueue.EventNodeLoaded.Enabled = false;

// ... actions to be performed

// and enable it back when necessary
AsyncQueue.EventNodeLoaded.Enabled = true;

Event<string, int> EventMeshLoaded#

The event triggered when the mesh is loaded. You can subscribe to events via Connect()  and unsubscribe via Disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(string name, int id)

Usage Example

Source code (C#)
// implement the MeshLoaded event handler
void meshloaded_event_handler(string name,  int id)
{
	Log.Message("\Handling MeshLoaded event\n");
}

//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an EventConnections instance
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections meshloaded_event_connections = new EventConnections();


// link to this instance when subscribing to an event (subscription to various events can be linked)
AsyncQueue.EventMeshLoaded.Connect(meshloaded_event_connections, meshloaded_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
AsyncQueue.EventMeshLoaded.Connect(meshloaded_event_connections, (string name,  int id) => { 
		Log.Message("Handling MeshLoaded event lambda\n");
		}
	);

// later all of these linked subscriptions can be removed with a single line
meshloaded_event_connections.DisconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the MeshLoaded event with a handler function
AsyncQueue.EventMeshLoaded.Connect(meshloaded_event_handler);


// remove subscription to the MeshLoaded event later by the handler function
AsyncQueue.EventMeshLoaded.Disconnect(meshloaded_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////

// define a connection to be used to unsubscribe later
EventConnection meshloaded_event_connection;

// subscribe to the MeshLoaded event with a lambda handler function and keeping the connection
meshloaded_event_connection = AsyncQueue.EventMeshLoaded.Connect((string name,  int id) => { 
		Log.Message("Handling MeshLoaded event lambda\n");
	}
);

// ...

// you can temporarily disable a particular event connection 
meshloaded_event_connection.Enabled = false;

// ... perform certain actions

// and enable it back when necessary
meshloaded_event_connection.Enabled = true;

// ...

// remove the subscription later using the saved connection
meshloaded_event_connection.Disconnect();

//////////////////////////////////////////////////////////////////////////////
//   4. Ignoring MeshLoaded events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
AsyncQueue.EventMeshLoaded.Enabled = false;

// ... actions to be performed

// and enable it back when necessary
AsyncQueue.EventMeshLoaded.Enabled = true;

Event<string, int> EventImageLoaded#

The event triggered when the image is loaded. You can subscribe to events via Connect()  and unsubscribe via Disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(string name, int id)

Usage Example

Source code (C#)
// implement the ImageLoaded event handler
void imageloaded_event_handler(string name,  int id)
{
	Log.Message("\Handling ImageLoaded event\n");
}

//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an EventConnections instance
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections imageloaded_event_connections = new EventConnections();


// link to this instance when subscribing to an event (subscription to various events can be linked)
AsyncQueue.EventImageLoaded.Connect(imageloaded_event_connections, imageloaded_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
AsyncQueue.EventImageLoaded.Connect(imageloaded_event_connections, (string name,  int id) => { 
		Log.Message("Handling ImageLoaded event lambda\n");
		}
	);

// later all of these linked subscriptions can be removed with a single line
imageloaded_event_connections.DisconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the ImageLoaded event with a handler function
AsyncQueue.EventImageLoaded.Connect(imageloaded_event_handler);


// remove subscription to the ImageLoaded event later by the handler function
AsyncQueue.EventImageLoaded.Disconnect(imageloaded_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////

// define a connection to be used to unsubscribe later
EventConnection imageloaded_event_connection;

// subscribe to the ImageLoaded event with a lambda handler function and keeping the connection
imageloaded_event_connection = AsyncQueue.EventImageLoaded.Connect((string name,  int id) => { 
		Log.Message("Handling ImageLoaded event lambda\n");
	}
);

// ...

// you can temporarily disable a particular event connection 
imageloaded_event_connection.Enabled = false;

// ... perform certain actions

// and enable it back when necessary
imageloaded_event_connection.Enabled = true;

// ...

// remove the subscription later using the saved connection
imageloaded_event_connection.Disconnect();

//////////////////////////////////////////////////////////////////////////////
//   4. Ignoring ImageLoaded events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
AsyncQueue.EventImageLoaded.Enabled = false;

// ... actions to be performed

// and enable it back when necessary
AsyncQueue.EventImageLoaded.Enabled = true;

Event<string, int> EventFileLoaded#

The event triggered when the file is loaded. You can subscribe to events via Connect()  and unsubscribe via Disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(string name, int id)

Usage Example

Source code (C#)
// implement the FileLoaded event handler
void fileloaded_event_handler(string name,  int id)
{
	Log.Message("\Handling FileLoaded event\n");
}

//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an EventConnections instance
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections fileloaded_event_connections = new EventConnections();


// link to this instance when subscribing to an event (subscription to various events can be linked)
AsyncQueue.EventFileLoaded.Connect(fileloaded_event_connections, fileloaded_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
AsyncQueue.EventFileLoaded.Connect(fileloaded_event_connections, (string name,  int id) => { 
		Log.Message("Handling FileLoaded event lambda\n");
		}
	);

// later all of these linked subscriptions can be removed with a single line
fileloaded_event_connections.DisconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the FileLoaded event with a handler function
AsyncQueue.EventFileLoaded.Connect(fileloaded_event_handler);


// remove subscription to the FileLoaded event later by the handler function
AsyncQueue.EventFileLoaded.Disconnect(fileloaded_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////

// define a connection to be used to unsubscribe later
EventConnection fileloaded_event_connection;

// subscribe to the FileLoaded event with a lambda handler function and keeping the connection
fileloaded_event_connection = AsyncQueue.EventFileLoaded.Connect((string name,  int id) => { 
		Log.Message("Handling FileLoaded event lambda\n");
	}
);

// ...

// you can temporarily disable a particular event connection 
fileloaded_event_connection.Enabled = false;

// ... perform certain actions

// and enable it back when necessary
fileloaded_event_connection.Enabled = true;

// ...

// remove the subscription later using the saved connection
fileloaded_event_connection.Disconnect();

//////////////////////////////////////////////////////////////////////////////
//   4. Ignoring FileLoaded events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
AsyncQueue.EventFileLoaded.Enabled = false;

// ... actions to be performed

// and enable it back when necessary
AsyncQueue.EventFileLoaded.Enabled = true;

Members


Image GetImage ( int id ) #

Returns the image loaded by the specified operation.
Notice
This method does not remove the image from the list of loaded ones. If you want the image to be removed from this list right after retrieving it, use the TakeImage() method.

Arguments

  • int id - Loading operation identifier (see the LoadImage() method).

Return value

Image instance.

Mesh GetMesh ( int id ) #

Returns the mesh loaded by the specified operation.
Notice
This method does not remove the mesh from the list of loaded ones. If you want the mesh to be removed from this list right after retrieving it, use the TakeMesh() method.

Arguments

  • int id - Loading operation identifier (see the LoadMesh() method).

Return value

Mesh instance.

Node GetNode ( int id ) #

Returns the node loaded by the specified operation. If the node loaded by the specified operation consists of multiple objects, a new dummy object to combine them is created and its smart pointer is returned.
Notice
This method does not remove the node from the list of loaded ones. If you want the node to be removed from this list right after retrieving it, use the TakeNode() method.

Arguments

  • int id - Loading operation identifier (see the LoadNode() method).

Return value

Node instance.

int GetNodes ( int id, Node[] OUT_nodes ) #

Puts the nodes loaded by the specified operation to the specified array. If the node loaded by the specified operation consists of multiple objects, they are put into the array.
Notice
This method does not remove the nodes from the list of loaded ones. If you want the nodes to be removed from this list right after retrieving them, use the TakeNodes() method.

Arguments

  • int id - Loading operation identifier.
  • Node[] OUT_nodes - Array of loaded nodes' instances.
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.

Return value

1 if the operation is successful; otherwise, 0.

int CheckFile ( int id ) #

Returns a value indicating if the file is in the loading queue or already loaded.

Arguments

  • int id - Loading operation identifier (see the LoadFile() method).

Return value

1 if the file is in the loading queue or already loaded; otherwise, 0.

int CheckImage ( int id ) #

Returns a value indicating if the image is in the loading queue or already loaded.

Arguments

  • int id - Loading operation identifier (see the LoadImage() method).

Return value

1 if the image is in the loading queue or already loaded; otherwise, 0.

int CheckMesh ( int id ) #

Returns a value indicating if the mesh is in the loading queue or already loaded.

Arguments

  • int id - Loading operation identifier (see the LoadMesh() method).

Return value

1 if the mesh is in the loading queue or already loaded; otherwise, 0.

int CheckNode ( int id ) #

Returns a value indicating if the node is in the loading queue or already loaded.

Arguments

  • int id - Loading operation identifier (see the LoadNode() method).

Return value

1 if the node is in the loading queue or already loaded; otherwise, 0.

int ForceFile ( int id ) #

Forces loading of the file. The specified file will be loaded right after the currently loading file (if any) is processed. All other file system operations are suspended until the forced file is loaded.
Notice
The file won't be loaded immediately after calling the method as it can be large.

Arguments

  • int id - Loading operation identifier (see the LoadFile() method).

Return value

1 if the file is loaded successfully; otherwise, 0.

int ForceImage ( int id ) #

Forces loading of the image. The specified image will be loaded right after the currently loading image (if any) is processed. All other file system operations are suspended until the forced image is loaded.
Notice
The image won't be loaded immediately after calling the method as it can be large.

Arguments

  • int id - Loading operation identifier (see the LoadImage() method).

Return value

1 if the image is loaded successfully; otherwise, 0.

int ForceMesh ( int id ) #

Forces loading of the mesh. The specified mesf will be loaded right after the currently loading mesh (if any) is processed. All other file system operations are suspended until the forced mesh is loaded.
Notice
The mesh won't be loaded immediately after calling the method as it can be large.

Arguments

  • int id - Loading operation identifier (see the LoadMesh() method).

Return value

1 if the mesh is loaded successfully; otherwise, 0.

int ForceNode ( int id ) #

Forces loading of the node. The specified node will be loaded right after the currently loading node (if any) is processed. All other file system operations are suspended until the forced node is loaded.
Notice
The node won't be loaded immediately after calling the method as it can be large.

Arguments

  • int id - Loading operation identifier (see the LoadNode() method).

Return value

1 if the node is loaded successfully; otherwise, 0.

int LoadFile ( string name, int group = 0, float weight = 0.0f ) #

Loads a given file with the specified group and priority to the thread.

Arguments

  • string name - Absolute or relative path to the file (including its name).
  • int group - Priority group. Greater priority means faster loading. The default value is 0.
  • float weight - Weight of the priority inside the group. Greater weight means faster loading inside the same priority group. The default value is 0.0f.

Return value

Loading operation identifier.

int LoadImage ( string name, int group = 0, float weight = 0.0f ) #

Loads a given image file with the specified group and priority to the thread.

Arguments

  • string name - Absolute or relative path to the image file (including its name).
  • int group - Priority group. Greater priority means faster loading. The default value is 0.
  • float weight - Weight of the priority inside the group. Greater weight means faster loading inside the same priority group. The default value is 0.0f.

Return value

Loading operation identifier.

int LoadMesh ( string name, int group = 0, float weight = 0.0f ) #

Loads a given mesh-file with the specified group and priority to the thread.

Arguments

  • string name - Absolute or relative path to the *.mesh file (including its name).
  • int group - Priority group. Greater priority means faster loading. The default value is 0.
  • float weight - Weight of the priority inside the group. Greater weight means faster loading inside the same priority group. The default value is 0.0f.

Return value

Loading operation identifier.

int LoadNode ( string name, int group = 0, float weight = 0.0f ) #

Loads a given node-file with the specified group and priority to the thread.
Notice
In order to display such asynchronously loaded node, the updateEnabled() method should be called for it from the main thread.

Arguments

  • string name - Absolute or relative path to the *.node file (including its name).
  • int group - Priority group. Greater priority means faster loading. The default value is 0.
  • float weight - Weight of the priority inside the group. Greater weight means faster loading inside the same priority group. The default value is 0.0f.

Return value

Loading operation identifier.

int RemoveFile ( int id ) #

Removes the given file from the loading queue or from the list of loaded files, if it was already loaded.
Notice
If the specified file is currently loading, it will be removed after the loading operation is completed.

Arguments

  • int id - Loading operation identifier (see the LoadFile() method).

Return value

1 if the file is successfully removed; otherwise, 0.

int RemoveImage ( int id ) #

Removes the given image from the loading queue or from the list of loaded images, if it was already loaded.
Notice
If the specified image is currently loading, it will be removed after the loading operation is completed.

Arguments

  • int id - Loading operation identifier (see the LoadImage() method).

Return value

1 if the image is successfully removed; otherwise, 0.

int RemoveMesh ( int id ) #

Removes the given mesh from the loading queue or from the list of loaded meshes, if it was already loaded.
Notice
If the specified mesh is currently loading, it will be removed after the loading operation is completed.

Arguments

  • int id - Loading operation identifier (see the LoadMesh() method).

Return value

1 if the mesh is successfully removed; otherwise, 0.

int RemoveNode ( int id ) #

Removes the given node from the loading queue or from the list of loaded nodes, if it was already loaded.
Notice
If the specified node is currently loading, it will be removed after the loading operation is completed. Nodes are removed with all their hierarchy.

Arguments

  • int id - Loading operation identifier (see the LoadNode() method).

Return value

1 if the node is removed successfully; otherwise, 0.

Image TakeImage ( int id ) #

Returns the image loaded by the specified operation and removes it from the list of loaded images.

Arguments

  • int id - Loading operation identifier (see the LoadImage() method).

Return value

Image instance.

Mesh TakeMesh ( int id ) #

Returns the mesh loaded by the specified operation and removes it from the list of loaded meshes.

Arguments

  • int id - Loading operation identifier (see the LoadMesh() method).

Return value

Mesh instance.

Node TakeNode ( int id ) #

Returns the node loaded by the specified operation and removes it from the list of loaded nodes.
Notice
Nodes are removed with all their hierarchy.

Arguments

  • int id - Loading operation identifier (see the LoadNode() method).

Return value

Node instance.

int TakeNodes ( int id, Node[] OUT_nodes ) #

Puts the nodes loaded by the specified operation to the specified array and removes them from the list of loaded nodes. If the node loaded by the specified operation consists of multiple objects, they are put into the array.
Notice
Nodes are removed with all their hierarchy.

Arguments

  • int id - Loading operation identifier.
  • Node[] OUT_nodes - Array of loaded nodes' instances.
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.

Return value

1 if the operation is successful; otherwise, 0.

int LoadImageInfo ( string name, int group = 0, float weight = 0.0f ) #

Loads file info (size format, etc.) for the specified image, group and priority to the thread.

Arguments

  • string name - Absolute or relative path to the image file (including its name).
  • int group - Priority group. Greater priority means faster loading. The default value is 0.
  • float weight - Weight of the priority inside the group. Greater weight means faster loading inside the same priority group. The default value is 0.0f.

Return value

Loading operation identifier.
Last update: 13.12.2024
Build: ()