Particle System Random Seed#
Effects / Particle System / Particle System Random Seed
Can Read
Can Write
Description#
The Random Seed 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]
[Set]
[Title("Particle System Random Seed")]
[Category("Effects/Particle System/Random Seed")]
[Description("The Random Seed property of the Particle System component")]
[Image(typeof(IconParticleSystem), ColorTheme.Type.Blue)]
[Keywords("Effect")]
[Serializable]
public class GenTypeInteger_ParticleSystem_RandomSeed : 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.randomSeed : default;
}
public override double Get(Args args)
{
ParticleSystem instance = this.m_ParticleSystem.Get<ParticleSystem>(args);
return instance != null
? instance.randomSeed
: default;
}
public override void Set(double value, Args args)
{
ParticleSystem component = this.m_ParticleSystem.Get<ParticleSystem>(args);
if (component != null) component.randomSeed = (uint) value;
}
public override string ToString()
{
return $"{this.m_ParticleSystem} Random Seed";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}