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

Material#

  • Can Read

  • Cannot Write

Description#

A constant Material value

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Inline(nameof(m_Value), typeof(Material), false)]
    
    [Title("Material")]
    [Category("Material")]
    
    [Description("A constant Material value")]
    [Image(typeof(IconMaterial), ColorTheme.Type.Blue)]
    
    [Keywords("Value", "Constant")]
    
    [Serializable]
    public class TypeMaterialConstant : TypeMaterial
    {
        [SerializeField] private Material m_Value;

        public override Material GetPreview(GameObject source) => this.m_Value;

        public TypeMaterialConstant() : this(null)
        { }
        
        public TypeMaterialConstant(Material value)
        {
            this.m_Value = value;
        }

        public override Material Get(Args args)
        {
            return this.m_Value;
        }

        public override string ToString() => TextUtils.Name(this.m_Value);

        protected override SubscriptionMode Subscription => SubscriptionMode.OnEditorChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.