Trail Renderer Min Vertex Distance#
Effects / Trail Renderer / Trail Renderer Min Vertex Distance
Can Read
Can Write
Description#
The Min Vertex Distance property of the Trail Renderer 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("Trail Renderer Min Vertex Distance")]
[Category("Effects/Trail Renderer/Min Vertex Distance")]
[Description("The Min Vertex Distance property of the Trail Renderer component")]
[Image(typeof(IconTrailRenderer), ColorTheme.Type.Blue, typeof(BadgeEye))]
[Keywords("Effect")]
[Serializable]
public class GenTypeNumber_TrailRenderer_MinVertexDistance : TypeNumber
{
[SerializeField] private GetGameObject m_TrailRenderer = new GetGameObject(
new GenTypeGameObject_TrailRenderer()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_TrailRenderer.GetPreview(source);
if (instance == null) return default;
TrailRenderer component = instance.GetComponent<TrailRenderer>();
return component != null ? component.minVertexDistance : default;
}
public override double Get(Args args)
{
TrailRenderer instance = this.m_TrailRenderer.Get<TrailRenderer>(args);
return instance != null
? instance.minVertexDistance
: default;
}
public override void Set(double value, Args args)
{
TrailRenderer component = this.m_TrailRenderer.Get<TrailRenderer>(args);
if (component != null) component.minVertexDistance = (float) value;
}
public override string ToString()
{
return $"{this.m_TrailRenderer} Min Vertex Distance";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}