This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine.PackageUng Class

This class is used to manage UNG packages.

PackageUng Class

Properties

int CompressionType#

The type of compression used in the package.

int NumFiles#

The number of files in the package.

Members


PackageUng ( string 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

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

PackageUng Clone ( ) #

Clones the package.

void Close ( ) #

Closes the package.

bool CreatePackage ( string name ) #

Creates a package with a given name.

Arguments

  • string name - Package name.

Return value

true if a package was created successfully; otherwise, false.

string 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 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.

bool Load ( string name ) #

Loads a package with a given name.

Arguments

  • string name - Package name.

Return value

true if a package was loaded successfully; otherwise, false.

bool ReadFile ( byte[] data, ulong 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

  • byte[] data - Data array.
  • ulong size - File size, in bytes.

Return value

true if a file was read successfully; otherwise, false.

bool SelectFile ( string name, out ulong size ) #

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

Arguments

  • string name - File name.
  • out ulong size - Integer variable to store the size of the selected file.

Return value

true if a file was selected successfully; otherwise, false.

bool WriteFile ( string name, byte[] OUT_data, ulong size ) #

Writes data to a file with a given name.

Arguments

  • string name - File name.
  • byte[] OUT_data - Data to be written.
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.
  • ulong size - Size of the data to be written, in bytes.

Return value

true if the data was successfully written to a file; otherwise, false.

bool ContainsFile ( string name ) #

Checks if the package contains the specified file.

Arguments

  • string name - File name.

Return value

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

bool RemoveFile ( string name ) #

Removes the specified file from the package.

Arguments

  • string 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 ( string name ) #

Returns the file ID in the package by its name.

Arguments

  • string 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.

uint GetFileSize ( int num ) #

Arguments

  • int num
Last update: 2024-08-07
Build: ()