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
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
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
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

使用密码保护数据

In order to protect your source code and content, you are recommended to use the Archiver tool to archive your resources into UNG archives. It implements data encrypting to avoid unauthorized access and provides a password protection.为了保护您的源代码和内容,建议您使用Archiver工具将资源归档到UNG归档文件中。它实现了数据加密以避免未经授权的访问,并提供了密码保护。

注意
Protected packages are entirely loaded into memory, no data streaming is available for them.受保护的程序包已完全加载到内存中,没有可用的数据流。

To protect resources, you need to create an archive with the password specified and pass the same password on engine initialization. The workflow is as follows:为了保护资源,您需要使用指定的密码创建档案,并在引擎初始化时传递相同的密码。工作流程如下:

  • Create an UNG archive with the specified password. For example, to create an archive named files.ung with the 12345 password that contains the textures directory, pass the following CLI:
    命令行
    ung_x86 -o files.ung -d textures -p 12345
    例如,要创建一个名为files.ung的存档,并使用12345密码包含textures目录,请使用以下CLI:
    命令行
    ung_x86 -o files.ung -d textures -p 12345
  • Specify the same password to be passed on engine initialization in the <your_project_name>.cpp file:
    源代码 (C++)
    #include <UnigineEngine.h>
    
    #include "AppSystemLogic.h"
    #include "AppWorldLogic.h"
    #include "AppEditorLogic.h"
    
    #ifdef _WIN32
    	int wmain(int argc,wchar_t *argv[]) {
    #else
    	int main(int argc,char *argv[]) {
    #endif
    	
    	Unigine::Engine::InitParameters init_params;
    	init_params.window_title = "Your_Title";
    	init_params_params.project = "<your_project_name>";
    	init_params_params.password = "12345";
    	Unigine::EnginePtr engine(init_params, argc, argv);
    	
    	AppSystemLogic system_logic;
    	AppWorldLogic world_logic;
    	AppEditorLogic editor_logic;
    	
    	engine->main(&system_logic,&world_logic,&editor_logic);
    	
    	return 0;
    }
    注意
    If you pass a project name during engine initialization, this means the engine will store its rewritable data (such as logs, cache and configuration files) in user profile (in C:\Users\<username> on Windows or in /home/<username> on Linux) rather than <UnigineSDK/bin/ or <UnigineSDK/data/ folders. If you pass a project name during engine initialization, this means the engine will store its rewritable data (such as logs, cache and configuration files) in user profile (in C:\Users\<username> on Windows or in /home/<username> on Linux) rather than <UnigineSDK/bin/ or <UnigineSDK/data/ folders.

    On engine initialization, you can set NULL to the project attribute of initialization parameters, if you don't need that data is stored in user profile:On engine initialization, you can set NULL to the project attribute of initialization parameters, if you don't need that data is stored in user profile:

    源代码 (C++)
    // engine initialization
    Unigine::Engine::InitParameters init_params;
    init_params_params.project = NULL;
    init_params_params.password = "12345";
    Unigine::EnginePtr engine(init_params, argc, argv);
    If you pass a project name during engine initialization, this means the engine will store its rewritable data (such as logs, cache and configuration files) in user profile (in C:\Users\<username> on Windows or in /home/<username> on Linux) rather than <UnigineSDK/bin/ or <UnigineSDK/data/ folders. On engine initialization, you can set NULL to the project attribute of initialization parameters, if you don't need that data is stored in user profile:
    engine initialization in the <your_project_name>.cpp file:
    源代码 (C++)
    #include <UnigineEngine.h>
    
    #include "AppSystemLogic.h"
    #include "AppWorldLogic.h"
    #include "AppEditorLogic.h"
    
    #ifdef _WIN32
    	int wmain(int argc,wchar_t *argv[]) {
    #else
    	int main(int argc,char *argv[]) {
    #endif
    	
    	Unigine::Engine::InitParameters init_params;
    	init_params.window_title = "Your_Title";
    	init_params_params.project = "<your_project_name>";
    	init_params_params.password = "12345";
    	Unigine::EnginePtr engine(init_params, argc, argv);
    	
    	AppSystemLogic system_logic;
    	AppWorldLogic world_logic;
    	AppEditorLogic editor_logic;
    	
    	engine->main(&system_logic,&world_logic,&editor_logic);
    	
    	return 0;
    }
    注意
    If you pass a project name during engine initialization, this means the engine will store its rewritable data (such as logs, cache and configuration files) in user profile (in C:\Users\<username> on Windows or in /home/<username> on Linux) rather than <UnigineSDK/bin/ or <UnigineSDK/data/ folders. 如果在引擎初始化期间传递项目名称,则意味着引擎将在用户配置文件中存储其可重写数据(例如日志,缓存和配置文件) 在Windows上为C:\Users\<username>,在Linux上为/home/<username>),而不是<UnigineSDK/bin/<UnigineSDK/data/文件夹。

    On engine initialization, you can set NULL to the project attribute of initialization parameters, if you don't need that data is stored in user profile:在引擎初始化时,如果不需要将数据存储在用户配置文件中,可以将 NULL 设置为初始化参数的 project 属性:

    源代码 (UnigineScript)
    // engine initialization
    Unigine::Engine::InitParameters init_params;
    init_params_params.project = NULL;
    init_params_params.password = "12345";
    Unigine::EnginePtr engine(init_params, argc, argv);
最新更新: 2023-06-23
Build: ()