This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Настройка свойств
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World Objects
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
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
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::PackageUng Class

Header: #include <UniginePackageUng.h>

This class is used to operate with UNG packages.

Notice
The maximum size for a file inside a UNG package is limited to 2 GB.

PackageUng Class

Members


static PackageUngPtr create ( const char * password = 0, int compression_type = 2 ) #

Constructor. Creates a package using specified compression type, protected by a given password, if provided. By default a package is created using ZLIB compression and without password protection.

Arguments

  • const char * password - Password.
  • int compression_type - Compression type. One of the COMPRESSION_* variables.

Ptr<PackageUng> clone ( ) #

Clones the package.

void close ( ) #

Closes the package.

int createPackage ( const char * name ) #

Creates a package with a given name.

Arguments

  • const char * name - Package name.

Return value

1 if a package was created successfully; otherwise, 0.

int getCompressionType ( ) #

Returns the type of compression used in the package.

Return value

Compression type. One of the COMPRESSION_* variables.

const char * getFileName ( int num ) #

Returns the name of a file with a given ID.

Arguments

  • int num - File ID. A number between 0 and the total number of files in the package.

Return value

File name.

int getNumFiles ( ) #

Returns the number of files in the package.

Return value

Number of files.

int isSupported ( ) #

Returns a value indicating if UNG-packages are supported.

Return value

1 if UNG packages are supported; otherwise, 0.
Notice
UNG-packages are not supported in evaluation version.

int load ( const char * name ) #

Loads a package with a given name.

Arguments

  • const char * name

Return value

1 if a package was loaded successfully; otherwise, 0.

int readFile ( unsigned char * data, int size ) #

Reads the contents of the currently selected file and puts it into the data array.
Notice
This operation is performed for a currently selected file. To select a file use selectFile().

Arguments

  • unsigned char * data - Data array.
  • int size - File size, in bytes.

Return value

1 if a file was read successfully; otherwise, 0.

int selectFile ( const char * name, int & size ) #

Selects a file with a given name as a current one and puts its size to size.

Arguments

  • const char * name
  • int & size - Integer variable to store the size of the selected file.

Return value

1 if a file was selected successfully; otherwise, 0.

int writeFile ( const char * name, unsigned char * data, int size ) #

Writes data to a file with a given name.

Arguments

  • const char * name
  • unsigned char * data - Data to be written.
  • int size - Size of the data to be written, in bytes.

Return value

1 if the data was successfully written to a file; otherwise, 0.
Last update: 29.04.2021
Build: ()