This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
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 ( ) const#

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 ( ) const#

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 - Package name.

Return value

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

int readFile ( unsigned char * OUT_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 * OUT_data - Data array.
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.
  • 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 - File 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 * OUT_data, int size ) #

Writes data to a file with a given name.

Arguments

  • const char * name - File name.
  • unsigned char * OUT_data - Data to be written.
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.
  • 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.

bool containsFile ( const char * name ) const#

Checks if the package contains the specified file.

Arguments

  • const char * name - File name.

Return value

true if the package contains the specified file; otherwise, false.

bool removeFile ( const char * name ) #

Removes the specified file from the package.

Arguments

  • const char * name - File name.

Return value

true if the specified file is successfully removed from the package; otherwise, false.

bool removeFile ( int num ) #

Removes the file with the specified ID from the package.

Arguments

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

Return value

true if the specified file is successfully removed from the package; otherwise, false.

int findFile ( const char * name ) const#

Returns the file ID in the package by its name.

Arguments

  • const char * name - File name.

Return value

File ID. A number between 0 and the total number of files in the package, or -1, if the file doesn't exist.
Last update: 2024-04-19
Build: ()