Set Line Renderer Position Count#
Effects / Line Renderer / Set Line Renderer Position Count
Description#
Sets the Position Count property of Line Renderer component
Parameters#
| Name | Description |
|---|---|
| Line Renderer | |
| Value |
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
{
[Title("Set Line Renderer Position Count")]
[Category("Effects/Line Renderer/Position Count")]
[Description("Sets the Position Count property of Line Renderer component")]
[Image(typeof(IconLineRenderer), ColorTheme.Type.Blue, typeof(BadgeEye))]
[Keywords("Effect")]
[Parameter("Line Renderer")]
[Parameter("Value")]
[Serializable]
public class GenInstructionInteger_LineRenderer_SetPositionCount : Instruction
{
[SerializeField] private GetGameObject m_LineRenderer = new GetGameObject(
new GenTypeGameObject_LineRenderer()
);
[SerializeField] private GetInteger m_Value = new GetInteger();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Position Count");
return $"{this.m_LineRenderer} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
LineRenderer component = this.m_LineRenderer.Get<LineRenderer>(args);
if (component == null) return Done;
component.positionCount = (int) this.m_Value.Get(args);
return Done;
}
}
}