You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
1.0 KiB

using UnityEngine;
namespace UnityEditor.VFX.Operator
{
//[VFXHelpURL("Operator-PerParticleTotalTime")]
[VFXInfo(name = "Total Time (Per-Particle)", category = "Time")]
class PerParticleTotalTime : VFXOperator
{
public class OutputProperties
{
[Tooltip("Outputs the delta time with a random per-particle offset. This is useful for preventing particles in fast simulations from receiving similar attributes when they share the same delta time.")]
public float t = 0;
}
public override string name
{
get
{
return "Total Time (Per-Particle)";
}
}
protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
{
VFXExpression[] output = new VFXExpression[]
{
VFXBuiltInExpression.TotalTime + (VFXBuiltInExpression.DeltaTime * VFXOperatorUtility.FixedRandom(0xc43388e9, VFXSeedMode.PerParticle)),
};
return output;
}
}
}