---
tags:
    - "Value"
    - "Constant"
---

# Texture

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

A constant Texture value

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

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

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

        public TypeTextureConstant() : this(null)
        { }
        
        public TypeTextureConstant(Texture value)
        {
            this.m_Value = value;
        }

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

        public override string ToString()
        {
            return TextUtils.Name(this.m_Value);
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnEditorChange;
    }
}
```

