Set Visual Effect Allow Instancing#
Effects / Visual Effect / Set Visual Effect Allow Instancing
Description#
Sets the Allow Instancing property of Visual Effect component
Parameters#
| Name | Description |
|---|---|
| Visual Effect | |
| 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;
using UnityEngine.VFX;
namespace VisualScript.Runtime
{
[Title("Set Visual Effect Allow Instancing")]
[Category("Effects/Visual Effect/Allow Instancing")]
[Description("Sets the Allow Instancing property of Visual Effect component")]
[Image(typeof(IconVisualEffect), ColorTheme.Type.Yellow)]
[Keywords("Effect")]
[Parameter("Visual Effect")]
[Parameter("Value")]
[Serializable]
public class GenInstructionBool_VisualEffect_SetAllowInstancing : Instruction
{
[SerializeField] private GetGameObject m_VisualEffect = new GetGameObject(
new GenTypeGameObject_VisualEffect()
);
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Allow Instancing");
return $"{this.m_VisualEffect} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
VisualEffect component = this.m_VisualEffect.Get<VisualEffect>(args);
if (component == null) return Done;
component.allowInstancing = (bool) this.m_Value.Get(args);
return Done;
}
}
}