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