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

Scriptable Object#

  • Can Read

  • Cannot Write

Description#

A constant Scriptable Object value

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Inline(nameof(m_Value), typeof(ScriptableObject), false)]
    
    [Title("Scriptable Object")]
    [Category("Scriptable Object")]
    
    [Description("A constant Scriptable Object value")]
    [Image(typeof(IconCubeOutline), ColorTheme.Type.Blue, typeof(BadgeScriptableObject))]
    
    [Keywords("Value", "Constant")]
    
    [Serializable]
    public class TypeScriptableObjectConstant : TypeScriptableObject
    {
        [SerializeField] private ScriptableObject m_Value;

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

        public TypeScriptableObjectConstant() : this(null)
        { }
        
        public TypeScriptableObjectConstant(ScriptableObject value)
        {
            this.m_Value = value;
        }

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

        public override string ToString()
        {
            return TextUtils.Name(this.m_Value);
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnEditorChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.