Canvas Renderer Set Alpha#
Rendering / Canvas Renderer / Canvas Renderer Set Alpha
Description#
Executes the Set Alpha method on the Canvas Renderer component
Parameters#
| Name | Description |
|---|---|
| Alpha |
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.Rendering;
namespace VisualScript.Runtime
{
[Title("Canvas Renderer Set Alpha")]
[Category("Rendering/Canvas Renderer/Set Alpha")]
[Description("Executes the Set Alpha method on the Canvas Renderer component")]
[Image(typeof(IconEye), ColorTheme.Type.TextLight)]
[Parameter("Alpha")]
[Serializable]
public class GenInstructionCanvasRenderer_SetAlpha_1 : Instruction
{
[SerializeField] private GetGameObject m_CanvasRenderer = new GetGameObject(
new GenTypeGameObject_CanvasRenderer()
);
[SerializeField] private GetNumber m_Alpha = new GetNumber();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Set Alpha");
return $"{this.m_CanvasRenderer} {method} ({this.m_Alpha})";
}
protected override Awaitable Run(Args args)
{
CanvasRenderer component = this.m_CanvasRenderer.Get<CanvasRenderer>(args);
if (component == null) return Done;
component.SetAlpha(
(float) this.m_Alpha.Get(args)
);
return Done;
}
}
}