Unity 6.3
0 онлайн 87 гостей 3 в системе
Вход

ParticleSystem.TextureSheetAnimationModule.frameOverTime

Declaration

public ParticleSystem.MinMaxCurve frameOverTime;

Описание

Кривая для управления тем, какой кадр анимации листа текстуры будет воспроизводиться.

Система использует это свойство, когда ParticleSystem.TextureSheetAnimationModule.timeMode установлено на Кривая. Дополнительные ресурсы: MinMaxCurve.

using UnityEngine;

[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ParticleSystem ps;

void Start() { ps = GetComponent<ParticleSystem>();

var main = ps.main; main.startLifetimeMultiplier = 2.0f;

var tex = ps.textureSheetAnimation; tex.enabled = true; tex.numTilesX = 4; tex.numTilesY = 2;

// A simple ping-pong curve. AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 0.0f); curve.AddKey(0.5f, 1.0f); curve.AddKey(1.0f, 0.0f);

// Apply the curve. tex.frameOverTime = new ParticleSystem.MinMaxCurve(1.0f, curve); } }