Particle System Total Time#
Effects / Particle System / Particle System Total Time
Can Read
Cannot Write
Description#
The Total Time property of the Particle System component
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Particle System Total Time")]
[Category("Effects/Particle System/Total Time")]
[Description("The Total Time property of the Particle System component")]
[Image(typeof(IconParticleSystem), ColorTheme.Type.Blue)]
[Keywords("Effect")]
[Serializable]
public class GenTypeNumber_ParticleSystem_TotalTime : TypeNumber
{
[SerializeField] private GetGameObject m_ParticleSystem = new GetGameObject(
new GenTypeGameObject_ParticleSystem()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_ParticleSystem.GetPreview(source);
if (instance == null) return default;
ParticleSystem component = instance.GetComponent<ParticleSystem>();
return component != null ? component.totalTime : default;
}
public override double Get(Args args)
{
ParticleSystem instance = this.m_ParticleSystem.Get<ParticleSystem>(args);
return instance != null
? instance.totalTime
: default;
}
public override string ToString()
{
return $"{this.m_ParticleSystem} Total Time";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}