Version: 2020.3

ParticleSystem.textureSheetAnimation

切换到手册
public ParticleSystem.TextureSheetAnimationModule textureSheetAnimation ;

描述

粒子系统 TextureSheetAnimationModule 的脚本接口。

通过此模块可以向粒子纹理添加动画。这通过创作翻页纹理来实现,这些纹理类似于下面这样:



每个编号区域都表示动画的一帧,必须在纹理中均匀分布。 在下面选择变量可查看脚本示例。您可能要在粒子系统上将此纹理与每个示例一起使用,以查看该模块的工作方式。

不需要将粒子系统模块重新分配回系统;它们是接口而不是独立的对象。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { ParticleSystem ps = GetComponent<ParticleSystem>(); var ts = ps.textureSheetAnimation; ts.enabled = true; ts.numTilesX = 2; ts.rowMode = ParticleSystemAnimationRowMode.Random; } }