Line Renderer Use World Space#
Effects / Line Renderer / Line Renderer Use World Space
Can Read
Can Write
Description#
The Use World Space property of the Line 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("Line Renderer Use World Space")]
[Category("Effects/Line Renderer/Use World Space")]
[Description("The Use World Space property of the Line Renderer component")]
[Image(typeof(IconLineRenderer), ColorTheme.Type.Blue, typeof(BadgeEye))]
[Keywords("Effect")]
[Serializable]
public class GenTypeBool_LineRenderer_UseWorldSpace : TypeBool
{
[SerializeField] private GetGameObject m_LineRenderer = new GetGameObject(
new GenTypeGameObject_LineRenderer()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_LineRenderer.GetPreview(source);
if (instance == null) return default;
LineRenderer component = instance.GetComponent<LineRenderer>();
return component != null ? component.useWorldSpace : default;
}
public override bool Get(Args args)
{
LineRenderer instance = this.m_LineRenderer.Get<LineRenderer>(args);
return instance != null
? instance.useWorldSpace
: default;
}
public override void Set(bool value, Args args)
{
LineRenderer component = this.m_LineRenderer.Get<LineRenderer>(args);
if (component != null) component.useWorldSpace = (bool) value;
}
public override string ToString()
{
return $"{this.m_LineRenderer} Use World Space";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}