虚幻引擎 游戏开发基础

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 节点 会将数组的长度缩减为零,移除数组中所有元素。以清空数组和释放内存。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值