Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Canvas Renderer Set Material#

Rendering / Canvas Renderer / Canvas Renderer Set Material Material, Texture

Description#

Executes the Set Material method on the Canvas Renderer component

Parameters#

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

Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.