虚幻引擎 游戏开发基础

1.Actor和Component

在Unreal Engine中,Actor 和 Component 是构建游戏世界的两个基本概念,它们之间有一些重要区别:

  1. Actor(角色)
    • Actor 是游戏世界中的实体,它可以被放置在场景中,并且可以是可见的或不可见的。
    • 每个 Actor 都有一个 Transform(位置、旋转和缩放信息),它定义了 Actor 在游戏世界中的位置和方向。
    • Actor 可以包含一个或多个 Component,它们定义了 Actor 的各种属性和功能An Actor is any object that can be placed into a level, such as a Camera, static mesh, or player start location. Actors support 3D transformations such as translation, rotation, and scaling. They can be created (spawned) and destroyed through gameplay code (C++ or Blueprints).(虚幻官方)
  2. Component(组件)
    • Component 是 Actor 的组成部分,用于定义 Actor 的特定功能或行为。
    • Component 可以包括网格、碰撞体、动画、物理属性等。
    • 一个 Actor 可以包含多个不同类型的 Component,每个 Component 负责不同的功能。
    • Component 本身不具备位置、旋转和缩放信息,都由它们所附加到的 Actor 来确定。Components are a special type of Object that Actors can attach to themselves as sub-objects. Components are useful for sharing common behaviors, such as the ability to display a visual representation, play sounds. They can also represent project-specific concepts, such as the way a vehicle interprets input and changes its own velocity and orientation. For example, a project with user-controllable cars, aircraft, and boats could implement the differences in vehicle control and movement by changing which Component a vehicle Actor uses.(虚幻官方)

因此,可以总结如下区别:

  • Actor 是游戏世界中的实体(角色、道具、车辆、摄像机、灯光等等),而 Component 是 Actor 的组成部分(Mesh、灯光、音频、碰撞体、摄像机、粒子系统、UI 等等)
  • Actor 具有 Transform 信息,而 Component 没有,它们的位置和方向是由它们所附加到的 Actor 决定的。
  • Actor 可以包含一个或多个 Component,每个 Component 负责不同的功能。

2.Array

Array(数组) 主要用于存储和处理游戏中的数据,如游戏对象、变量、状态等。作为一种灵活的数据结构,可以根据需要动态地增加或减少大小

Clear Array 节点 会将数组的长度缩减为零,移除数组中所有元素。以清空数组和释放内存。

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-19 17:56:01       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-19 17:56:01       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-19 17:56:01       58 阅读
  4. Python语言-面向对象

    2024-07-19 17:56:01       69 阅读

热门阅读

  1. linux报错-bash: ./xx.sh: Permission denied

    2024-07-19 17:56:01       15 阅读
  2. 网络安全等级保护制度是如何分级的?

    2024-07-19 17:56:01       19 阅读
  3. 【Leetcode】14. 最长公共前缀

    2024-07-19 17:56:01       17 阅读
  4. 从零开始!Jupyter Notebook 安装教程

    2024-07-19 17:56:01       21 阅读
  5. iptables

    iptables

    2024-07-19 17:56:01      19 阅读
  6. MATLAB6:M文件和控制流

    2024-07-19 17:56:01       18 阅读