UE5.1_Niagara基础_官方内容示例_2.4
2.4 Location Events【位置事件】
Currently, Events are CPU Emitter Only!
【目前,事件只能在CPU发射器运行】
On GPU Emitters, we do have a Lead/Follower paradigm using the "Spawn Particles From Other Emitter" and "Sample Particles From Other Emitter" modules which utilize the Particle Attribute Reader. There is an example of these behaviors in action in the Niagara_Advanced hallway.
【在GPU发射器中,我们确实有个的引领/跟随者范例在使用“从其他发射器生成粒子”和“从其他发射器取样粒子”模组,而这些模组使用了粒子属性渲染。这是在高级示例地图中运转的例子】
Event Generators such as "Generate Location Event" live in particle scripts. Typically we default to sending a location event after the solver runs for the most accuracy, but the module can be moved wherever you like to determine when the event is sent.
We default the "Send Rate" to a sensible number of events per second, but that value can be lowered to throttle the rate at which events are sent. This will act as an optimization. Unchecking the bool next to "Event Send Rate" causes events to be sent every frame.
【事件生成器如“生成位置事件”存在于粒子脚本中。通常我们默认会在结算器运行后发送位置事件以获得最高的精确性,但模组可以被移动到你喜欢的事件发送点】
【我们默认事件每秒的“发送速率”为一个合理的数字,但这数值可以调低。这会以最优化的方式运行。取消勾选“事件发送速率”的下一个布尔框会使事件每帧都发送(UE5.1中:在Event Type中选择Every Frame为每帧发送)】
Generate Location Event also has a bool called "Event Generation Enabled" which determines whether events are sent at all. This bool can be driven by whatever logic you like, for instance only true if the particle age is over a certain value.
【生成位置事件也有个叫“事件生成启动”的布尔值决定是否发送事件。这个布尔可以被你喜欢的逻辑驱动,如粒子寿命超过某一值时才为真】
Event Receivers require an additional script inside them called an "Event Handler". You can think of this as another script, like particle spawn or update, which runs after the event is received. This needs to include a "Receive X Event" Module to handle the event, and then other modules can be placed inside to have additional effect on the particles which receive events, for example an additional location module to provide an additional offset from the received event position.
【事件接收者需要一个额外的脚本叫“事件处理器”。你可以把它认为是另一个脚本,像粒子生成和更新,它是在收到事件时运行。这需要包含一个“接收X事件”模组来处理事件,然后其他模组可以放到里面来对收到事件的粒子产生额外影响,如一个额外位置模组来给收到的事件位置提供一个额外的偏移】
Properties(Emitter)
Requires Persistent IDs【需要永久ID】:给粒子创建一个永久ID,生成事件的发射器需要启用此选项。
Gravity Force【重力】模组:给粒子添加重力
Generate Location Event【生成位置事件】模组:生成一个事件,包含发出此事件的粒子的许多参数。
Event Type【事件类型】
Send Rate【发送速率】:按照设置的发送速率发送事件。
Send Per Unit Traveled【按经过单位发送】:粒子经过设置的单位间隔时发送事件。
Every Frame【每帧】:每帧都发送事件。
(仅Send Rate)Event Send Rate【事件发送速率】
(仅Send Per Unit Traveled)Unit Spacing【单位间隔】
(仅Send Per Unit Traveled)Movement Tolerance【移动误差】
Event Generation Enabled【启动事件生成】
Event Probability【事件发送的概率】
Delay Before Sending Everys【延迟发送事件】:延迟多少秒才开始发送事件
点击下箭头Show Advanced【显示高级】查看和修改发送的粒子参数。
点击发射器属性一栏的“+Stage”添加“Event Handler”
Event Handler Properties【事件处理器属性】
Source【来源】:选择接收来自哪个发射器的哪个事件
Execution Mode【执行模式】:选择哪些粒子运行一次事件脚本。事件脚本由事件处理器里的模组组成。运行位置在粒子生成阶段之后
Every Particle【所有粒子】:此发射器存在的所有粒子
Spawned Particles【生成的粒子】:由当前事件生成的粒子
Max Events Per Frame【每帧最大事件数】:0为不限
Spawn Number【生成数量】:控制事件处理结果是否生成粒子
Random Spawn Number【随机生成数量】:为True时,上面设置的生成数量为最大随机数
Update Attribute Initial Values【更新属性初始值】:事件生成脚本是否修改粒子属性的初始值
Receive Location Event【接收位置事件】模组:设置是否将接收到的参数写进粒子属性中
(此专栏为视频对应的文本知识,详细内容讲解请看对应视频,有疑问请到对应视频下方评论区寻找答案,无法找到答案时再在该评论区提出问题,勿在此专栏下方的评论区提出问题)