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

Text Main Texture#

UI / Graphic / Text / Text Main Texture

  • Can Read

  • Cannot Write

Description#

The Main Texture property of the Text component

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.UI;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Text Main Texture")]
    [Category("UI/Graphic/Text/Main Texture")]
    [Description("The Main Texture property of the Text component")]
    
    [Image(typeof(IconUIText), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface, Label")]
    
    [Serializable]
    public class GenTypeTexture_Text_MainTexture : TypeTexture
    {
        [SerializeField] private GetGameObject m_Text = new GetGameObject(
            new GenTypeGameObject_Text()
        );
        
        public override Texture GetPreview(GameObject source)
        {
            GameObject instance = this.m_Text.GetPreview(source);
            if (instance == null) return default;
            
            Text component = instance.GetComponent<Text>();
            return component != null ? component.mainTexture : default;
        }
        
        public override Texture Get(Args args)
        {
            Text instance = this.m_Text.Get<Text>(args);
            return instance != null
                ? instance.mainTexture
                : default;
        }
        
        public override string ToString()
        {
            return $"{this.m_Text} Main Texture";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

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