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