This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
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
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

快速开始与组件系统

What You Will Learn
你将学习什么#

Let's create a small game project to illustrate typical use cases and best practices for the C++ Component System.让我们创建一个小型游戏项目来说明 C++ 组件系统的典型用例和最佳实践。

The game that you will create is a simple top-down shooter with physics mechanics. The player controls the character with WASD buttons and rotates it to fire bullets using the cursor. The level has some geometric objects (cubes, spheres, etc) that can be thrown to holes by either pushing or shooting. The game has a time limit based on which the game ends. The application also provides a user interface to show the timer and the current amount of objects left to clear. At the end, the game outputs a widget with the reset functionality.你将创建的游戏是一个简单的自上而下射击与物理机制。玩家使用 WASD按钮控制角色,并使用光标旋转它以发射子弹。关卡中有一些几何物体(立方体,球体等),玩家可以通过推或射击将其抛入洞中。游戏有时间限制,这是基于游戏的结束。该应用程序还提供了一个用户界面来显示计时器和当前需要清除的对象数量。最后,游戏输出一个带有重置功能的小部件。

You will acquire some basic UNIGINE Editor skills and knowledge about the UNIGINE engine in general. The basic workflow for game logic implementation with the C++ Component System is given below.您将获得一些关于 UNIGINE 引擎的基本 UnigineEditor 技能和知识。 下面给出了使用 C++ 组件系统实现游戏逻辑的基本工作流程。

C++ Component System enables you to implement your application's logic via a set of building blocks — components, and assign these blocks to objects (nodes), giving them additional functionality. A logic component integrates a node, a C++ class, containing logic implementation (actions to be performed), and a property defining a set of additional parameters to be used.>允许您通过一组构建块(组件)来实现应用程序的逻辑,并将这些块分配给对象(节点),赋予它们额外的功能。逻辑组件集成了一个node,一个C++类,包含逻辑实现(要执行的操作),和一个属性,定义了一组要使用的附加参数。

In this tutorial you will learn how to:在本教程中,您将学习如何:

  1. Set Up the Project建立项目
  2. Create the Controllable Character创建可控字符
  3. Implement Shooting实施射击
  4. Generate Physical Objects生成物理对象
  5. Implement Color Zone实现颜色区域
  6. Play Background Music播放背景音乐
  7. Manage Game Rules管理游戏规则
  8. Create the End UI创建结束界面
  9. Build the Project构建项目
注意
The following tutorial is written with float coordinates precision for the Community edition of the SDK. If you wish to follow it using an SDK version with double coordinates precision, you must change data types in the code snippets accordingly (vec3 -> dvec3, and so on).下面的教程是用浮点坐标精度编写的,用于SDK的Community版本。如果您希望使用具有双坐标精度的SDK版本,则必须相应地更改代码片段中的数据类型(vec3 -> dvec3,等等)。

其他参考资料#

有关更多详细信息,请参阅 编程快速参考 文章,了解有关使用 UNIGINE 开发项目的工作流程阶段的关键信息。 它包含在开发您的第一个 Unigine 项目时非常有用的代码示例。

最新更新: 2024-12-13
Build: ()