Set Graphic Raycast Target#
UI / Graphic / Set Graphic Raycast Target
Description#
Sets the Raycast Target property of Graphic component
Parameters#
| Name | Description |
|---|---|
| Graphic | |
| 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.UI;
namespace VisualScript.Runtime
{
[Title("Set Graphic Raycast Target")]
[Category("UI/Graphic/Raycast Target")]
[Description("Sets the Raycast Target property of Graphic component")]
[Image(typeof(IconBrush), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Graphic")]
[Parameter("Value")]
[Serializable]
public class GenInstructionBool_Graphic_SetRaycastTarget : Instruction
{
[SerializeField] private GetGameObject m_Graphic = new GetGameObject(
new GenTypeGameObject_Graphic()
);
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Raycast Target");
return $"{this.m_Graphic} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
Graphic component = this.m_Graphic.Get<Graphic>(args);
if (component == null) return Done;
component.raycastTarget = (bool) this.m_Value.Get(args);
return Done;
}
}
}